Giter Club home page Giter Club logo

musicdl's Introduction


docs PyPI - Python Version PyPI license PyPI - Downloads PyPI - Downloads issue resolution open issues

Documents: https://musicdl.readthedocs.io/

Musicdl

A lightweight music downloader written in pure python.
You can star this repository to keep track of the project if it's helpful for you, thank you for your support.

Statement

This repository is created just for learning python(Commercial prohibition).
All the apis used in this repository are from public network. So, if you want to download the paid songs, 
please open a paid member on corresponding music platform by yourself (respect the music copyright please).
Finally, if there are any infringements, please contact me to delete this repository.

Support List

Source_EN Support Search? Support Download? Source_CN
QQMusic QQ音乐
Lizhi 荔枝FM
Yiting 一听音乐
Kuwo 酷我音乐
Kugou 酷狗音乐
Qianqian 千千音乐
Migu 咪咕音乐
JOOX JOOX音乐
Fivesing 5SING音乐
Netease 网易云音乐
Ximalaya 喜马拉雅

Practice with Musicdl

Project_EN Introduction Code Project_CN
musicdlgui click click 音乐下载器GUI界面
singerlyricsanalysis click click 歌手歌词分析
searchlyrics click click 歌词获取歌曲片段

Install

Pip install

run "pip install musicdl"

Source code install

(1) Offline
Step1: git clone https://github.com/CharlesPikachu/musicdl.git
Step2: cd musicdl -> run "python setup.py install"
(2) Online
run "pip install git+https://github.com/CharlesPikachu/musicdl.git@master"

Quick Start

Run by leveraging the API

from musicdl import musicdl

config = {'logfilepath': 'musicdl.log', 'savedir': 'downloaded', 'search_size_per_source': 5, 'proxies': {}}
target_srcs = [
    'kugou', 'kuwo', 'qqmusic', 'qianqian', 'fivesing',
    'netease', 'migu', 'joox', 'yiting',
]
client = musicdl.musicdl(config=config)
client.run(target_srcs)

Run by leveraging compiled file

Usage: musicdl [OPTIONS]

Options:
  --version               Show the version and exit.
  -k, --keyword TEXT      搜索的歌曲关键字, 若不指定, 则进入musicdl终端版
  -l, --logfilepath TEXT  日志文件保存的路径
  -p, --proxies TEXT      设置的代理
  -s, --savedir TEXT      下载的音乐保存路径
  -c, --count TEXT        在各个平台搜索时的歌曲搜索数量
  -t, --targets TEXT      指定音乐搜索的平台, 例如"migu,joox"
  --help                  Show this message and exit.

Screenshot

img

Projects in Charles_pikachu

  • Games: Create interesting games in pure python.
  • DecryptLogin: APIs for loginning some websites by using requests.
  • Musicdl: A lightweight music downloader written in pure python.
  • Videodl: A lightweight video downloader written in pure python.
  • Pytools: Some useful tools written in pure python.
  • PikachuWeChat: Play WeChat with itchat-uos.
  • Pydrawing: Beautify your image or video.
  • ImageCompressor: Image compressors written in pure python.
  • FreeProxy: Collecting free proxies from internet.
  • Paperdl: Search and download paper from specific websites.
  • Sciogovterminal: Browse "The State Council Information Office of the People's Republic of China" in the terminal.
  • CodeFree: Make no code a reality.
  • DeepLearningToys: Some deep learning toys implemented in pytorch.
  • DataAnalysis: Some data analysis projects in charles_pikachu.
  • Imagedl: Search and download images from specific websites.
  • Pytoydl: A toy deep learning framework built upon numpy.
  • NovelDL: Search and download novels from some specific websites.

Citation

If you use this project in your research, please cite this project.

@misc{musicdl2020,
    author = {Zhenchao Jin},
    title = {Musicdl: A lightweight music downloader written in pure python},
    year = {2020},
    publisher = {GitHub},
    journal = {GitHub repository},
    howpublished = {\url{https://github.com/CharlesPikachu/musicdl}},
}

More

WeChat Official Accounts

Charles_pikachu
img

musicdl's People

Contributors

charlespikachu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

musicdl's Issues

[BUG] 下载咪咕源 FLAC 音乐时出错

Environment (使用环境)

  • Installation method (安装方式): pip
  • The version of musicdl (版本号): 2.3.5
  • Operating system (操作系统): Windows 10
  • Python version (Python版本): 3.10.5

Question description (问题描述)

下载咪咕源的 FLAC 格式音乐时会出错,mp3 格式不会出现问题。由于没找到其他平台的 FLAC 音乐所以其他平台无法测试。

Screenshot (报错截图)

Welcome to use musicdl!
You can visit https://github.com/CharlesPikachu/musicdl for more details.
2022-09-13 17:47:24 INFO     正在搜索 稻香 来自 MIGU
+------+--------+----------------------------------+---------+-------+----------------------------------+------+
| 序号 |  歌手  |               歌名               |   大小  |  时长 |               专辑               | 来源 |
+------+--------+----------------------------------+---------+-------+----------------------------------+------+
|  0   | 周杰伦 |               稻香               | 24.92MB | -:-:- |              魔杰座              | MIGU |
|  1   | 周杰伦 | 稻香(央视星光璀璨**巨星演唱会) |  8.32MB | -:-:- | 央视星光璀璨**巨星演唱会第四期 | MIGU |
|  2   | 周杰伦 |           稻香 (Live)            |  22.4MB | -:-:- |   周杰伦地表最强世界巡回演唱会   | MIGU |
|  3   | 周杰伦 |           稻香 (Live)            | 23.55MB | -:-:- |    The Era 2010 超时代演唱会     | MIGU |
|  4   | 谢昊轩 |      稻香(**新声代第三季)      | 17.71MB | -:-:- |                -                 | MIGU |
+------+--------+----------------------------------+---------+-------+----------------------------------+------+
请输入想要下载的音乐编号: 0
2022-09-13 17:47:29 INFO     正在从MIGU下载 >>>> 稻香
Traceback (most recent call last):
  File "C:\Python310\Scripts\musicdl-script.py", line 33, in <module>
    sys.exit(load_entry_point('musicdl==2.3.5', 'console_scripts', 'musicdl')())
  File "C:\Python310\lib\site-packages\click-8.1.3-py3.10.egg\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "C:\Python310\lib\site-packages\click-8.1.3-py3.10.egg\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "C:\Python310\lib\site-packages\click-8.1.3-py3.10.egg\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "C:\Python310\lib\site-packages\click-8.1.3-py3.10.egg\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "C:\Python310\lib\site-packages\musicdl-2.3.5-py3.10.egg\musicdl\musicdl.py", line 208, in musicdlcmd
  File "C:\Python310\lib\site-packages\musicdl-2.3.5-py3.10.egg\musicdl\musicdl.py", line 131, in download
  File "C:\Python310\lib\site-packages\musicdl-2.3.5-py3.10.egg\musicdl\modules\sources\base.py", line 29, in download
  File "C:\Python310\lib\site-packages\musicdl-2.3.5-py3.10.egg\musicdl\modules\utils\downloader.py", line 28, in start
  File "C:\Python310\lib\site-packages\requests-2.28.1-py3.10.egg\requests\structures.py", line 52, in __getitem__
    return self._store[key.lower()][1]
KeyError: 'content-length'

[BUG]*Execute the GUI interface to download songs and report errors

**Environment (使用环境)**win10

  • Installation method (安装方式): offline
  • The version of musicdl (版本号): release
  • Operating system (操作系统): window
  • Python version (Python版本): 3.10.7

**Question description (问题描述)**Execute the GUI interface to download songs and report errors

Screenshot (报错截图)
MUTN~IO(8WQIN)RQ5@MQFWL

**Advice (修复建议)**Fix it as soon as possible

老哥, 建议兼容下Mac. 很多类型错误

[wangyiyun-INFO]: 请输入歌曲名 --> "我"
--未检索到歌曲的相关信息, 请重新输入--
Traceback (most recent call last):
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1664, in
main()
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1658, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "/Applications/PyCharm.app/Contents/helpers/pydev/pydevd.py", line 1068, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "/Users/johnson/Downloads/Music-Downloader-master/MusicDownloader/cmd.py", line 136, in
MusicDownloader().run()
File "/Users/johnson/Downloads/Music-Downloader-master/MusicDownloader/cmd.py", line 54, in run
num_downed, num_need_down = self.__userSearch()
TypeError: 'NoneType' object is not iterable

[BUG] 下载网易云音乐的时候出错。

Environment (使用环境)

  • Installation method (安装方式): pip install musicdl --update
  • The version of musicdl (版本号): v2.3.5
  • Operating system (操作系统): windows 10
  • Python version (Python版本): 3.10

测试搜索“黑夜问白天”, 下载序号0,来源为MIGU

显示如下错误。
获取response 的时候找不到content-length 吧?

Traceback (most recent call last):
File "C:\Users\yy101\miniconda3\envs\py310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\yy101\miniconda3\envs\py310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\yy101\miniconda3\envs\py310\Scripts\musicdl.exe_main
.py", line 7, in
File "C:\Users\yy101\miniconda3\envs\py310\lib\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
File "C:\Users\yy101\miniconda3\envs\py310\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\Users\yy101\miniconda3\envs\py310\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\yy101\miniconda3\envs\py310\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "C:\Users\yy101\miniconda3\envs\py310\lib\site-packages\musicdl\musicdl.py", line 180, in musicdlcmd
dl_client.run(target_srcs=target_srcs)
File "C:\Users\yy101\miniconda3\envs\py310\lib\site-packages\musicdl\musicdl.py", line 79, in run
self.download(songinfos)
File "C:\Users\yy101\miniconda3\envs\py310\lib\site-packages\musicdl\musicdl.py", line 131, in download
getattr(self, songinfo['source']).download([songinfo])
File "C:\Users\yy101\miniconda3\envs\py310\lib\site-packages\musicdl\modules\sources\base.py", line 29, in download
if task.start():
File "C:\Users\yy101\miniconda3\envs\py310\lib\site-packages\musicdl\modules\utils\downloader.py", line 28, in start
total_size, chunk_size, downloaded_size = int(response.headers['content-length']), songinfo.get('chunk_size', 1024), 0
File "C:\Users\yy101\miniconda3\envs\py310\lib\site-packages\requests\structures.py", line 52, in getitem
return self._store[key.lower()][1]
KeyError: 'content-length'

[BUG] 写入log文件,中文编码为GBK

Environment (使用环境)

  • Installation method (安装方式): pycharm 社区版根据setup.py创建venv环境运行
  • The version of musicdl (版本号): 2.3.2
  • Operating system (操作系统): win10
  • Python version (Python版本): 3.8

Question description (问题描述)
musicdl/modules/utils/logger.py中,将log写入文件,写入中文时,使用的是GBK 编码,如何指定为UTF-8编码?

    def info(self, message, disable_print=False):
        if disable_print:
            fp = open(self.logfilepath, 'a')
            fp.write(message + '\n')
        else:
            Logger.log(logging.INFO, message)

Screenshot (报错截图)
image

Advice (修复建议)
添加指定编码的选项或参数。

Set bar_download throws an error when using musicdlgui.py

Here is the log:
[linux@fedora musicdlgui]$ python musicdlgui.py
2022-06-10 10:26:03 INFO 正在搜索 周杰伦 来自 QQMUSIC|KUWO|MIGU|QIANQIAN|KUGOU|NETEASE
/usr/lib/python3.10/site-packages/urllib3/connectionpool.py:1013: InsecureRequestWarning: Unverified HTTPS request is being made to host 'app.pd.nf.migu.cn'. Adding certificate verification is strongly advised. See: https://urllib3.readthedocs.io/en/1.26.x/advanced-usage.html#ssl-warnings
warnings.warn(
Traceback (most recent call last):
File "/home/linux/musicdl/examples/musicdlgui/musicdlgui.py", line 97, in download
self.bar_download.setValue(download_size / total_size * 100)
TypeError: setValue(self, int): argument 1 has unexpected type 'float'

可用谢谢

可用,但是请问可不可以下载无损版的文件,谢谢

一个请求

你好,作者。我是小白,请问有没有应用程序,我的电脑没有安装python

如何打包musicdlgui成为EXE文件呢?

你好,我想请问一下,我如果想把example里面的musicdlgui打包成一个EXE文件,应该怎么操作呢?
以下命令是已经进入了example下面的musicdlgui的文件夹,执行以下命令,成功build了,但是得到的EXE闪退。

pyinstaller --onefile --icon=icon2.ico --name=音乐小站 musicdlgui.py 

[BUG]*Execute the GUI interface to download songs and report errors

**Environment (使用环境)**win10

  • Installation method (安装方式): offline
  • The version of musicdl (版本号): release
  • Operating system (操作系统): window
  • Python version (Python版本): 3.10.7

**Question description (问题描述)**Execute the GUI interface to download songs and report errors

Screenshot (报错截图)
MUTN~IO(8WQIN)RQ5@MQFWL

**Advice (修复建议)**Fix it as soon as possible

[BUG] ModuleNotFoundError: No module named 'Crypto'

Environment (使用环境)

  • Installation method (安装方式):
  • The version of musicdl (版本号):
  • Operating system (操作系统):
  • Python version (Python版本):

Question description (问题描述)

Screenshot (报错截图)

Advice (修复建议)

I have installed pycryptodome via pip and still the same error shows

[BUG]

Environment (使用环境)

  • Installation method (安装方式): python3 setup.py install
  • The version of musicdl (版本号): 最新版本
  • Operating system (操作系统): macos Monterey 12.2.1
  • Python version (Python版本): 3.10.1

Question description (问题描述)
安装报错,我安装GAME的项目也是报相同的错误,然后网上搜了好久也没有解决,需要大佬支持~

Screenshot (报错截图)
WX20220308-165929
Advice (修复建议)

每次搜索关键词的时候都无法返回网易云的内容。

2022-04-10 19:13:01 INFO 正在搜索 你给我听好 来自 KUGOU|KUWO|QQMUSIC|QIANQIAN|FIVESING|NETEASE|MIGU|JOOX|YITING
2022-04-10 19:13:04 WARNING 无法在netease中搜索 >>>> 你给我听好

软路由开启了解锁网易云音乐,是否是这个自动代理的原因

2022-04-10 19:17:54 INFO 正在从QQMUSIC下载 >>>> 雾林酒馆
2022-04-10 19:17:54 INFO 无法从QQMUSIC下载 >>>> 雾林酒馆

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.