|
フィルタ、リスト公開/2
Top / フィルタ、リスト公開 / 2
最終更新: 2009-10-26 (月) 22:00:04 (12d)
|
[HTTP headers] In = TRUE Out = FALSE Key = "Location: title.ext (in) (070601)" Match = "?$TST(addrbarurl=http://title.ext/\1\?*)&\0" Replace = "http://title.ext/\1?\0" In = TRUE Out = TRUE Key = "URL: title.ext (both) (080225)" Match = "http://title.ext/[^?]+\?(filter=(0$FILTER(false)|1$FILTER(true))\&|) \0" Replace = "$SET(addrbarurl=\u)$RDIR(\0)" In = TRUE Out = FALSE Key = "Content-Disposition: title.ext (in) (080502) delete" Match = "?$TST(addrbarurl=http://title.ext/*)" In = FALSE Out = FALSE Key = "Content-Disposition: title.ext (in) (080502)" Match = "?$TST(addrbarurl=http://title.ext/\0\?*)(*; filename=$AV(*.\2)$SET(1=.)|)" Replace = "attachment; filename="\0.\1\2""
[Patterns]
Name = "YouTube: add download link (080201)"
Active = TRUE
URL = "(www.|jp.|)youtube.com/watch\?v\= $TYPE(htm)"
Limit = 256
Match = "$NEST(<div id=$AV(vidTitle)>,\0,</div>)$STOP()"
Replace = "<script>document.write('<span id="vidTitle"><a title="Download FLV" href="http://\h/get_video?video_id=' +swfArgs.video_id+ '&t=' +swfArgs.t+ '">')</script>"
"\0</a></span>"
" <button title="setClipboard" onclick="clipboardData.setData('Text',"
" document.getElementById('vidTitle').innerText.replace(/^(?: | )+|(?: | )+$/g, '').replace(/\\?/g, '?').replace(/"/g, '”').replace(/\\//g, '/').replace(/\\\\/g, '¥').replace(/</g, '<').replace(/>/g, '>').replace(/\\*/g, '*').replace(/\\|/g, '|').replace(/:/g, ':')"
"+ '.flv')">copy</button>"
上のフィルタとセットで使う。↓のタイトル.flvで保存するフィルタには不要。
[HTTP headers] In = TRUE Out = FALSE Key = "Content-Disposition: YouTube File ReNamer [060521] (In)" Match = "$URL(http://(^www)[^/]++.youtube.com/get_video\?video_id=\0)" Replace = "attachment; filename="\0.flv";"
更に弄って、タイトル.ext でダウンロードできるようにしたもの
※リネームの手間が省け、微妙に楽になりますが、ブラウザが別のファイルと認識するため、転送量が増大します(キャッシュを参照しない) → 元々YouTubeの動画はキャッシュしないようなので気にしなくてもいいかも
※IEを使用している場合、インターネットオプションの「UTF-8のURLを送信する」にチェックを入れないと、ファイル名が化けるっぽいです
JavaScriptとActiveXなどを無効にしていても動作します。
[Patterns]
Name = "YouTube: add download link [2009-09-19] title.ext"
Active = TRUE
URL = "([^/]++.|)youtube.com/watch(.php|)\?(v=|*\&v=)$TYPE(htm)"
Limit = 1024
Match = "($AV(t) : $AV(\0) ,&&$SET(YTube=\0)NoReplace)"
"|"
"<h1[^>]+>(^(^\0</h1>))"
"("
"(([^#%\\/:*?"<> |&]+((^\"+|\&[lg]t;+)\&|))+)\#"
""
"(#$SET(#=%23)"
"|%$SET(#=%25)"
"|\\$SET(#=¥)"
"|/$SET(#=/)"
"|:$SET(#=:)"
"|\*$SET(#=*)"
"|\?$SET(#=?)"
"|\"$SET(#=”)"
"|\"(;|)$SET(#=”)"
"|(^<[^>]+>)<$SET(#=<)"
"|\<(;|)$SET(#=<)"
"|>$SET(#=>)"
"|\>(;|)$SET(#=>)"
"|\|$SET(#=|)"
"|\s$SET(#= )"
"|)"
""
")+</h1>"
"$URL(http://(^(^*[?&]v=([^&]+)\1))$SET(3=.flv)(^(^*[?&](fmt=((18|22)$SET(3=.mp4)|1[37]$SET(3=.3gp)|$SET(3=.flv))[^&]+)\2|)))$STOP()"
Replace = "<h1><a title="Download Movie" href="http://title.ext/\@\3?http://\h/get_video?video_id=\1&t=$GET(YTube)&\2">\0</a></h1>"
ついでにhttp://d.hatena.ne.jp/Falky/20080126/1201309179も参考に。
[Patterns]
Name = "YouTube: add download link [2009-10-26] swf ajax"
Active = TRUE
URL = "([^/]++.|)youtube.com/watch(.php|)\?(v=|*\&v=) $TYPE(htm)"
Limit = 512
Match = "<h1[^>]+> \0 </h1>$STOP()"
Replace = "<script type="text/javascript" src="http://local.ptron/prototype.js"></script>\r\n"
"<script type="text/javascript">\r\n"
"onerror = function(){ return true };\r\n"
"_d = document;\r\n"
"var fmt = /[?&]fmt=\\d+(?=&|(?!.))/i.test(location.search) ? location.search.match(/[?&]fmt=(\\d+)(?=&|(?!.))/i)[1] : '';\r\n"
"_d.write('<h1 style="display:inline"><a id="prx_video_title" title="Download Movie" href="http://\h/get_video?video_id=' +yt.getConfig('SWF_ARGS').video_id+ '&t=' +yt.getConfig('SWF_ARGS').t+(fmt ? '&fmt='+fmt : '')+ '">');\r\n"
"</script>\r\n"
"\0</a> <span id="setclipboard_container" style="width:100px; height:22px; vertical-align:bottom"></span></h1> \r\n"
"<script type="text/javascript" src="http://local.ptron/swfobject.js"></script>\r\n"
"<script type="text/javascript">\r\n"
"var filename = ''\r\n"
" /* Unique Flag */\r\n"
" //+ 'YouTube_'\r\n"
" /* ID */\r\n"
" //+location.search.match(/(?:^\\?|&)v=([^&#]+)/)[1] + '_'\r\n"
" /* TITLE for NTFS */\r\n"
" + _d.getElementById('prx_video_title').innerHTML.replace(/<.*?>/g, '').replace(/^(?:\\s|\\u3000| )+|(?:\\s|\\u3000| )+$/g, '')\r\n"
" .replace(/\\?/g, '?').replace(/\\u0022/g, '”').replace(/\\//g, '/').replace(/\\\\/g, '¥').replace(/</g, '<').replace(/>/g, '>').replace(/\\*/g, '*').replace(/\\|/g, '|').replace(/:/g, ':')\r\n"
" /* ID */\r\n"
" +' ('+location.search.match(/(?:^\\?|&)v=([^&#]+)/)[1]+')'\r\n"
" /* EXTENSION */\r\n"
" + (/^(?:18|22)$/.test(fmt) ? '.mp4'\r\n"
" : /^1[37]$/.test(fmt) ? '.3gp'\r\n"
" : '.flv')\r\n"
";\r\n"
"_d.write('<textarea id="copy" style="display:none">'+filename+'</textarea>');\r\n"
"\r\n"
"var so = new SWFObject("http://local.ptron/setClipboard10.swf", "external_setclipboard", 100, 22, 8, "#FFFFFF");\r\n"
"so.addParam("bgcolor", "#FFFFFF");\r\n"
"so.addParam("allowScriptAccess", "always");\r\n"
"so.addVariable("htmlid", "copy");\r\n"
"so.addVariable("value", filename.replace(/&/g, '&'));\r\n"
"so.write("setclipboard_container");\r\n"
"\r\n"
"// add player link\r\n"
"_d.write('<span style="font-size:small !important">');\r\n"
"var base_url = location.href.replace(/\\?fmt=\\d+/i, '?').replace(/&fmt=\\d+/ig, '').replace(/\\?&/, '?');\r\n"
"if (!/^(?:18|22)$/.test(fmt))\r\n"
" _d.write('<b>FLV</b> / <a title="maybe" id="prxHQ" href="' +base_url+'&fmt=18'+ '">HQ</a> / <a href="' +base_url+'&fmt=22'+ '">'+(yt.getConfig('IS_HD_AVAILABLE') ? '<b>HD</b>' : '<del>HD</del>')+'</a>');\r\n"
"else if (fmt == 18)\r\n"
" _d.write('<a href="' +base_url+ '">FLV</a> / <b>'+(/^18/.test(yt.getConfig('SWF_ARGS').fmt_map) ? 'HQ' : '<del>HQ</del>')+'</b> / <a href="' +base_url+'&fmt=22'+ '" title="maybe" id="prxHD">HD</a>');\r\n"
"else\r\n"
" _d.write('<a href="' +base_url+ '">FLV</a> / <a title="maybe" id="prxHQ" href="' +base_url+'&fmt=18'+ '">HQ</a> / <b>'+(yt.getConfig('IS_HD_AVAILABLE') ? 'HD' : '<del>HD</del>')+'</b>');\r\n"
"_d.write('</span>');\r\n"
"if (fmt != 18 && Prototype)\r\n"
" var myAjax = new Ajax.Request(\r\n"
" base_url + '&fmt=18',\r\n"
" {\r\n"
" asynchronous: true,\r\n"
" method: 'get',\r\n"
" onComplete: function(a){\r\n"
" _d.getElementById('prxHQ').title = '';\r\n"
" if (/["']fmt_map["'] *: *["']18(%2F|\\/)/i.test(a.responseText))\r\n"
" _d.getElementById('prxHQ').style.cssText = 'font-weight:bold';\r\n"
" else\r\n"
" _d.getElementById('prxHQ').style.cssText = 'text-decoration:line-through';\r\n"
" }\r\n"
" }\r\n"
" );\r\n"
"if (!yt.getConfig('IS_HD_AVAILABLE') && fmt && fmt != 22 && Prototype)\r\n"
" var myAjax = new Ajax.Request(\r\n"
" base_url + '&fmt=22',\r\n"
" {\r\n"
" asynchronous: true,\r\n"
" method: 'get',\r\n"
" onComplete: function(a){\r\n"
" _d.getElementById('prxHD').title = '';\r\n"
" if (/["']fmt_map["'] *: *["']22(%2F|\\/)/i.test(a.responseText))\r\n"
" _d.getElementById('prxHD').style.cssText = 'font-weight:bold';\r\n"
" else\r\n"
" _d.getElementById('prxHD').style.cssText = 'text-decoration:line-through';\r\n"
" }\r\n"
" }\r\n"
" );\r\n"
"</script>"
Name = "YouTube: add download link [2009-10-26] swf ajax (2/2)"
Active = TRUE
URL = "([^/]++.|)youtube.com/watch(.php|)\?(v=|*\&v=) $TYPE(htm)"
Limit = 256
Match = "(^(^</body>))$STOP()"
Replace = "<script type="text/javascript">\r\n"
"if (!(fmt == 22 && yt.getConfig('IS_HD_AVAILABLE')) && !new RegExp('[?&]v=' + location.search.match(/(?:^\\?|&)v=([^&#]+)/)[1]).test(_d.referrer)) {\r\n"
" var prx_isHD, prx_isHQ;\r\n"
" var prx_timerID = setInterval(function(){\r\n"
" if (prx_isHD === undefined)\r\n"
" prx_isHD = (yt.getConfig('IS_HD_AVAILABLE') || (_d.getElementById('prxHD') && /^(?:bold|700)$/i.test(_d.getElementById('prxHD').style.fontWeight)))\r\n"
" ? true\r\n"
" : ((!_d.getElementById('prxHD') && !yt.getConfig('IS_HD_AVAILABLE')) || (_d.getElementById('prxHD') && _d.getElementById('prxHD').style.textDecoration === 'line-through'))\r\n"
" ? false\r\n"
" : undefined;\r\n"
" if (prx_isHD === undefined) return;\r\n"
" \r\n"
" if (prx_isHQ === undefined)\r\n"
" prx_isHQ = (_d.getElementById('prxHQ') && /^(?:bold|700)$/i.test(_d.getElementById('prxHQ').style.fontWeight))\r\n"
" || (fmt == 18 && /^18/.test(yt.getConfig('SWF_ARGS').fmt_map))\r\n"
" ? true\r\n"
" : (!_d.getElementById('prxHQ') || _d.getElementById('prxHQ').style.textDecoration === 'line-through')\r\n"
" ? false\r\n"
" : undefined;\r\n"
" if (prx_isHQ === undefined) return;\r\n"
" \r\n"
" clearInterval(prx_timerID);\r\n"
" if (prx_isHD)\r\n"
" location.href = base_url + '&fmt=22';\r\n"
" else if (prx_isHQ && fmt != 18)\r\n"
" location.href = base_url + '&fmt=18';\r\n"
" else if (!prx_isHQ && fmt)\r\n"
" location.href = base_url;\r\n"
" }, 200);\r\n"
"}\r\n"
"</script>"「var filename」以降がクリップボードに代入される文字列になります。適当にいじって使用してください。
2009-10-26 仕様変更に対応 2009-09-19 仕様変更に対応 2009-05-05 仕様変更に対応 090502 (2/2) Operaでも動くようにした & HDもHQも無かった場合、fmtを解除するようにした 例:http://www.youtube.com/watch?v=_KkB5dBN1bY&fmt=18 090425 fmt指定が無効になっていたエンバグを修正 090422 AjaxでHQ/HD動画があるか確認するようにした(確認不要な場合は処理せず) 090421 HD版の有無&本当にfmt=18かどうかを表示するようにした&fmt=13,17の場合拡張子を.3gpに 090404 無駄な空間ができるようになっていたのを修正
[Patterns]
Name = "PhotoZou: add download link (090404) swf"
Active = TRUE
URL = "([^/]++.|)photozou.jp/(video|photo)/"
Limit = 256
Match = "<end>"
Replace = "<script type="text/javascript" defer="defer">\r\n"
"_d = document;\r\n"
"if ((tgt = _d.getElementById('media_title')) || (tgt = _d.getElementById('pickup_data_title'))) {\r\n"
" var tgt_html = tgt.innerHTML;\r\n"
" var filename = ''\r\n"
" /* Unique Flag */\r\n"
" + 'PhotoZou_'\r\n"
" /* ID */\r\n"
" + so.getVariable('user_id') +'-'+ so.getVariable('photo_id') +'_'\r\n"
" /* TITLE for NTFS */\r\n"
" + tgt_html.replace(/<.*?>/g, '').replace(/^(?:\\s|\\u3000| )+|(?:\\s|\\u3000| )+$/g, '')"
" .replace(/\\?/g, '?').replace(/"/g, '”').replace(/\\//g, '/').replace(/\\\\/g, '¥').replace(/</g, '<').replace(/>/g, '>').replace(/\\*/g, '*').replace(/\\|/g, '|').replace(/:/g, ':')\r\n"
" /* EXTENSION */"
" + '.flv'\r\n"
" ;\r\n"
" tgt.innerHTML = '<a href="' + so.getVariable('url') + '" title="Download Movie">' +tgt_html+ '</a> <textarea id="copy" style="display:none">'+filename+'</textarea><span id="setclipboard_container" style="width:100px; height:22px; vertical-align:bottom"></span>';\r\n"
" \r\n"
" var so = new SWFObject("http://local.ptron/setClipboard10.swf", "external_setclipboard", 100, 22, 8, "#FFFFFF");\r\n"
" so.addParam("bgcolor", "#FFFFFF");\r\n"
" so.addParam("allowScriptAccess", "always");\r\n"
" so.addVariable("htmlid", "copy");\r\n"
" so.addVariable("value", filename.replace(/&/g, '&'));\r\n"
" so.write("setclipboard_container");\r\n"
"}\r\n"
"</script>"
「var filename」以降がクリップボードに代入される値になるので、適当にいじって使ってください。
090404 FlashPlayer10に対応
prototype.js が必要です(適当に探してください)
[Patterns]
Name = "YourFileHost: add download link (090204) swf"
Active = TRUE
URL = "([^/]++.|)yourfilehost.com/$TYPE(htm)"
Limit = 128
Match = "URL to Link to this File :&&\0$STOP()"
Replace = "<script type="text/javascript" src="http://local.ptron/prototype.js"></script>\r\n"
"<script type="text/javascript" src="http://local.ptron/swfobject.js"></script>\r\n"
"<script type="text/javascript">\r\n"
"_d = document;\r\n"
"_d.write('<a id="movie_download_link" style="font-size:large; font-weight:bold"></a> <span id="setclipboard_container" style="vertical-align:bottom"></span><br />');\r\n"
"\r\n"
"var myAjax = new Ajax.Request(\r\n"
" decodeURIComponent(Prototype.Browser.IE\r\n"
" ? _d.getElementById('objectPlayer').movie.match(/video=([^&]+)/i)[1]\r\n"
" : _d.getElementById('objectPlayer').innerHTML.match(/<param\\s[^>]*?name=["']?movie["']?\\s[^>]*?value=["']?[^"'>]*?video=([^&"'>]+)/i)[1]\r\n"
" ),\r\n"
" {\r\n"
" asynchronous: true,\r\n"
" method: 'get',\r\n"
" onComplete: function(a){\r\n"
" var thumb_url = decodeURIComponent(a.responseText.match(/(?:^|&)photo=([^&]+)/)[1]);\r\n"
" var movie_url = decodeURIComponent(a.responseText.match(/(?:^|&)video_id=([^&]+)/)[1]);\r\n"
" var obj = _d.getElementById('movie_download_link');\r\n"
" obj.href = movie_url;\r\n"
" obj.innerHTML = '<img src="' +thumb_url+ '" title="Download Movie" style="margin-right:1ex; border:1px solid black" />[[[ Download Movie ]]]';\r\n"
" \r\n"
" var so = new SWFObject("http://local.ptron/setClipboard10.swf", "external_setclipboard", 100, 22, 8, "#FFFFFF");\r\n"
" so.addParam("bgcolor", "#FFFFFF");\r\n"
" so.addParam("allowScriptAccess", "sameDomain");\r\n"
" so.addVariable("value", ""\r\n"
" /* Unique Flag */\r\n"
" + "YourFileHost_"\r\n"
" /* ID (default file-name) */\r\n"
" + location.search.match(/file=([^&]+)/i)[1]\r\n"
" /* TITLE for NTFS */\r\n"
" // not found\r\n"
" /* EXTENSION */\r\n"
" + movie_url.match(/(\\.[a-zA-Z\\d]+)(?:[?#]|(?!.))/)[1]\r\n"
" );\r\n"
" so.write("setclipboard_container");\r\n"
" }\r\n"
" }\r\n"
");\r\n"
"</script>\r\n\0"
[Patterns] Name = "YourFileHost: download original file [2008/03/07]" Active = TRUE URL = "www.yourfilehost.com/" Limit = 256 Match = "$NEST(<!--,*DOWNLOAD ORIGINAL FILE&\0,-->)$STOP()" Replace = "\0"
[Patterns] Name = "PornoTube: add download link (080610)" Active = TRUE URL = "([^/]++.|)pornotube.com/$TYPE(htm)" Limit = 512 Match = "<(img\s[^>]++src=$AV(*/videos+/\0/\1.jpg)*>$SET(ptad=\0)" "|/body>$SET(0=$GET(ptad))$URL([^?]+\?m=([0-9]+)\1)$SET(2=style="position:absolute;top:0px;left:0px" )" ")&&\9" Replace = "\9\r\n" "<a \2href="http://video.pornotube.com/\0/\1.flv">[[[ Download ]]]</a><br />\r\n"
video2 の物もあるので(一版投稿はvideoで、業者の投稿はvideo2?)、適当なURLリストに以下の行を追記してください。
## PornoTube video.pornotube.com/\0.flv (^$RESP(200)) $JUMP(http://video2.pornotube.com/\0.flv)
OperaではURL取得出来ず
[Patterns]
Name = "AgeSage: add download link (090207) swf"
Active = TRUE
URL = "adult.agesage.jp/contentsPage.htm$TYPE(htm)"
Limit = 256
Match = "(^(^</body>))$STOP()"
Replace = "<script type="text/javascript" src="http://local.ptron/swfobject.js"></script>\r\n"
"<script type="text/javascript">\r\n"
"_d = document;\r\n"
"var filename = ''\r\n"
" /* Unique Flag */\r\n"
" + 'AgeSage_'\r\n"
" /* ID */\r\n"
" + location.search.match(/\\w+$/) + '_'\r\n"
" /* TITLE for NTFS */\r\n"
" + _d.getElementById('bookmarktitle').innerHTML.replace(/<.*?>/g, '').replace(/^(?:\\s|\\u3000| )+|(?:\\s|\\u3000| )+$/g, '')\r\n"
" .replace(/\\?/g, '?').replace(/"/g, '”').replace(/\\//g, '/').replace(/\\\\/g, '¥').replace(/</g, '<').replace(/>/g, '>').replace(/\\*/g, '*').replace(/\\|/g, '|').replace(/:/g, ':')\r\n"
" + '.flv'\r\n"
";\r\n"
"var isMSIE = !!(window.attachEvent && !window.opera);\r\n"
"addFlvLink_timerID = setInterval(function(){\r\n"
" try{\r\n"
" _d.getElementById('bookmarktitle').innerHTML = '<textarea id="copy" style="display:none">'+filename+'</textarea>'\r\n"
" + '<a title="Download Movie" href="' +_d.getElementsByTagName(isMSIE ? 'OBJECT' : 'EMBED')[0].GetVariable('MovieUrl')+ '" style="font-size:large">' +_d.getElementById('bookmarktitle').innerHTML+ '</a>'\r\n"
" + ' <span id="setclipboard_container" style="width:100px; height:22px; vertical-align:bottom"></span>'\r\n"
" ;\r\n"
" var so = new SWFObject("http://local.ptron/setClipboard10.swf", "external_setclipboard", 100, 22, 8, "#FFFFFF");\r\n"
" so.addParam("bgcolor", "#FFFFFF");\r\n"
" so.addParam("allowScriptAccess", "always");\r\n"
" so.addVariable("htmlid", "copy");\r\n"
" so.addVariable("value", filename.replace(/&/g, '&'));\r\n"
" so.write("setclipboard_container");\r\n"
" \r\n"
" clearInterval(addFlvLink_timerID);\r\n"
" }catch(e){}\r\n"
"}, 1000)\r\n"
"</script>"
適当なURL BlockListに↓を追記すれば、対応が面倒なサイトやマイナーサイトのFLV/MP4も楽にDL出来るようになる ※拡張子が flv/mp4 ではない場合、動作しない
[^?]++.(flv|mp4)(\?|(^?)) $OHDR(Referer: ?) $ADDLSTBOX(DownloadList,\u) #[^?]++.(flv|mp4)(\?|(^?)) $OHDR(Referer: ?) $KEYCHK(L) $ADDLSTBOX(DownloadList,\u)
動作しなくても、キャッシュを探せば FLV/MP4 は見つかる筈です
|