• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > 使用Python实现下载网易云音乐的高清MV

使用Python实现下载网易云音乐的高清MV

作者:hebedich 字体:[增加 减小] 来源:互联网

hebedich 通过本文主要向大家介绍了python爬虫网易云音乐,python 网易云音乐,网易云音乐mv黑屏,网易云音乐mv下载,网易云音乐mv等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

Python下载网易云音乐的高清MV,没有从首页进去解析,直接循环了....

downPage1.py

#coding=utf-8
import urllib
import re
import os
def getHtml(url):
    page = urllib.urlopen(url)
    html = page.read()
    return html
def getVideo(html):
    reg = r'hurl=(.+?\.jpg)'
    imgre = re.compile(reg)
    imglist = re.findall(imgre,html)
    return imglist
for num in range(28000,1000000):
    print num
    html = getHtml("http://music.163.com/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 os.path.exists(filename):
        print 'the MV file exists.%s'%num
    else:
        print 'the MV is downloding.%s'%num
        if  os.path.exists(artist):
            print ""
        else:
            os.makedirs(artist)
        urllib.urlretrieve(vedioUrls[0],filename)
</div>

以上就是本文分享的全部代码了,希望大家能够喜欢。

</div>

您可能想查找下面的文章:

  • Python爬取网易云音乐热门评论
  • 使用Python实现下载网易云音乐的高清MV
  • 使用Python实现下载网易云音乐的高清MV

相关文章

  • 使用Django的模版来配合字符串翻译工作
  • python求pi的方法
  • Python爬取国外天气预报网站的方法
  • Python中特殊函数集锦
  • python实现挑选出来100以内的质数
  • python判断给定的字符串是否是有效日期的方法
  • python中去空格函数的用法
  • Python装饰器使用示例及实际应用例子
  • 分享一下Python 开发者节省时间的10个方法
  • 合并百度影音的离线数据( with python 2.3)

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • Windows下搭建python开发环境详细步骤
    • 在Debian下配置Python+Django+Nginx+uWSGI+MySQL的教程
    • Python中asyncore异步模块的用法及实现httpclient的实例
    • python实现unicode转中文及转换默认编码的方法
    • 在Python中使用HTML模版的教程
    • Python运行的17个时新手常见错误小结
    • python从网络读取图片并直接进行处理的方法
    • Python中使用logging模块代替print(logging简明指南)
    • windows10系统中安装python3.x+scrapy教程
    • python模拟登录百度代码分享(获取百度贴吧等级)

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有