CharlesPikachu / musicdl

Musicdl: A lightweight music downloader written in pure python.
https://musicdl.readthedocs.io/
Apache License 2.0
1.18k stars 270 forks source link

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

Closed edwardyeung closed 1 year ago

edwardyeung commented 2 years ago

Environment (使用环境)

测试搜索“黑夜问白天”, 下载序号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'

CharlesPikachu commented 2 years ago

无损音质的歌曲目前没法下载了,其他的可以正常下载