def get_av_magnet(avcode):
Referer={
"Referer": "123"
}
s = requests.Session()
gid,uc = download_image(avcode)
params={
'gid':gid,
'uc':uc,
'lang':'zh'
}
r2 = s.get("http://www.javbus.com/ajax/uncledatoolsbyajax.php",params=params, proxies=proxy, headers=Referer)
soup = BeautifulSoup(r2.content.decode('utf-8', 'ignore'),'html.parser')
trs = soup.findAll('tr',attrs={"height":"35px"})
print '[*] get magnet link'
for tr in trs:
trsoup = BeautifulSoup(str(tr).decode('utf-8', 'ignore'),'html.parser')
td2 = trsoup.findAll('td',attrs={"style":"text-align:center;white-space:nowrap"})
a = td2[0].find('a')
magnet = a.get("href") #unicode object
size = a.text.strip()
print '[*] '+magnet,size
os.chdir("../..")
评论列表
文章目录