迅雷离线网页版API
1.檢查登陸是否需要驗證碼
http://login.xunlei.com/check?u=%(username)&cachetime=%(現在的時間)
返回:
cookie['check_result']為'0:----'時表示不需要輸入驗證,后面的'----'為固定的默認驗證碼
cookie['check_result']為'1'時表示要輸入驗證碼
2.獲取驗證碼
http://verify.xunlei.com/image?t=MVA&cachetime=%(cachetime)
cachetime非必須
參數:
t:有SEA(默認)和MVA兩種
cachetime:現在的時間,單位為毫秒,非必須
返回:
VERIFY_KEY和對應的圖片
注意:
MVA形式的驗證碼,VERIFY_KEY和圖片的映射不是固定的,SEA未測試
3.登陸
http://login.xunlei.com/sec2login/
方法:
POST
Cookie(出驗證碼時才要):
VERIFY_KEY:第二部獲取的
verify_type:MVA或SEA和第二部填的t一樣
數據:
u:用戶名
p:計算方法為hex_md5(hex_md5(hex_md5(password)) + verifycode.upper())
verifycode:'----'或VERIFY_KEY對應的圖片的內容
login_enable:固定1
返回:
失敗時cookie中含'logindetail'
成功時cookie中含一堆信息,其中的isvip可以用來判斷是否會員
4.獲取鏈接信息
http,ftp,thunder:
http://dynamic.cloud.vip.xunlei.com/interface/task_check?callback=queryCid&url=下載鏈接&interfrom=task&random=隨機數&tcache=1469438306042
返回:
queryCid(
'5123FDFE313CEB3AA88C18A1E634D1BF392C55DF', ? ? ? ? ? ?? -->cid
'74E6419E571A70139A0641EC63C9138342E19E7E',???????????????? -->gcid
'65884272',???????????????????????????????????????????????????????????????????????????????? -->file_size
'4499495135017394',???????????????????????????????????????????????????????????????? -->avail_space
'setup.exe', '0','0', 0,??????????????????????????????????????????????????????????????????? -->tname,goldbean_need, silverbean_need, is_full
'1469437924711405136.0192585646','','0')?????????????????????????????? -->random, type, rtcode
磁力鏈:
http://dynamic.cloud.vip.xunlei.com/interface/url_query?callback=queryUrl&u=磁力鏈&interfrom=task&random=隨機數&tcache=1469442039299
返回:
queryUrl(
//flag,infohash,fsize
1,'1807E02404BB55AFBD09358ECD3E7588A72ED29D','11918892245',
//bt_title,is_full
'Tales.of.Zestiria.v.1.4.Incl.14Dlcs-ALI213','0',
//subtitle
new Array('351970.part01.rar','351970.part02.rar','351970.part03.rar','351970.part04.rar','351970.part05.rar','351970.part06.rar','351970.part07.rar','351970.part08.rar','351970.part09.rar','351970.part10.rar','351970.part11.rar','351970.part12.rar','сноюмЬNETSHOW.exe'),'
//subformatsize
new Array('1000M','1000M','1000M','1000M','1000M','1000M','1000M','1000M','1000M','1000M','1000M','365M','1.00M'),
//size_list
new Array('1048576000','1048576000','1048576000','1048576000','1048576000','1048576000','1048576000','1048576000','1048576000','1048576000','1048576000','383497429','1058816'),
//valid_list
new Array('1','1','1','1','1','1','1','1','1','1','1','1','1'),
//file_icon
new Array('RAR','RAR','RAR','RAR','RAR','RAR','RAR','RAR','RAR','RAR','RAR','RAR','RAR'),
//findex
new Array('0','1','2','3','4','5','6','7','8','9','10','11','12'),
//is_blocked
new Array('0','0','0','0','0','0','0','0','0','0','0','0','0'),
//random,rtcode
'146944203794542303.27965594602','0'
)
種子文件:
POST http://dynamic.cloud.vip.xunlei.com/interface/torrent_upload
附帶數據:
Content-Type: multipart/form-data; boundary=---------------------------20719067302268671101123616503
Content-Length: 68643
-----------------------------20719067302268671101123616503
Content-Disposition: form-data; name="filepath"; filename="646dafd998d350a2445f56684affb3dd2b7d0323.torrent"
Content-Type: application/x-bittorrent
\r\n
種子文件內容
返回:
infoid
5.提交任務
http,ftp,thunder:
http://dynamic.cloud.vip.xunlei.com/interface/task_commit
請求參數:
callback=ret_task
uid//用戶id
cid//從task_check返回值獲取
gcid//同上
size//同上
goldbean//金豆,填0就行
silverbean//銀豆,填0就行
t//標題,即文件名
url
verify_code//驗證碼,不需要時填空字符串
type=0
o_page=history
o_taskid=0
class_id=0
database=undefined
interfrom=task
time=Fri%20Jul%2029%202016%2011:38:04%20GMT+0800
noCacheIE=1469763484334
返回:
ret_task(
1,//ret_num,0成功,1失敗,-11,-12出驗證碼
'1416620227502081',//taskid
'3.0665261745453'//time
)
磁力鏈,種子文件:
POST http://dynamic.cloud.vip.xunlei.com/interface/bt_task_commit?callback=jsonp1469513522947&t=Tue%20Jul%2026%202016%2014:12:40%20GMT+0800%20(CST)
參數:
uid
btname//標題
cid//info或infohash
goldbean=0
silverbean=0
tsize=11918892245//
findex=0_1_2_3_4_5_6_7_8_9_10_11_12_//要下載的文件的下標
size=1048576000_1048576000_1048576000_1048576000_1048576000_1048576000_1048576000_1048576000_1048576000_1048576000_1048576000_383497429_1058816_//大小
o_taskid=0
o_page=task
class_id=0
interfrom=task
verify_code//驗證碼
返回:
jsonp1469764956636({
"id":"1420184742535169",//taskid
"avail_space":"4499483755717334",
"time":2.3436241149902,
"progress":1
})
6.獲取下載鏈接
http://dynamic.cloud.vip.xunlei.com/interface/showtask_unfresh?callback=jsonp1470122229847&t=Tue%20Aug%2002%202016%2015:18:58%20GMT+0800&type_id=4&page=1&tasknum=1&p=1&interfrom=task
參數:
tasknum:表示要返回前tasknum個任務的詳細信息
返回:
非bt的話,從結果中的lixian_url可以獲取下載鏈接
總結
以上是生活随笔為你收集整理的迅雷离线网页版API的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: JavaScript:学习笔记(9)——
- 下一篇: IIS添加直接下载的文件类型