(编辑:jimmy 日期: 2025/10/28 浏览:2)
本文实例为大家分享了python音乐下载器的具体代码,供大家参考,具体内容如下
import requests
import urllib
import json
from tkinter import *
import tkinter.messagebox
from tkinter.filedialog import askdirectory
class QQMusic():
def __init__(self):
self.interface = Tk()
self.interface.title('QQ音乐下载器')
self.SavePath = 'C:/Users'
self.entry = None
self.label = None
def DownloadMusic(self):
res1 = requests.get('https://c.y.qq.com/soso/fcgi-bin/client_search_cp"text"] = self.SavePath
def Run(self):
button = Button(self.interface,text='下载歌曲',command = self.DownloadMusic)
button.grid(row=0,column=1,padx=3,pady=2)
self.entry = Entry(self.interface,width=30)
self.entry.grid(row=0,column=0,padx=3,pady=2)
button1 = Button(self.interface,text='保存位置',command = self.ChangePath)
button1.grid(row=1,column=1,padx=3,pady=2)
self.label = Label(self.interface,text=self.SavePath)
self.label.grid(row=1,column=0,padx=3,pady=2)
QQ = QQMusic()
QQ.Run()
可以实现音乐的快速制定路径下载。
以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持。