Python——付费/版权歌曲下载
生活随笔
收集整理的這篇文章主要介紹了
Python——付费/版权歌曲下载
小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
很多歌曲需要版權(quán)或者付費(fèi)才能收聽(tīng)
?
?
?
?
正確食用方法:
1、找到歌曲編號(hào)
?
?2、輸入編號(hào)并點(diǎn)擊下載歌曲
?
?
# coding:utf8 # author:Jery # datetime:2019/4/13 23:42 # software:PyCharm # function:輸入編號(hào)下載歌曲,百度音樂(lè)/千千音樂(lè)歌曲下載 import tkinter as tk import requestsroot = tk.Tk() root.geometry('400x150') root.title('千千音樂(lè)歌曲下載') l1 = tk.Label(root, text='請(qǐng)輸入編號(hào):') l1.grid() e1 = tk.Entry(root, text='', width=57) e1.grid(row=1, column=0)def download():songids = []songids.append(e1.get())s = ','.join(songids)url = 'http://play.taihe.com/data/music/songlink'data = {'songIds': s,'hq': '0','type': 'm4a,mp3','rate': '','pt': '0','flag': '-1','s2p': '-1','prerate': '-1','bwt': '-1','dur': '-1','bat': '-1','bp': '-1','pos': '-1','auto': '-1'}response = requests.post(url, data=data)music_infos = response.json()['data']['songList']for music_info in music_infos:songLink = music_info['songLink']songName = music_info['songName']response = requests.get(songLink)# 路徑自己修改with open('E:\\Jay2\\' + songName + '.mp3', 'wb')as f:f.write(response.content)b1 = tk.Button(root, text='下載歌曲', width=8, command=download) b1.grid(row=2, column=0)def clear():e1.delete(0, 'end')b2 = tk.Button(root, text='清除內(nèi)容', width=8, command=clear) b2.grid(row=3, column=0) root.mainloop()?
轉(zhuǎn)載于:https://www.cnblogs.com/Jery-9527/p/10703701.html
總結(jié)
以上是生活随笔為你收集整理的Python——付费/版权歌曲下载的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: python2.7详细安装教程_pyth
- 下一篇: python爬取网易云音乐视频_用Pyt