网站地址
目的
小白入门级教程
视频教程
Python代码
# -*- coding: utf-8 -*-
# @Author: Null119 微信公众号/网站:治廷君
# @Desc: { 知轩藏书下载 }
# @Date: { 2022/7/15 }
import requests,re,urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
def filedown(url,filename):
try:
fname=re.search('《(.*?)》',filename).group(1)
except:
fname=filename.split('作者')[0]
print('开始下载: '+ filename)
resp=requests.get(url,verify=False)
with open('./'+fname+'.zip','wb') as f:
f.write(resp.content)
print('下载完成.')
def getDownUrl(id):
postdata={
'id':id[0]
}
resp=requests.post('https://www.zxcs.info/download1.php',data=postdata,verify=False).text
if resp!='':
down_host='http://207.246.114.172'
downurl=down_host+resp
print(downurl,id[1])
filedown(downurl,id[1])
else:
print('下载地址为空.')
def search(name):
resp=requests.get('https://www.zxcs.info/index.php?keyword='+name,verify=False)
resp=resp.text.replace('\n','').replace('\r','').replace(' ','')
rlist=re.findall('dlid="plist"><dt><ahref="https://www.zxcs.info/post/(\d+)"target="_blank">(.*?)</a>',resp)
print('搜索结果:',rlist)
for i in range(len(rlist)):
getDownUrl(rlist[i])
if __name__ == '__main__':
search('武侠')
本站所有资源版权均属于原作者所有,这里所提供资源均只能用于参考学习使用,请在下载后24小时内删除,严禁商用。若由于商用引起版权纠纷,一切责任均由使用者承担。
评论(0)