python批量下载音频
请问这个之后要怎么做呀,已经找好下载链接了 www.zgpingshu.com/down/575/www.zgpingshu.com/down/575/2.html
www.zgpingshu.com/down/575/3.html
www.zgpingshu.com/down/575/4.html
www.zgpingshu.com/down/575/5.html
www.zgpingshu.com/down/575/6.html
www.zgpingshu.com/down/575/7.html 这个是下载页面的链接,你需要进入这个页面,爬取音频的链接
爬取到下面这样的链接
http://doshantianfang1.zgpingshu.com/%E5%8D%95%E7%94%B0%E8%8A%B3%E8%AF%84%E4%B9%A6_%E7%99%BD%E7%9C%89%E5%A4%A7%E4%BE%A0%28320%E5%9B%9E%292.04GB_32k/7004820087.mp3
人造人 发表于 2021-7-17 13:42
这个是下载页面的链接,你需要进入这个页面,爬取音频的链接
爬取到下面这样的链接
对的,但是怎么批量下呀,300多集的{:10_266:} 阿狼啊 发表于 2021-7-17 14:44
对的,但是怎么批量下呀,300多集的
循环,一个一个下载
你怎么进入这个页面的?我找了半天,找不到进入这个页面的方法,你点了哪个按钮?
如何从这里
http://www.zgpingshu.com/play/575/
进入这里
http://www.zgpingshu.com/down/575/ 算了,直接替换 url
import requests
import re
url = 'http://shantianfang.zgpingshu.com/575/'
response = requests.get(url)
url = re.findall('class="player"><a href="//(.*?)"', str(response.content))
count = 1
for i in url:
i = 'http://' + i
i = i.replace('play', 'down')
response = requests.get(i)
url = re.findall('http:.*?mp3', response.content.decode('gbk'))
response = requests.get(i)
with open(str(count) + '.mp3', 'wb') as f:
f.write(response.content)
count += 1
print(url)
input()
13 行改一下
import requests
import re
url = 'http://shantianfang.zgpingshu.com/575/'
response = requests.get(url)
url = re.findall('class="player"><a href="//(.*?)"', str(response.content))
count = 1
for i in url:
i = 'http://' + i
i = i.replace('play', 'down')
response = requests.get(i)
url = re.findall('http:.*?mp3', response.content.decode('gbk'))
response = requests.get(url)
with open(str(count) + '.mp3', 'wb') as f:
f.write(response.content)
count += 1
print(url)
input()
{:5_95:}
页:
[1]