使用Python实现下载网易云音乐的高清MV
使⽤Python实现下载⽹易云⾳乐的⾼清MV Python下载⽹易云⾳乐的⾼清MV,没有从⾸页进去解析,直接循环了....
downPage1.py
复制代码代码如下:
#coding=utf-8
import urllib
import re
import os
离人愁歌词是什么意思
def getHtml(url):
page = urllib.urlopen(url)
html = ad()
return html
def getVideo(html):
reg = r'hurl=(.+?\.jpg)'
imgre = repile(reg)
imglist = re.findall(imgre,html)
return imglist
for num in range(28000,1000000):
print num
html = getHtml("music.163/mv?id=%s"%num)
parsed = getVideo(html)
优秀企业公民
蹈矩循规if  len(parsed)==0:
continue
vedioUrls = parsed[0].split("&")
artist = vedioUrls[4].split("=")[1].decode('utf-8').strip()
song = vedioUrls[3].split("=")[1].decode('utf-8').strip()
if  len(vedioUrls[0])==0:
continue
filename = '%s/%s.mp4' %(artist,song)
if "/" in song:
continue
坦克世界盒子>考教师编制难吗if ists(filename):
print 'the MV file exists.%s'%num
else:
print 'the MV is downloding.%s'%num
if  ists(artist):
print ""
else:
os.makedirs(artist)
森海塞尔hifi耳机urllib.urlretrieve(vedioUrls[0],filename)
以上就是本⽂分享的全部代码了,希望⼤家能够喜欢。

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系QQ:729038198,我们将在24小时内删除。