# nlフィルタ定義(文字コード判定用なのでこの行は削除しないこと)
#20170201
#20170409

[Replace]
Name = 動画id保存[期限切れ動画用]
URL = www\.nicovideo\.jp/watch/[0-9]{1,12}
Require = &quot;isNeedPayment&quot;:true
AddVariable = dougaID
ContentType = text/html
Match<
(("|&quot;)video\2:\{\2id\2:\2[a-z]{2}(\d+))
>
Replace<
$3
>


[Replace]
Name = 有効期限切れの購入済み動画でキャッシュ利用
URL = www\.nicovideo\.jp/watch/[0-9]{1,12}
Require = &quot;isNeedPayment&quot;:true
ContentType = text/html
Match<
("|&quot;)(smileInfo\1:\{\1url\1:\1)\1
>
Replace<
$1$2http:\/\/smile-pcm00.nicovideo.jp\/smile?m=<nlVar:dougaID>\.0$1
>

[Replace]
Name = isNeedPaymentステート書き換え
URL = www\.nicovideo\.jp/watch/[0-9]{1,12}
Require = &quot;isNeedPayment&quot;:true
ContentType = text/html
Match<
&quot;isNeedPayment&quot;:true
>
Replace<
&quot;isNeedPayment&quot;:false
>

#[Replace]
Name = 有効期限切れの購入済み動画でキャッシュ利用
URL = www\.nicovideo\.jp/watch/
Require = &quot;isNeedPayment&quot;:true
ContentType = text/html
idGroup = 3
Match<
(("|&quot;)video\2:\{\2id\2:\2[a-z]{2}(\d+))(.+?)(title\2:\2.+?)\2(.+?smileInfo\2:\{\2url\2:\2).*?\2
>
Replace<
$1$4$5\(有効期限切れ：キャッシュ利用\)$2$6http:\/\/smile-com00.nicovideo.jp\/smile?m=$3.0<$low>$2
>



#[Replace]
Name = flapi:公開されてない公式動画でキャッシュが使われないこと対策1
URL = flapi.nicovideo.jp/api/getflv
idGroup = 3
Match<
&url=&(link=http%3A%2F%2Fwww.smilevideo.jp%2Fview%2F(\d+)%2F)
>
Replace<
&url=http%3A%2F%2Fsmile-pcm42.nicovideo.jp%2Fsmile%3Fm%3D$2.0000&$1
>

[Replace]
Name = watch:公開されてない公式動画でキャッシュが使われないこと対策2 [zero ver]
Require = &quot;isNeedPayment&quot;:1
URL = www.nicovideo.jp/watch/
idGroup = 3
Match<
(,&quot;videoId&quot;:&quot;so(\d+)&quot;,[\s\S]*?,)&quot;isNeedPayment&quot;:1,
>
Replace<
$1
> 