Irvineを使ってYahoo! Photoの画像を落とすためのスクリプト。サムネイル画像が表示されるページから「IrvineへすべてのURLを送る」で使う。本画像が落とせない場合にプレビュー画像を落とすように改良。
//Dorothy2
//caption=Yahoo! Photo
//version=0.05
//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
//modified 29,Dec.,2010 by Abcdefgh
//modified 30,Jan.,2011 by Abcdefgh
//ファイル名の単純変換が不可能な為
function(){
println('yahoopho.dms start');
// 渡されたURLをHiresページのURLに変換
var title=unescape(urlinfo.url);
if (!title.match(/(^.+dnm=[0-9a-f]{4}[.][a-z]+)/)) {
println('error---> HiresページURLが見つかりません');
exit();
}
var title=unescape(RegExp.$1 + '&.hires=t');
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);
}
// 本画像URLを抽出
if (!http.data.match(/<img src=\"([^"]+\/__[sh]r_\/[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();
}
Dorothy.fileName = RegExp.$1;
}