YouTube等の動画のダウンロードリンクを表示 Edit

メッセージ Edit

共通設定 Edit

  1. 一部のフィルタは、filesetClipboard.swfを「Proxomitronがあるフォルダ/html/」に置く必要があります。(FlashPlayer10では動作しません)
  2. 一部のフィルタは、以下のフィルタ (title.ext) が必要になります
    [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)"

YouTube Edit

動作確認用URL
Where the Hell is Matt? (2008) FLV, MP4, HD
Killing me softly - Fugees FLV, MP4, HD HD版は存在しないので、HDを参照するとFLVが参照される
[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>"
          "&#x3000;<button title="setClipboard" onclick="clipboardData.setData('Text',"
          " document.getElementById('vidTitle').innerText.replace(/^(?: |&#x3000;)+|(?: |&#x3000;)+$/g, '').replace(/\\?/g, '&#xff1f;').replace(/&quot;/g, '&#8221;').replace(/\\//g, '&#xff0f;').replace(/\\\\/g, '&#xffe5;').replace(/</g, '&#xff1c;').replace(/>/g, '&#xff1e;').replace(/\\*/g, '&#xff0a;').replace(/\\|/g, '&#xff5c;').replace(/:/g, '&#xff1a;')"
          "+ '.flv')">copy</button>"

ファイル名を「動画ID.flv」に書き換える Edit

上の2つのフィルタのどちらかとセットで使う。↓のタイトル.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";"

ファイル名を「タイトル.flv」でDL (title.ext) Edit

更に弄って、タイトル.flv でダウンロードできるようにしたもの
※リネームの手間が省け、微妙に楽になりますが、ブラウザが別のファイルと認識するため、転送量が増大します(キャッシュを参照しない) 鯖の負担を考えると使わない方がよさげ
※IEを使用している場合、インターネットオプションの「UTF-8のURLを送信する」にチェックを入れないと、ファイル名が化けます

[Patterns]
Name = "YouTube: add download link [2008/04/12] title.flv for EUC-JP, UTF-8"
Active = TRUE
URL = "([a-z]+{1,3}.|)youtube.com/watch(^(^\?))*[?&]v\= $TYPE(htm)"
Limit = 256
Match = "(^(^watch_fullscreen[^']++(video_id=[^&'";]+)\0[^']++(\&t=[^&'";]+)\1))$SET(YTube=?\0\1)(^$TST(YTube=?*))"
"|"
"(<div\s[^>]++id=$AV(watch-vid-title)[^>]+> ( <[a-z][^>]+> )+)\1 ([^<\t\r\n]+)\2"
"$TST(\2=(([^#%\\/:*?"<> |]+)\#" 
"(#$SET(#=%23)" 
"|%$SET(#=%25)" 
"|\\$SET(#=¥)" 
"|/$SET(#=/)" 
"|:$SET(#=:)" 
"|\*$SET(#=*)" 
"|\?$SET(#=?)" 
"|\"$SET(#=”)" 
"|(^</h1>)<$SET(#=<)" 
"|>$SET(#=>)" 
"|\|$SET(#=|)" 
"|[\t\r\n]|\s$SET(#= )" 
"|))+)" 
Replace = "\1\2 <a href="http://title.ext/\@.flv?http://\h/get_video$GET(YTube)">[[[ Download ]]]</a>$SET(YTube=)$STOP()"

ついでにhttp://d.hatena.ne.jp/Falky/20080126/1201309179も参考に。

ファイル名を「タイトル.ext」でDL [2008年11月16日更新] Edit

動画タイトルからDL可能 copy ボタンを押すと、クリップボードに「タイトル.ext」をコピー
FLV, MP4, HD 版へのリンクも追加しますが、MP4/HD版を見ても、そもそもMP4/HD版の動画がサーバーにない場合、FLVを参照することになります。

[Patterns]
Name = "YouTube: add download link (081116) swf"
Active = TRUE
URL = "([^/]++.|)youtube.com/watch(.php|)\?(v=|*\&v=) $TYPE(htm)"
Limit = 256
Match = "$NEST(<div,\s[^>]++id=$AV(watch-vid-title)[^>]+> (<h1[^>]+> \0 </h1>|\0) ,</div>)$STOP()"
Replace = "<span id="copy" style="visibility:hidden"></span>\r\n"
"<script type="text/javascript">\r\n"
"_d = document;\r\n"
"function setClipboard (arg) {\r\n"
"	if (deconcept.SWFObjectUtil.getPlayerVersion()['major'] > 9)\r\n"
"		clipboardData.setData('Text', arg);  // for IE\r\n"
"	else {\r\n"
"		_d.getElementById('copy').innerHTML = '';\r\n"
"		_d.getElementById('copy').innerHTML = '<embed src="http://local.ptron/setClipboard.swf" FlashVars="code=' +encodeURIComponent(arg)+ '" width="0" height="0" type="application/x-shockwave-flash"></embed>';\r\n"
"	}\r\n"
"}\r\n"
"_d.write('<span id="watch-vid-title"><a title="Download Movie" href="http://\h/get_video?video_id=' +swfArgs.video_id+ '&t=' +swfArgs.t+(/[?&]fmt=\\d/.test(location.search) ? '&'+location.search.match(/fmt=\\d+/)[0] : '')+ '">');\r\n"
"</script>\r\n"
"\0</a></span>&#x3000;<button title="Set Clipboard" onclick="setClipboard(''\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('watch-vid-title').innerHTML.replace(/<.*?>/g, '').replace(/^(?:\\s|\\u3000|&nbsp;)+|(?:\\s|\\u3000|&nbsp;)+$/g, '')\r\n"
"		.replace(/\\?/g, '&#xff1f;').replace(/\\u0022/g, '&#8221;').replace(/\\//g, '&#xff0f;').replace(/\\\\/g, '&#xffe5;').replace(/</g, '&#xff1c;').replace(/>/g, '&#xff1e;').replace(/\\*/g, '&#xff0a;').replace(/\\|/g, '&#xff5c;').replace(/:/g, '&#xff1a;')\r\n"
"	/* EXTENSION */\r\n"
"	+ (/[?&]fmt=\\d/i.test(location.search) ? '.mp4' : '.flv')"
")">copy</button>\r\n"
"<script type="text/javascript">\r\n"
"// add player link\r\n"
"var url_hoge = location.href.replace(/\\?fmt=\\d+/, '?').replace(/&fmt=\\d+/g, '').replace(/\\?&/, '?');\r\n"
"if (!/[?&]fmt=(?:18|22)(?:&|(?!.))/i.test(location.search))"
"	_d.write('<b>FLV</b> / <a title="maybe" href="' +url_hoge+'&fmt=18'+ '">MP4</a> / <a title="maybe" href="' +url_hoge+'&fmt=22'+ '">HD</a>');\r\n"
"else if (!/[?&]fmt=22(?:&|(?!.))/i.test(location.search) || (/[?&]fmt=18(?:&|(?!.))/i.test(location.search) && location.search.match(/\\?(?:|.*?&)fmt=18/).length < location.search.match(/\\?(?:|.*?&)fmt=22/).length))\r\n"
"	_d.write('<a href="' +url_hoge+ '">FLV</a> / <b title="maybe">MP4</b> / <a title="maybe" href="' +url_hoge+'&fmt=22'+ '">HD</a>');\r\n"
"else"
"	_d.write('<a href="' +url_hoge+ '">FLV</a> / <a title="maybe" href="' +url_hoge+'&fmt=18'+ '">MP4</a> / <b title="maybe">HD</b>');\r\n"
"</script>"

ニコニコ動画 Edit

フィルタ、リスト公開/nicovideo

フォト蔵 [2008年06月10日更新] Edit

[Patterns]
Name = "PhotoZou: add download link (080610) swf"
Active = TRUE
URL = "([^/]++.|)photozou.jp/(video|photo)/"
Limit = 256
Match = "<end>"
Replace = "<span id="copy" style="visibility:hidden"></span>\r\n"
"<script type="text/javascript" defer="defer">\r\n"
"_d = document;\r\n"
"function setClipboard (arg) {\r\n"
"	_d.getElementById('copy').innerHTML = '';\r\n"
"	_d.getElementById('copy').innerHTML = '<embed src="http://local.ptron/setClipboard.swf" FlashVars="code=' +encodeURIComponent(arg)+ '" width="0" height="0" type="application/x-shockwave-flash"></embed>';\r\n"
"}\r\n"
"if ((tgt = _d.getElementById('media_title')) || (tgt = _d.getElementById('pickup_data_title'))) {\r\n"
"	tgt_html = tgt.innerHTML;\r\n"
"	tgt.innerHTML = '<a href="' + so.getVariable('url') + '" title="Download Movie">' +tgt_html+ '</a> <input type="button" onclick="setClipboard(\\''\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|&nbsp;)+|(?:\\s|\\u3000|&nbsp;)+$/g, '')"
"			.replace(/\\?/g, '&#xff1f;').replace(/"/g, '&#8221;').replace(/\\//g, '&#xff0f;').replace(/\\\\/g, '&#xffe5;').replace(/</g, '&#xff1c;').replace(/>/g, '&#xff1e;').replace(/\\*/g, '&#xff0a;').replace(/\\|/g, '&#xff5c;').replace(/:/g, '&#xff1a;')\r\n"
"		/* EXTENSION */"
"		+ '.flv'\r\n"
"	+ '\\')" value="copy" title="Set Clipboard" style="margin-left:.5ex; font-size:small" />';\r\n"
"}\r\n"
"</script>"

YourFileHost [2008年06月10日更新] Edit

prototype.js が必要です(適当に探してください)

[Patterns]
Name = "YourFileHost: add download link (080610)"
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">\r\n"
"function setClipboard (arg) {\r\n"
"	_d.getElementById('copy').innerHTML = '';\r\n"
"	_d.getElementById('copy').innerHTML = '<embed src="http://local.ptron/setClipboard.swf" FlashVars="code=' +encodeURIComponent(arg)+ '" width="0" height="0" type="application/x-shockwave-flash"></embed>';\r\n"
"}\r\n"
"_d = document;\r\n"
"_d.write('<a id="movie_download_link" style="font-size:large; font-weight:bold"></a><span id="copy" style="visibility:hidden"></span><br />');\r\n"
"var myAjax = new Ajax.Request(\r\n"
"	decodeURIComponent(_d.getElementById('objectPlayer').movie.match(/video=([^&]+)/)[1]),\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+ '" style="margin-right:1ex; border:1px solid black" />[[[ Download Movie ]]]'\r\n"
"			+ '<input type="button" onclick="'\r\n"
"				+ "setClipboard('"\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"
"			+ '" title="Set Clipboard" value="copy" style="margin-left:1ex" />';\r\n"
"		}\r\n"
"	}\r\n"
");\r\n"
"</script>\r\n\0"

PornoTube [2008年06月10日更新] Edit

[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)

アゲサゲ [2008年06月10日更新] Edit

OperaではURL取得出来ず

[Patterns]
Name = "AgeSage: add download link (080610) swf"
Active = TRUE
URL = "adult.agesage.jp/contentsPage.htm$TYPE(htm)"
Limit = 256
Match = "(^(^<body))$STOP()"
Replace = "<script type="text/javascript">\r\n"
"_d = document;\r\n"
"function setClipboard (arg) {\r\n"
"	_d.getElementById('copy').innerHTML = '';\r\n"
"	_d.getElementById('copy').innerHTML = '<embed src="http://local.ptron/setClipboard.swf" FlashVars="code=' +encodeURIComponent(arg)+ '" width="0" height="0" type="application/x-shockwave-flash"></embed>';\r\n"
"}\r\n"
"addFlvLink_timerID = setInterval(function(){\r\n"
"	/* TITLE for NTFS */\r\n"
"	var title = _d.getElementById('bookmarktitle').innerHTML.replace(/<.*?>/g, '').replace(/^(?:\\s|\\u3000|&nbsp;)+|(?:\\s|\\u3000|&nbsp;)+$/g, '').replace(/\\?/g, '&#xff1f;').replace(/"/g, '&#8221;').replace(/\\//g, '&#xff0f;').replace(/\\\\/g, '&#xffe5;').replace(/</g, '&#xff1c;').replace(/>/g, '&#xff1e;').replace(/\\*/g, '&#xff0a;').replace(/\\|/g, '&#xff5c;').replace(/:/g, '&#xff1a;');\r\n"
"	var isMSIE = !!(window.attachEvent && !window.opera);\r\n"
"	try{\r\n"
"		_d.getElementById('bookmarktitle').innerHTML = '<span id="copy" style="visibility:hidden"></span>'\r\n"
"		+ '<a title="Download Movie" href="' +_d.getElementsByTagName(isMSIE ? 'OBJECT' : 'EMBED')[0].GetVariable('MovieUrl')+ '">' +_d.getElementById('bookmarktitle').innerHTML+ '</a>'\r\n"
"		+ ' <button onclick="setClipboard(\\''\r\n"
"			/* Unique Flag */\r\n"
"			+ 'AgeSage_'\r\n"
"			/* ID */\r\n"
"			+ location.search.match(/\\w+$/) + '_'\r\n"
"			+ title\r\n"
"			+ '.flv'\r\n"
"		+ '\\')" title="Set Clipboard">copy</button>';\r\n"
"		clearInterval(addFlvLink_timerID)\r\n"
"	}catch(e){}\r\n"
"}, 1000)\r\n"
"</script>"

その他のサイト Edit

適当な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 は見つかる筈です




  複製 名前変更
QRコード(トップページのアドレス)