Revision 376465343533 () - Diff

Link to this snippet: https://friendpaste.com/1fMX7PvjXJKxp6LQl5xKaU
Embed:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//Dorothy2
//caption=asg.to
//version=0.00
//match=http://asg.to/contentsPage.html\?mcd=\w+
//author= 
//path=program
//priority=500
//end

function(){
common_load('download', 'post', 'character_references');
//-------------------------------
var http = download(urlinfo.url);
if(http.responseHeader.code != 200) { println('error---> page ' + http.responseHeader.code); exit(); }
var cookie = http.responseHeader.cookie.data;
var mcd = http.data.match(/>urauifla\("mcd=(\w+)/) ? RegExp.$1 : null;
println("mcd --> " + mcd);
if( mcd == null ) { println('error---> mcd'); exit(); }
var pt = http.data.match(/>urauifla\("[^"]+?&pt=(\w+)/) ? RegExp.$1 : null;
println("pt --> " + pt);
if( pt == null ) { println('error---> pt'); exit(); }
var title = http.data.match(/<h2 id="bookmarktitle">([^<>]+)</) ? character_references(RegExp.$1.fromEUCtoSJIS()) : '?';
println("title = " + title);
var st = MD5.calc("---===XERrr3nmsdf8874nca===---" + mcd + pt.substring(0, 8));
var postdata = 'burn=' + ('' + Math.random()).replace(/\./, '%2E');
var xmlUrl = 'http://asg.to/contentsPage.xml?mcd=' + mcd + '&pt=' + pt + '&st=' + st;
//-------------------------------
http = post(xmlUrl, postdata, {'Cookie':cookie});
if(http.responseHeader.code != 200) { println('error---> xml ' + http.responseHeader.code); exit(); }
var url = http.data.match(/<movieurl>(http[^<>]+)</) ? RegExp.$1 : null;
if(!url) { println("error---> url not found"); exit(); }
//-------------------------------
var ext = url.match(/\.mp4/) ? '.mp4' : '.flv';
urlinfo.url = (new URL(url)).url;
headers['Host'] = (new URL(urlinfo.url)).host;
Dorothy.fileName = changeFileName(title + ' asg=' + mcd + ext);
}