var url = "https://wwt.lanzouu.com/icuiF1o31f8d"
¶¨ÒåÁËÒ»¸ö±äÁ¿url
£¬ÆäֵΪһ¸öÌض¨µÄÍøÒ³µØÖ·¡£
var http = new okHttp()
r = http.get(url)
´´½¨ÁËÒ»¸öokHttp
¶ÔÏó£¬ÓÃÓÚ½øÐÐHTTPÇëÇó¡£È»ºóʹÓÃget
·½·¨ÇëÇó֮ǰ¶¨ÒåµÄurl
£¬²¢½«ÏìÓ¦ÄÚÈÝ´æ´¢ÔÚ±äÁ¿r
ÖС£
var regex = /\/fn\?[\w-]+/g;
r = r.match(regex)
printl(r)
¶¨ÒåÁËÒ»¸öÕýÔò±í´ïʽregex
£¬ÓÃÓÚÆ¥ÅäÐÎÈç/fn?xxxxx
µÄ×Ö·û´®¡£È»ºóʹÓÃmatch
·½·¨ÔÚÏìÓ¦ÄÚÈÝr
ÖвéÕÒÆ¥ÅäµÄ×Ö·û´®£¬²¢½«½á¹û´æ´¢»Ør
ÖС£printl(r)
ÓÃÓÚÊä³öÆ¥Åä½á¹û¡£
r2 = http.get("https://wwt.lanzouu.com/" + r[0])
printl(r2)
ʹÓÃokHttp
¶ÔÏóÔٴη¢ÆðGETÇëÇó£¬Õâ´ÎÇëÇóµÄURLÊÇͨ¹ý½«r
µÄµÚÒ»¸öÆ¥Åä½á¹ûÆ´½Óµ½https://wwt.lanzouu.com/
ºóÃæÉú³ÉµÄ¡£È»ºó½«ÏìÓ¦ÄÚÈÝ´æ´¢ÔÚ±äÁ¿r2
ÖУ¬²¢Êä³ö¡£
var regex2 = /'sign':'(.*?)'/
var sign = r2.match(regex2)
printl(sign)
¶¨ÒåÁËÒ»¸öеÄÕýÔò±í´ïʽregex2
£¬ÓÃÓÚÆ¥ÅäÐÎÈç'sign':'xxxxx'
µÄ×Ö·û´®¡£È»ºóÔÚr2
ÖвéÕÒÆ¥ÅäµÄ×Ö·û´®£¬²¢½«½á¹û´æ´¢ÔÚ±äÁ¿sign
ÖУ¬×îºóÊä³ö¡£
var regex3 = /url\s:\s'(.*?)'/
var url = r2.match(regex3)
printl(url)
¶¨ÒåÁËÁíÒ»¸öÕýÔò±í´ïʽregex3
£¬ÓÃÓÚÆ¥ÅäÐÎÈçurl : 'xxxxx'
µÄ×Ö·û´®¡£È»ºóÔÚr2
ÖвéÕÒÆ¥ÅäµÄ×Ö·û´®£¬²¢½«½á¹û´æ´¢ÔÚ±äÁ¿url
ÖУ¬×îºóÊä³ö¡£
tt = "https://wwt.lanzouu.com" + url[1]
printl(tt)
½«url
µÄµÚÒ»¸öÆ¥Åä½á¹û£¨¼´ÎļþµÄʵ¼Ê·¾¶£©Æ´½Óµ½https://wwt.lanzouu.com
ºóÃ棬Éú³ÉÒ»¸öеÄURLtt
£¬²¢Êä³ö¡£
http.setHeader('Referer', "https://wwt.lanzouu.com")
http.setHeader('User-Agent', "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/121.0.0.0 Safari/537.36 Edg/121.0.0.0")
ÉèÖÃHTTPÇëÇóÍ·£¬°üÀ¨Referer
£¨À´Ô´£©ºÍUser-Agent
£¨Óû§´úÀí£©£¬ÒÔÄ£Äâä¯ÀÀÆ÷ÇëÇó¡£
var data = new map()
data.add('action', 'downprocess')
data.add('signs', '?ctdf')
data.add('sign', sign[1])
data.add('websign', '')
data.add('websignkey', 'bL27')
data.add('ves', 1)
post = http.post(tt, data)
// post = http.json(tt,data)
printl(post)
´´½¨Ò»¸ömap
¶ÔÏódata
£¬ÓÃÓÚ´æ´¢POSTÇëÇóµÄÊý¾Ý¡£Ìí¼Ó¶à¸ö¼üÖµ¶Ôµ½data
ÖУ¬È»ºóʹÓÃpost
·½·¨Ïòtt
·¢ËÍPOSTÇëÇ󣬲¢½«ÏìÓ¦ÄÚÈÝ´æ´¢ÔÚ±äÁ¿post
ÖС£printl(post)
ÓÃÓÚÊä³öPOSTÇëÇóµÄÏìÓ¦ÄÚÈÝ¡£
post = JSON.parse(post)
½«POSTÇëÇóµÄÏìÓ¦ÄÚÈÝ´ÓJSON×Ö·û´®½âÎöΪJavaScript¶ÔÏó¡£
http.clearHeader()
Çå³ý֮ǰÉèÖõÄHTTPÇëÇóÍ·¡£
http.setHeader('accept', "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7")
http.setHeader("accept-language", "zh-CN,zh;q=0.9,en;q=0.8,en-GB;q=0.7,en-US;q=0.6")
http.setHeader("sec-ch-ua", "\"Chromium\";v=\"122\", \"Not(A:Brand\";v=\"24\", \"Microsoft Edge\";v=\"122\"")
http.setHeader("sec-ch-ua-mobile", "?0")
http.setHeader("sec-ch-ua-platform", "\"Windows\"")
http.setHeader("sec-fetch-dest", "document")
http.setHeader("sec-fetch-mode", "navigate")
http.setHeader("sec-fetch-site", "none")
http.setHeader("sec-fetch-user", "?1")
http.setHeader("upgrade-insecure-requests", "1")
http.setHeader("cookie", "down_ip=1")
ÔÙ´ÎÉèÖÃHTTPÇëÇóÍ·£¬°üÀ¨accept
¡¢accept-language
¡¢sec-ch-ua
µÈ£¬ÒÔÄ£Äâä¯ÀÀÆ÷ÇëÇóµÄ²»Í¬·½Ãæ¡£
http.downloadFile(post.dom + "/file/" + post.url, "/sdcard/Pictures/11.exe")
ʹÓÃdownloadFile
·½·¨´ÓÖ¸¶¨µÄURLÏÂÔØÎļþ¡£URLÓÉpost.dom
£¨ÓòÃû£©ºÍpost.url
£¨Îļþ·¾¶£©×é³É¡£ÏÂÔصÄÎļþ½«±£´æµ½/sdcard/Pictures/11.exe
·¾¶Ï¡£