「yahoopho.dms」の版間の差分
提供: Yourpedia
細 (改良) |
細 (もう少し洗練) |
||
| 9行目: | 9行目: | ||
//Dorothy2 | //Dorothy2 | ||
//caption=Yahoo! Photo | //caption=Yahoo! Photo | ||
| − | //version=0. | + | //version=0.04 |
//hint=「Hires」があるページのURLを渡してください | //hint=「Hires」があるページのURLを渡してください | ||
//match=http://photos.yahoo.co.jp/ph/ | //match=http://photos.yahoo.co.jp/ph/ | ||
| 17行目: | 17行目: | ||
//end | //end | ||
//created 20,Dec.,2010 by Abcdefgh | //created 20,Dec.,2010 by Abcdefgh | ||
| + | //modified 23,Dec.,2010 by Abcdefgh | ||
//ファイル名の単純変換が不可能な為 | //ファイル名の単純変換が不可能な為 | ||
| 24行目: | 25行目: | ||
var title=unescape(urlinfo.url).fromUTF8toSJIS(); | var title=unescape(urlinfo.url).fromUTF8toSJIS(); | ||
| − | if (!title.match(/([^"]+dnm=[0-9a-f][ | + | if (!title.match(/([^"]+dnm=[0-9a-f]{4}[.][a-z]+)/)) { |
println('error---> リンク先ページURLが見つかりません'); | println('error---> リンク先ページURLが見つかりません'); | ||
exit(); | exit(); | ||
| 39行目: | 40行目: | ||
return retry('error--->' + http.responseHeader.code); | return retry('error--->' + http.responseHeader.code); | ||
} | } | ||
| − | if (!http.data.match(/<img src=\"([^"]+\/__hr_\/[0-9a-f] | + | if (!http.data.match(/<img src=\"([^"]+\/__hr_\/[0-9a-f]{4}[^"]+)\"/)) { |
println('error---> オリジナルサイズの画像が見つかりません'); | println('error---> オリジナルサイズの画像が見つかりません'); | ||
exit(); | exit(); | ||
} | } | ||
| − | |||
| − | |||
var title=RegExp.$1; | var title=RegExp.$1; | ||
| + | |||
| + | var url = new URL(title); | ||
urlinfo.url = url.url; | urlinfo.url = url.url; | ||
headers.host = url.host; | headers.host = url.host; | ||
| − | if (! | + | if (!title.match(/([0-9a-f]{4}[.][a-z]+)/)) { |
println('error---> 画像ファイル名が見つかりません'); | println('error---> 画像ファイル名が見つかりません'); | ||
exit(); | exit(); | ||
2010年12月23日 (木) 08:02時点における版
Irvineを使ってYahoo! Photoの画像を落とすためのスクリプト。サムネイル画像が表示されるページから「IrvineへすべてのURLを送る」で使う。
- [ttp://mxmkitchen.com/2009/03/13/2357.php ここ]からIrvineとDorothy2.zipをDL、インストールする
- 「(Irvineが有るフォルダ)¥Dorothy2¥program¥」に「yahoopho.dms」を以下の内容で作成する
- Irvineを起動後、上記サイトに出てる設定を行う
- 「ツール」→「メインメニュー」→「動画ダウンロード2設定」で「Yahoo! Photo」にチェックを入れて、「ファイル」→「保存して終了」をクリック、それ以外は同様
- 後は、ほぼ上記サイトの説明通り
//Dorothy2
//caption=Yahoo! Photo
//version=0.04
//hint=「Hires」があるページのURLを渡してください
//match=http://photos.yahoo.co.jp/ph/
//author=Abcdefgh
//path=program
//priority=500
//end
//created 20,Dec.,2010 by Abcdefgh
//modified 23,Dec.,2010 by Abcdefgh
//ファイル名の単純変換が不可能な為
function(){
println('yahoopho.dms start');
// 渡されたURLをHiresのリンク先に変換
var title=unescape(urlinfo.url).fromUTF8toSJIS();
if (!title.match(/([^"]+dnm=[0-9a-f]{4}[.][a-z]+)/)) {
println('error---> リンク先ページURLが見つかりません');
exit();
}
var title=unescape(RegExp.$1 + '&.hires=t').fromUTF8toSJIS();
var url = new URL(title);
urlinfo.url = url.url;
headers.host = url.host;
// Hiresのリンク先をダウンロード
common_load('download');
var http = download(urlinfo.url);
if(http.responseHeader.code != 200){
return retry('error--->' + http.responseHeader.code);
}
if (!http.data.match(/<img src=\"([^"]+\/__hr_\/[0-9a-f]{4}[^"]+)\"/)) {
println('error---> オリジナルサイズの画像が見つかりません');
exit();
}
var title=RegExp.$1;
var url = new URL(title);
urlinfo.url = url.url;
headers.host = url.host;
if (!title.match(/([0-9a-f]{4}[.][a-z]+)/)) {
println('error---> 画像ファイル名が見つかりません');
exit();
}
var title=RegExp.$1;
Dorothy.fileName = title;
}