「facebook.dms」の版間の差分
提供: Yourpedia
細 |
|||
| 9行目: | 9行目: | ||
//Dorothy2 | //Dorothy2 | ||
//caption=Facebook静止画 | //caption=Facebook静止画 | ||
| − | //version=0. | + | //version=0.02 |
//hint=FacebookのサムネイルページからURLを渡してください | //hint=FacebookのサムネイルページからURLを渡してください | ||
//match=facebook.com/photo.php | //match=facebook.com/photo.php | ||
| 17行目: | 17行目: | ||
//end | //end | ||
//created 4,Oct.,2012 by Abcdefgh | //created 4,Oct.,2012 by Abcdefgh | ||
| + | //modified 30,Oct.,2012 by Abcdefgh | ||
//ファイル名の単純変換が不可能な為 | //ファイル名の単純変換が不可能な為 | ||
| 23行目: | 24行目: | ||
// 画像紹介ページをダウンロード | // 画像紹介ページをダウンロード | ||
common_load('download'); | common_load('download'); | ||
| + | urlinfo.url=urlinfo.url.replace(/https/,"http"); | ||
var http = download(urlinfo.url); | var http = download(urlinfo.url); | ||
if(http.responseHeader.code != 200){ | if(http.responseHeader.code != 200){ | ||
| 29行目: | 31行目: | ||
// 本画像URLを抽出 | // 本画像URLを抽出 | ||
if (!http.data.match(/href=\"(http:\/\/[^"?]+_o.jpg)/)) { | if (!http.data.match(/href=\"(http:\/\/[^"?]+_o.jpg)/)) { | ||
| − | if (!http.data.match(/ | + | if (!http.data.match(/=\"(http:\/\/[^"?]+_n.jpg)/)) { |
println('error---> オリジナルサイズの画像が見つかりません'); | println('error---> オリジナルサイズの画像が見つかりません'); | ||
exit(); | exit(); | ||
| 36行目: | 38行目: | ||
var title= RegExp.$1; | var title= RegExp.$1; | ||
| − | |||
| − | |||
| − | |||
//ファイル名を抽出 | //ファイル名を抽出 | ||
if (!title.match(/([^\/]+)$/)) { | if (!title.match(/([^\/]+)$/)) { | ||
| 45行目: | 44行目: | ||
} | } | ||
Dorothy.fileName = RegExp.$1; | Dorothy.fileName = RegExp.$1; | ||
| + | var url = new URL(title + '?dl=1'); | ||
| + | urlinfo.url = url.url; | ||
| + | headers.host = url.host; | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> | ||
[[Category:Irvine用スクリプト]] | [[Category:Irvine用スクリプト]] | ||
2012年10月30日 (火) 08:39時点における版
Irvineを使ってFacebookの画像を落とすためのスクリプト。サムネイル画像が表示されるページから「IrvineへすべてのURLを送る」で使う。
- [ttp://mxmkitchen.com/2009/03/13/2357.php ここ]からIrvineとDorothy2.zipをDL、インストールする
- 「(Irvineが有るフォルダ)¥Dorothy2¥program¥」に「facebook.dms」を以下の内容で作成する
- Irvineを起動後、上記サイトに出てる設定を行う
- 「ツール」→「メインメニュー」→「動画ダウンロード2設定」で「Facebook静止画」にチェックを入れて、「ファイル」→「保存して終了」をクリック、それ以外は同様
- 後は、ほぼ上記サイトの説明通り
//Dorothy2
//caption=Facebook静止画
//version=0.02
//hint=FacebookのサムネイルページからURLを渡してください
//match=facebook.com/photo.php
//author=Abcdefgh
//path=program
//priority=500
//end
//created 4,Oct.,2012 by Abcdefgh
//modified 30,Oct.,2012 by Abcdefgh
//ファイル名の単純変換が不可能な為
function(){
println('facebook.dms start');
// 画像紹介ページをダウンロード
common_load('download');
urlinfo.url=urlinfo.url.replace(/https/,"http");
var http = download(urlinfo.url);
if(http.responseHeader.code != 200){
return retry('error--->' + http.responseHeader.code);
}
// 本画像URLを抽出
if (!http.data.match(/href=\"(http:\/\/[^"?]+_o.jpg)/)) {
if (!http.data.match(/=\"(http:\/\/[^"?]+_n.jpg)/)) {
println('error---> オリジナルサイズの画像が見つかりません');
exit();
}
}
var title= RegExp.$1;
//ファイル名を抽出
if (!title.match(/([^\/]+)$/)) {
println('error---> ファイル名が見つかりません');
exit();
}
Dorothy.fileName = RegExp.$1;
var url = new URL(title + '?dl=1');
urlinfo.url = url.url;
headers.host = url.host;
}