赞
踩
步骤一:获取歌曲url
例图:
自行查找
步骤二:
运行源码(源码贴在最后)
步骤三:
按照弹窗填写相应的内容就行
相关弹窗展示!
源码
- from fileinput import filename
-
- import easygui
- from easygui import buttonbox, diropenbox
- import requests
- from easygui import enterbox
- import os
- easygui.msgbox("你好,欢迎使用音乐之家!")
- #!!!!教程:https://blog.csdn.net/weixin_45953322/article/details/127989595?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522171835892316800186579266%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=171835892316800186579266&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_click~default-2-127989595-null-null.142^v100^pc_search_result_base2&utm_term=easygui&spm=1018.2226.3001.4187
- #!!!!教程:https://blog.csdn.net/weixin_44289254/article/details/121043821?ops_request_misc=%257B%2522request%255Fid%2522%253A%2522171835892316800186579266%2522%252C%2522scm%2522%253A%252220140713.130102334..%2522%257D&request_id=171835892316800186579266&biz_id=0&utm_medium=distribute.pc_search_result.none-task-blog-2~all~top_positive~default-1-121043821-null-null.142^v100^pc_search_result_base2&utm_term=easygui&spm=1018.2226.3001.4187
- #!!!!教程:https://blog.csdn.net/sohoqq/article/details/136628094?ops_request_misc=&request_id=&biz_id=102&utm_term=Python%E6%80%8E%E4%B9%88%E5%81%9A%E5%87%BA%E6%9D%A5%E5%BC%B9%E7%AA%97%EF%BC%8C%E7%84%B6%E5%90%8E%E5%A1%AB%E5%85%A5%E4%BF%A1%E6%81%AF&utm_medium=distribute.pc_search_result.none-task-blog-2~all~sobaiduweb~default-0-136628094.142^v100^pc_search_result_base2&spm=1018.2226.3001.4187
-
- #交互性页面,弹出弹窗,输入URL
- url= enterbox(msg='请陛下翻牌子:', title='URL')
- #交互性页面,弹出弹窗,输入文件名
- filename1= enterbox(msg='请陛下输入修改后的文件名:', title='文件名')
- #修改文件后缀
- filename2=filename1+".mp3"
- # 获取文件名和后缀
- res = requests.get(url=url)
-
-
- # 保存文件的路径
- file_path0= diropenbox("请选择一个文件夹", "浏览文件夹")
- # 拼接文件路径(上只是储存路径,下为取名字)
- file_path = os.path.join(file_path0, filename2)
-
- if not os.path.exists(os.path.dirname(file_path)):
- os.makedirs(os.path.dirname(file_path))
-
- with open(file_path, mode='wb') as f:
- f.write(res.content)
-
- a = buttonbox(filename1+"已经下载成功! 吾皇万岁万岁万万岁! ", "下载成功!", ["知道了。退下吧!"])
-
-
-
关注公众号,不时分享相关代码及资源。
获取源码py文件方式:关注公众号,回复关键词: 爬虫音乐
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。