好友
阅读权限10
听众
最后登录1970-1-1
|
import os
import requests
import re
def soushu(zzbds,html):
ab = re.compile(zzbds, re.S)
zml = re.findall(ab, html)
return zml
def openwangye0(url):
headers = {
'cookie':'auth_token=VPu9LKcXvbqKjlosWxOLRM2aCWq4BrdF_VwKuWW64Yjb5tB4l-AHDlYhn59T6Cix0z9Xh1t4PtirXCbkp4vzNA',
}
htl = requests.get(url,headers=headers,timeout=10)
return htl
url = 'https://www.tukuppt.com/peitu/p199/'
html = openwangye0(url).text
zzbds = 'pid="(.*?)" issc="." isfrom="."></span>\r\n <a href=".*?" target="_blank"><img title="(.*?)"'
pagetpml = soushu(zzbds,html)
print(len(pagetpml),pagetpml)
a = 0
for i in pagetpml[a:]:
url = f'https://www.tukuppt.com/index/down?pid={i[0]}'
html = openwangye0(url)
data = html.text
zzbds = '"downurl":"(.*?)"'
downurl = soushu(zzbds,data)
print(data)
downurl1 = re.sub('\\\\','',downurl[0])
data = openwangye0(downurl1).content
path = r'D:\xmbgtp'
if not os.path.exists(path):
os.mkdir(path)
filname = os.path.join(path,f'{i[1]}.jpg')
with open(filname,'wb') as f:
f.write(data)
print(f'{i[1]}下载完成') |
免费评分
-
参与人数 1 | 吾爱币 +5 |
热心值 +1 |
收起
理由
|
苏紫方璇
| + 5 |
+ 1 |
欢迎分析讨论交流,吾爱破解论坛有你更精彩! |
查看全部评分
|
发帖前要善用【论坛搜索】功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。 |
|
|
|
|