imgur.dms

Irvineを使って//imgur.comの静止画を落とすためのスクリプト。アルバムの画像全てをアイテム追加するため https://github.com/rentan/Irvine/blob/master/Dorothy2/common/additem.dms が使える必要があります。

  1. ここからIrvineとDorothy2.zipをDL、インストールする
  2. 「(Irvineが有るフォルダ)¥Dorothy2¥program¥flickr.dms」を以下の内容で上書きする
  3. Irvineを起動後、上記サイトに出てる設定を行う
  4. 後は上記サイトの説明通り
//Dorothy2
//caption=imgur
//version=0.1
//hint=例)http://imgur.com/a/0hcgF をアイテム追加
//match=http://imgur.com/[^g]
//ResponseMatch=
//author=nanasi
//path=program
//priority=500
//end

function(){
	var userAgent = 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0';

	common_load('download','test_download');
	var url=new URL(urlinfo.url);
	var http=download(url.url,false,{'Cookie':'', 'User-Agent':userAgent});
	if(http.responseHeader.code!=200){
		return retry('error--->'+http.responseHeader.code);
	}

	var cookie=http.responseHeader.cookie.data;

	common_load ('additem');

	var ini = {
		Mode: 'Auto',
//		Queue: '/Default',
		Listname: '',
		Workaround: false
	};
	var additem = new AddItem (ini);

	var result = http.data.match('{"hash":"[^"]*?","title":"[^"]*?","description":"[^"]*?","width":[^"]*?,"height":[^"]*?,"size":[^"]*?,"ext":"[^"]*?","animated":[^"]*?,"prefer_video":[^"]*?,"looping":[^"]*?,"datetime":"[^"]*?"}', 'g');

	var num = 1;
	for(value in result) {
			result[value].match('"hash":"(.+?)".+"ext":"(.+?)"');
			var filename = RegExp.$1 + RegExp.$2;
			var imgSrc = "http://i.imgur.com/" + filename;

			var list = [
				{ Url: imgSrc, Filename: num + '_' + filename }
			];
			additem.send (list);
			++num;
	}

	exit ();
}


タグ:

+ タグ編集
  • タグ:
最終更新:2016年03月02日 14:25
ツールボックス

下から選んでください:

新しいページを作成する
ヘルプ / FAQ もご覧ください。