├── requirements.txt ├── get_music.txt ├── pyproject.toml ├── dist ├── get-music-lizhanqi-1.0.2.tar.gz ├── get-music-lizhanqi-1.0.3.tar.gz ├── get-music-lizhanqi-1.0.4.tar.gz ├── get-music-lizhanqi-1.0.5.tar.gz ├── get-music-lizhanqi-1.0.6.tar.gz ├── get-music-lizhanqi-1.0.7.tar.gz ├── get-music-lizhanqi-1.0.9.tar.gz ├── get-music-lizhanqi-1.2.4.tar.gz ├── get-music-lizhanqi-1.2.6.tar.gz ├── get-music-lizhanqi-1.2.7.tar.gz ├── get-music-lizhanqi-1.2.8.tar.gz ├── get-music-lizhanqi-1.2.9.tar.gz ├── get-music-lizhanqi-0.0.20.tar.gz ├── get-music-lizhanqi-0.0.48.tar.gz ├── get-music-lizhanqi-0.0.52.tar.gz ├── get-music-lizhanqi-0.0.55.tar.gz ├── get-music-lizhanqi-0.0.56.tar.gz ├── get-music-lizhanqi-0.0.57.tar.gz ├── get-music-lizhanqi-0.0.60.tar.gz ├── get-music-lizhanqi-0.0.62.tar.gz ├── get-music-lizhanqi-0.0.64.tar.gz ├── get-music-lizhanqi-1.0.10.tar.gz ├── get-music-lizhanqi-1.0.2023.tar.gz ├── get-music-lizhanqi-1.1.2023.tar.gz ├── get-music-lizhanqi-1.2.11.tar.gz ├── get_music_lizhanqi-1.0.2-py3-none-any.whl ├── get_music_lizhanqi-1.0.3-py3-none-any.whl ├── get_music_lizhanqi-1.0.4-py3-none-any.whl ├── get_music_lizhanqi-1.0.5-py3-none-any.whl ├── get_music_lizhanqi-1.0.6-py3-none-any.whl ├── get_music_lizhanqi-1.0.7-py3-none-any.whl ├── get_music_lizhanqi-1.0.9-py3-none-any.whl ├── get_music_lizhanqi-1.2.4-py3-none-any.whl ├── get_music_lizhanqi-1.2.6-py3-none-any.whl ├── get_music_lizhanqi-1.2.7-py3-none-any.whl ├── get_music_lizhanqi-1.2.8-py3-none-any.whl ├── get_music_lizhanqi-1.2.9-py3-none-any.whl ├── get_music_lizhanqi-0.0.20-py3-none-any.whl ├── get_music_lizhanqi-0.0.48-py3-none-any.whl ├── get_music_lizhanqi-0.0.52-py3-none-any.whl ├── get_music_lizhanqi-0.0.55-py3-none-any.whl ├── get_music_lizhanqi-0.0.56-py3-none-any.whl ├── get_music_lizhanqi-0.0.57-py3-none-any.whl ├── get_music_lizhanqi-0.0.60-py3-none-any.whl ├── get_music_lizhanqi-0.0.62-py3-none-any.whl ├── get_music_lizhanqi-0.0.64-py3-none-any.whl ├── get_music_lizhanqi-1.0.10-py3-none-any.whl ├── get_music_lizhanqi-1.0.2023-py3-none-any.whl ├── get_music_lizhanqi-1.1.2023-py3-none-any.whl └── get_music_lizhanqi-1.2.11-py3-none-any.whl ├── tests └── get_music │ ├── __init__.py │ ├── download.py │ ├── oneting.py │ ├── getkugou.py │ ├── zhidao.py │ ├── qq_playerlist.py │ ├── kg_playerlist.py │ ├── kg_one_playerlist.py │ ├── kw_playerlist.py │ ├── singbz.py │ ├── downloads.py │ ├── migu.py │ ├── 5sing.py │ ├── wy_playerlist.py │ ├── playerlist.py │ ├── baidu.py │ ├── ver.py │ ├── fivesing.py │ ├── qq.py │ ├── kugou.py │ ├── kuwo.py │ ├── top.py │ ├── netease.py │ ├── get_music.py │ └── gui.py ├── 示例2.py ├── LICENSE.txt ├── setup.py ├── 示例.py └── README.md /requirements.txt: -------------------------------------------------------------------------------- 1 | requests 2 | rich 3 | -------------------------------------------------------------------------------- /get_music.txt: -------------------------------------------------------------------------------- 1 | 11 1 kg 2 | 爱人错过 2 kw 3 | 下潜 1 qq 4 | 大田后生仔 1 wy -------------------------------------------------------------------------------- /pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=42"] 3 | build-backend = "setuptools.build_meta" -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.0.2.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.0.2.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.0.3.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.0.3.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.0.4.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.0.4.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.0.5.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.0.5.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.0.6.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.0.6.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.0.7.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.0.7.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.0.9.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.0.9.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.2.4.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.2.4.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.2.6.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.2.6.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.2.7.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.2.7.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.2.8.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.2.8.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.2.9.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.2.9.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-0.0.20.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-0.0.20.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-0.0.48.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-0.0.48.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-0.0.52.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-0.0.52.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-0.0.55.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-0.0.55.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-0.0.56.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-0.0.56.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-0.0.57.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-0.0.57.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-0.0.60.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-0.0.60.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-0.0.62.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-0.0.62.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-0.0.64.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-0.0.64.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.0.10.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.0.10.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.0.2023.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.0.2023.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.1.2023.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.1.2023.tar.gz -------------------------------------------------------------------------------- /dist/get-music-lizhanqi-1.2.11.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get-music-lizhanqi-1.2.11.tar.gz -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.0.2-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.0.2-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.0.3-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.0.3-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.0.4-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.0.4-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.0.5-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.0.5-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.0.6-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.0.6-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.0.7-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.0.7-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.0.9-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.0.9-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.2.4-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.2.4-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.2.6-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.2.6-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.2.7-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.2.7-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.2.8-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.2.8-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.2.9-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.2.9-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-0.0.20-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-0.0.20-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-0.0.48-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-0.0.48-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-0.0.52-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-0.0.52-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-0.0.55-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-0.0.55-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-0.0.56-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-0.0.56-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-0.0.57-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-0.0.57-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-0.0.60-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-0.0.60-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-0.0.62-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-0.0.62-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-0.0.64-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-0.0.64-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.0.10-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.0.10-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.0.2023-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.0.2023-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.1.2023-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.1.2023-py3-none-any.whl -------------------------------------------------------------------------------- /dist/get_music_lizhanqi-1.2.11-py3-none-any.whl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lzq-hopego/get-music-lizhanqi/HEAD/dist/get_music_lizhanqi-1.2.11-py3-none-any.whl -------------------------------------------------------------------------------- /tests/get_music/__init__.py: -------------------------------------------------------------------------------- 1 | from get_music import kugou 2 | from get_music import download 3 | from get_music import migu 4 | from get_music import kuwo 5 | from get_music import netease 6 | from get_music import qq 7 | from get_music import oneting 8 | from get_music import fivesing 9 | from get_music import baidu 10 | -------------------------------------------------------------------------------- /示例2.py: -------------------------------------------------------------------------------- 1 | #如何通过get-music-lizhanqi获取各个平台的热歌榜单 2 | 3 | #需要导入top模块 4 | 5 | #top模块提供了四个平台 6 | #kg 7 | #kw 不建议使用,因为他的数据总是出问题,必须使用的话就像kg一样,就是获取歌曲id在调用对应的模块进行解析,如果无法解析可以重新构建一个搜索(search方法)重新解析 8 | #wy 9 | #qq 10 | #直接调用,返回的参数分别为 歌名,歌手,id 其中kuwo 只返回 歌名,歌手 11 | 12 | from get_music import top 13 | 14 | 15 | #获取酷狗的热歌榜单,只能获取到榜单的前22个 16 | kg_song,kg_singer,kg_id=top.kg() 17 | #由于是kg的因此我们需要导入kugou模块进行解析下载直链 18 | from get_music.kugou import kugou 19 | #初始化对象 20 | kg=kugou() 21 | #获取第一首歌的直链 22 | kg_url=kg.get_music_url(kg_id[0]) 23 | 24 | 25 | #获取网易云音乐的热歌榜单 26 | wy_song,wy_singer,wy_id=top.wy() 27 | from get_music.netease import netease 28 | wy=netease() 29 | #获取第一首歌的直链 30 | wy_url=wy.get_music_url(wy_id[0]) 31 | 32 | #获取qq音乐的热歌榜单 33 | qq_song,qq_singer,qq_id=top.qq() 34 | from get_music.qq import qq 35 | qq=qq() 36 | qq_url=qq.get_music_url(qq_id[5]) #解析第6首,因为前五首需要vip无法解析 37 | 38 | 39 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright 2023 lzq-hopego 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 8 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | import setuptools 2 | 3 | with open("README.md", "r", encoding="utf-8") as fh: 4 | long_description = fh.read() 5 | 6 | setuptools.setup( 7 | name="get-music-lizhanqi", 8 | version="1.2.12", 9 | author="Li Zhan Qi", 10 | author_email="3101978435@qq.com", 11 | description="可以下载音乐的包哦", 12 | long_description=long_description, 13 | long_description_content_type="text/markdown", 14 | url="", 15 | project_urls={ 16 | }, 17 | classifiers=[ 18 | "Programming Language :: Python :: 3", 19 | "License :: OSI Approved :: MIT License", 20 | "Operating System :: OS Independent", 21 | ], 22 | package_dir={"": "tests"}, 23 | packages=setuptools.find_packages(where="tests"), 24 | python_requires=">=3.7", 25 | install_requires=["requests",'rich','pycryptodome'], 26 | entry_points={ 27 | 'console_scripts': ["get-music=get_music.get_music:main", 28 | "get-music-lizhanqi=get_music.get_music:main" 29 | ], 30 | }, 31 | ) 32 | -------------------------------------------------------------------------------- /tests/get_music/download.py: -------------------------------------------------------------------------------- 1 | import requests 2 | import re 3 | from rich.progress import Progress 4 | import rich 5 | from rich.console import Console 6 | import os 7 | 8 | 9 | def download(url,name,ouput=False,or_re=True): 10 | url=str(url).strip('"') 11 | console=Console() 12 | if ouput==True: 13 | print() 14 | if url=='': 15 | console.print('[b red]下载链接为空!') 16 | if or_re: 17 | rstr = r"[\/\\\:\*\?\"\<\>\|\&]" # '/ \ : * ? " < > |' 18 | name = re.sub(rstr, "_", name) # 替换为下划线 19 | if os.path.exists(r"./"+name): 20 | yorn=console.input('[b green]“[b red]{}[/]”已下载是否重新下载(Y/N):'.format(name)) 21 | if yorn not in ['y','Y','是']: 22 | return 23 | response = requests.get(url, stream = True,timeout = 3) # stream=True必须写上 24 | size = 0 # 初始化已下载大小 25 | chunk_size = 1024 # 每次下载的数据大小 26 | content_size = int(response.headers['content-length']) # 下载文件总大小 27 | c_size="[b green]文件总大小:[b red]{:.2f}MB[/]".format(content_size/1024/1024) 28 | with Progress(rich.progress.TextColumn("[progress.description]{task.description}") 29 | ,rich.progress.BarColumn() 30 | ,c_size 31 | ,rich.progress.TaskProgressColumn() 32 | ,rich.progress.TimeRemainingColumn() 33 | ,rich.progress.TransferSpeedColumn() 34 | ) as progress: 35 | task1 = progress.add_task("[b red]正在下载:" + name, total=100) 36 | while not progress.finished: 37 | try: 38 | 39 | with open(name, 'wb') as file: 40 | for data in response.iter_content(chunk_size = 1024): 41 | file.write(data) 42 | size += len(data) 43 | n = int(size * 100 / content_size) 44 | progress.update(task1, completed = n) 45 | 46 | except Exception: 47 | pass 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /tests/get_music/oneting.py: -------------------------------------------------------------------------------- 1 | import requests 2 | from get_music import download 3 | from rich.console import Console 4 | # import download 5 | console=Console() 6 | class oneting: 7 | def __init__(self,p=False,l=False): 8 | self.headers={'user-agent':'Mozilla/5.0 (iPhone; CPU iPhone OS 9_1 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13B143 Safari/601.1', 9 | 'referer':'https://h5.1ting.com/'} 10 | self.l = l 11 | self.p = p 12 | self.api='一听音乐' 13 | def search(self,songname,page=1): 14 | self.song_name = songname 15 | self.page = page 16 | url = 'https://so.1ting.com/song/json?q={}&page={}&size=20'.format(self.song_name,self.page) 17 | req = requests.get(url,headers=self.headers,timeout=1) 18 | d=req.json() 19 | self.songname=[] 20 | self.singername=[] 21 | self.songs_url=[] 22 | self.pic=[] 23 | 24 | songurl='https://h5.1ting.com/file?url=' 25 | for i in d['results']: 26 | self.songname.append(i['song_name']) 27 | self.pic.append("https:"+i['album_cover']) 28 | self.singername.append(i['singer_name']) 29 | self.songs_url.append(songurl+i['song_filepath'].replace('.wma','.mp3')) 30 | return self.songname,self.singername,self.songs_url 31 | def prints(self): 32 | pass 33 | def get_music_url(self,url): 34 | return url 35 | def get_music_lrc(self,num,return_url=False): 36 | if return_url: 37 | return "找不到歌词" 38 | console.print("[b green]该接口不支持下载歌词谢谢!搜索继续进行中...") 39 | def get_music_pic(self,num,return_url=False): 40 | try: 41 | url=self.pic[num] 42 | if return_url: 43 | return url 44 | name=self.songname[num]+"-"+self.singername[num]+'-'+"封面.jpg" 45 | download.download(url,name) 46 | console.print("[b red]\n歌曲封面下载完成,文件名称为:"+name) 47 | except: 48 | console.print("[b red]未找到该歌曲的封面!") 49 | ##测试代码 50 | ##a=oneting(l=True,p=True) 51 | ##a.search("11") 52 | ##a.prints() 53 | 54 | -------------------------------------------------------------------------------- /tests/get_music/getkugou.py: -------------------------------------------------------------------------------- 1 | import requests,json 2 | 3 | headers={ 4 | 'UserAgent' : 'Mozilla/5.0 (iPhone; CPU iPhone OS 5_0 like Mac OS X) AppleWebKit/534.46 (KHTML, like Gecko) Version/5.1 Mobile/9A334 Safari/7534.48.3', 5 | 'Referer' : 'http://m.kugou.com/rank/info/8888', 6 | 'Cookie' : 'UM_distinctid=161d629254c6fd-0b48b34076df63-6b1b1279-1fa400-161d629255b64c; kg_mid=cb9402e79b3c2b7d4fc13cbc85423190; Hm_lvt_aedee6983d4cfc62f509129360d6bb3d=1523818922; Hm_lpvt_aedee6983d4cfc62f509129360d6bb3d=1523819865; Hm_lvt_c0eb0e71efad9184bda4158ff5385e91=1523819798; Hm_lpvt_c0eb0e71efad9184bda4158ff5385e91=1523820047; musicwo17=kugou' 7 | } 8 | 9 | def get_songs(url): 10 | res=requests.get(url,headers=headers,timeout=1) 11 | return json.loads(res.text) 12 | 13 | 14 | def get_songs_url(d): 15 | songs_list=d['data']['info'] 16 | songs_url=[] 17 | for i in songs_list: 18 | l=[] 19 | 20 | l.append(i["hash"]) 21 | l.append(i["album_id"]) 22 | songs_url.append(l) 23 | return songs_url 24 | def get_songs_urls(ls): 25 | song_list=[] 26 | for i in ls: 27 | url="https://www.kugou.com/yy/index.php?r=play/getdata&hash="+i[0]+"&album_id="+str(i[1]) 28 | d=get_songs(url) 29 | l=[] 30 | l.append(d['data']['song_name']) 31 | l.append(d['data']['author_name']) 32 | l.append(d["data"]["play_url"]) 33 | song_list.append(l) 34 | return song_list 35 | 36 | 37 | 38 | def kugou(keyword): 39 | if keyword: 40 | 41 | url="http://mobilecdngz.kugou.com/api/v3/search/song?tag=1&tagtype=%E5%85%A8%E9%83%A8&area_code=1&plat=0&sver=5&api_ver=1&showtype=20&version=8969&keyword="+keyword 42 | d=get_songs(url) 43 | songs_url=get_songs_url(d) 44 | song_list=get_songs_urls(songs_url) 45 | song_name=[] 46 | songer_name=[] 47 | song_url=[] 48 | for i in song_list: 49 | song_name.append(i[0]) 50 | songer_name.append(i[1]) 51 | song_url.append(i[2]) 52 | return song_name,songer_name,song_url 53 | 54 | 55 | -------------------------------------------------------------------------------- /tests/get_music/zhidao.py: -------------------------------------------------------------------------------- 1 | import requests,re,sys 2 | from rich import console 3 | import urllib.parse 4 | from rich.table import Table 5 | console=console.Console() 6 | 7 | 8 | def search(): 9 | console.print('[b red]此命令用于在网络中查找网友分享的有关您需要下载的歌曲网盘链接!\n\n') 10 | songname=console.input('[b green]请输入您想下载的歌曲:') 11 | url='https://zhidao.baidu.com/search?lm=0&rn=10&pn=0&fr=search&ie=utf-8&dyTabStr=MCw0LDUsMSw2LDMsNyw4LDIsOQ%3D%3D&word={} 歌曲 百度网盘'.format(songname) 12 | headers={ 13 | "User-Agent": "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36", 14 | "Referer":'https://zhidao.baidu.com', 15 | "Host": "zhidao.baidu.com" 16 | } 17 | 18 | s=requests.session() 19 | 20 | html=s.get(url,headers=headers,timeout=5) 21 | html.encoding='utf-8' 22 | 23 | div=re.findall(r'
(.*?)<\/p>',txt)[0]
62 | singer=(re.findall(r'',p)[0]).replace('amp;','')
63 | download(song_url,song_name[i]+"-"+singer+".mp3")
64 | if pic:
65 | img_url=re.findall('',txt)[0]
66 | download(img_url,song_name[i]+"-"+singer+".jpg")
67 | if lrc:
68 | txt=wy.get_music_lrc(song_id)
69 | with open(song_name[i]+"-"+singer+".txt",'w') as f:
70 | f.write(txt)
71 | except:
72 | print('\n\n\n——无法下载或解析歌曲!!!')
73 |
--------------------------------------------------------------------------------
/tests/get_music/playerlist.py:
--------------------------------------------------------------------------------
1 | import getopt
2 | from rich.console import Console
3 |
4 | con = Console()
5 | def player_list(argv):
6 | opts=getopt.getopt(argv,"i:-l-p",["api="])[0]
7 | ## print(opts)
8 | api=''
9 | url=''
10 | lrc=False
11 | pic=False
12 | for i in opts:
13 | if ('-i' in i) and (i[-1] !=''):
14 | url=i[-1]
15 | elif ('--api' in i) and (i[-1] !=''):
16 | api=i[-1]
17 | elif '-l' in i:
18 | lrc=True
19 | elif '-p' in i:
20 | pic=True
21 | ##print(url,api,lrc,pic)
22 |
23 | if api=='' and url=='':
24 | y_help()
25 | if url=='':
26 | url=con.input('\n\n[b green]请输入歌单链接或歌单id >>>')
27 | if url=='':
28 | con.print("[b green]您未输入歌单链接,程序自动退出")
29 | return
30 | if 'http' in url:
31 | if 'kugou.com' in url:
32 | api='kugou'
33 | elif '163.com' in url:
34 | api='netease'
35 | elif 'qq.com' in url:
36 | api='qq'
37 | elif 'kuwo.cn' in url:
38 | api='kuwo'
39 | if api=='' or (api not in ['kugou','netease','kuwo','qq']):
40 | api=con.input('[b green]请输入歌单的平台(kugou,kuwo,netease,qq) >>>')
41 | if api=='' or (api not in ['kugou','netease','kuwo','qq']):
42 | con.print("[b green]您未选择歌单平台,程序自动退出")
43 | return
44 |
45 | if api=='kugou':
46 | from get_music.kg_playerlist import kg_playerlist
47 | kg_playerlist(url,lrc=lrc,pic=pic)
48 | elif api=='netease':
49 | from get_music.wy_playerlist import wy_playerlist
50 | wy_playerlist(url,lrc=lrc,pic=pic)
51 | elif api=='qq':
52 | from get_music.qq_playerlist import qq_playerlist
53 | qq_playerlist(url,lrc=lrc,pic=pic)
54 | elif api=='kuwo':
55 | from get_music.kw_playerlist import kw_playerlist
56 | kw_playerlist(url,lrc=lrc,pic=pic)
57 |
58 | def y_help():
59 | con.print('[b green]这是一个下载歌单列表歌曲的页面,以下是帮助文档')
60 | con.print('[yellow]你可以使用链接或输入id的方式来下载')
61 | con.print('[b green]酷狗的分享链接:[yellow]https://t1.kugou.com/[b red]97fwCebzGV3[/]')
62 | con.print('[b green]网易云的分享链接:[yellow]https://y.music.163.com/m/playlist?id=[b red]7101557391[/]&userid=1915127969&creatorId=1915127969')
63 | con.print('[b green]QQ音乐的分享链接:[yellow]https://y.qq.com/n/ryqq/playlist/[b red]7277950710[/]')
64 | con.print('[b green]酷我的分享链接:[yellow]http://m.kuwo.cn/newh5app/playlist_detail/[b red]3432572921[/]?t=plantform&from=ar')
65 | con.print('[b red]注意如果你使用id的方式进行的,请一定要指定api的名字,下面是示例:')
66 | con.print('[b red]使用链接则不需要跟api的,使用id下载则必要api,api的取值:kugou,kuwo,netease,qq')
67 | con.print('[b green][b yellow]使用分享链接下载歌单的命令:[/]get-music -playerlist -i https://y.qq.com/n/ryqq/playlist/7277950710')
68 | con.print('[b green][b yellow]使用id下载歌单的命令:[/]get-music -playerlist -i 7277950710 --api=qq')
69 | con.print('[b yellow][b red]-playlist[/]是打开下载歌单程序,第一个参数必须是它,[b red]-i[/]后要有一个空格,空格后要输入链接或id,如果是id后面就必须要跟api参数')
70 |
71 |
--------------------------------------------------------------------------------
/tests/get_music/baidu.py:
--------------------------------------------------------------------------------
1 |
2 |
3 | import requests
4 | import re
5 | import time
6 | import hashlib
7 |
8 | from rich.console import Console
9 | # import download
10 | console=Console()
11 |
12 | class baidu:
13 | def __init__(self,p=False,l=False):
14 | self.headers = {
15 | 'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36'
16 | }
17 | self.l=l
18 | self.p=p
19 | self.api='千千静听'
20 | def search(self,songname,page=1):
21 | self.song_name=songname
22 | self.page=page
23 | params = (
24 | ('word', self.song_name),
25 | )
26 | ## response = requests.get('https://music.taihe.com/search', headers=self.headers,params=params,timeout=1)
27 | url_fenye = 'https://music.taihe.com/search?word={}&pageNo={}'.format(self.song_name,str(self.page))
28 | response = requests.get(url=url_fenye, headers=self.headers,timeout=1)
29 | text=response.text
30 | self.songs_url = re.findall(r'(.*?)', text, re.S)
32 | self.songname=re.findall(r'(.*?)', text, re.S)
33 | return self.songname,self.singername,self.songs_url
34 |
35 | ## def prints(self):
36 | ## pass
37 |
38 | def get_music_url(self,songid):
39 | r = f"TSID={songid}&appid=16073360×tamp={str(int(time.time()))}0b50b02fd0d73a9c4c8c3a781c30845f"
40 | sign = hashlib.md5(r.encode(encoding='UTF-8')).hexdigest()
41 | # print(sign) # 获取到的就是每一首歌曲的sign值,下面构造params
42 | params = (
43 | ('sign', sign),
44 | ('appid', '16073360'),
45 | ('TSID', songid),
46 | ('timestamp', str(int(time.time()))),
47 | )
48 | # 具体歌曲的相关属性
49 | song_info = requests.get('https://music.taihe.com/v1/song/tracklink',params=params, timeout=1).json()[
50 | 'data']
51 | self.lrc=song_info['lyric']
52 | self.pic=song_info['pic']
53 | return song_info['path'] # 音频地址
54 | def get_music_lrc(self,num,return_url=False):
55 | try:
56 | name=self.songname[num]+"-"+self.singername[num]+'-'+"歌词.lrc"
57 | name=name.replace(':','_').replace('?','_').replace('|','_').replace('"','_').replace('<','_').replace('>','_')
58 | if return_url:
59 | return self.lrc
60 | download.download(self.lrc,name)
61 | console.print("[b red]\n\n歌词已下载完成,文件名称为:"+name+"\n")
62 | except:
63 | console.print("[b red]未找到该歌曲的歌词!")
64 | def get_music_pic(self,num,return_url=False):
65 | try:
66 | name=self.songname[num]+"-"+self.singername[num]+'-'+"封面.jpg"
67 | if return_url:
68 | return self.pic
69 | download.download(self.pic,name)
70 | console.print("[b red]\n歌曲封面下载完成,文件名称为:"+name)
71 | except:
72 | console.print("[b red]未找到该歌曲的封面!")
73 |
74 | ##测试代码
75 | ##a=baidu(p=True)
76 | ##a.search('11')
77 | ##a.prints()
78 |
--------------------------------------------------------------------------------
/tests/get_music/ver.py:
--------------------------------------------------------------------------------
1 | import requests,re
2 | from rich.console import Console
3 | def ver(ip=True):
4 | console=Console()
5 | if ip==True:
6 | try:
7 | txt=requests.get('http://ip.tool.lu',timeout=1).text.split()
8 | ip=txt[1]
9 | area=' '.join(txt[3:])
10 | console.print('\n[b green]信息一:本机外网ip地址为:[b red]{}[/],归属:[b red]{}[/]'.format(ip,area))
11 |
12 | except:
13 | console.print("\n[b red]ip地址信息一查询失败!")
14 | try:
15 | url='http://nstool.netease.com/'
16 | html=requests.get(url,timeout=1)
17 | txt=html.text
18 | url=re.findall("src\='(.*?)'",txt)[0]
19 | html=requests.get(url,timeout=1)
20 | msg=html.text.split('
')
21 | ip=msg[1].split(': ')[-1].split(' ')
22 | dns=msg[2].split(': ')[-1].split(' ')
23 | msg=msg[3]
24 | console.print('\n[b green]信息二:本机外网ip地址为:[b red]{}[/],归属:[b red]{}[/]'.format(ip[0],ip[-1]))
25 | console.print('[b green]DNS服务器地址:[b red]{}[/],归属:[b red]{}[/],提示信息:[b red]{}[/]'.format(dns[0],dns[-1],msg))
26 | except:
27 | console.print("\n[b red]ip地址信息查二询失败!")
28 |
29 | try:
30 | url = 'http://api.ip33.com/ip/search?s='
31 | d = requests.get(url,timeout=1).json()
32 | console.print('\n[b green]信息三:本机外网ip地址为:[b red]{}[/],归属:[b red]{}[/]'.format(d['ip'],d['area']))
33 | except:
34 | console.print("\n[b red]ip地址信息查三询失败!")
35 | return
36 | version = '1.2.12'
37 | console.print("[b red]当前版本:[b green]"+"v"+version)
38 | url = 'https://pypi.org/project/get-music-lizhanqi/#history'
39 | try:
40 | with console.status("[b green]检查最新版中..."):
41 | html = requests.get(url,timeout = 5)
42 | txt = html.text
43 | crad = re.findall(r' ',txt,re.S)
44 | ver = crad[0]
45 | ver1 = version.split('.')
46 | ver2 = ver.split('.')
47 | ls= []
48 | for i in range(3):
49 | v1 = ver1[i]
50 | v2 = ver2[i]
51 | if v2 > v1:
52 | ls.append(False)
53 | elif v2 == v1:
54 | ls.append(True)
55 | else:
56 | ls.append(False)
57 | if False in ls:
58 | console.print('[b red]最新版本是:[b green]v'+ver+'[/],您可以用"[b green]pip install --upgrade get-music-lizhanqi[/]"命令进行更新')
59 | with console.status("[b green]正在获取新版本的更新内容..."):
60 | url='https://pypi.org/project/get-music-lizhanqi/{}/'.format(crad[0])
61 | html=requests.get(url,timeout=5)
62 | msg=re.findall('''更新记录
63 |
64 |