0xHJK / 0xHJK/music-dl

[BUG]JSON解析问题

Offen
#22 1 Kommentar 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Python
Sterne
4.4k
Forks
593
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

**问题描述(Question description)**
提交issue前,请先检查是否是最新的代码、环境是否符合要求、依赖是否安装完整
请尽可能填写完整以下信息,方便排查问题,填写不完整可能不会受理
解决问题后请关闭issue,谢谢

- 搜索的关键字(Keyword):beyond(其它的也一样)
- 出错的音乐源(Music source):
- 使用的命令(Command used):-v

**使用的环境(Environment)**
- 安装方式(Installation method):pip
- music-dl版本(music-dl version):2.2.0
- 操作系统版本(OS version):Windows 10 64位
- Python版本(Python version):3.7.3

**截图**
使用`-v`参数运行,截取完整错误信息
Run with the `-v` parameter to get the full error message
=================================================
Traceback (most recent call last):
File "d:\dev\python37\lib\threading.py", line 917, in _bootstrap_inner
self.run()
File "d:\dev\python37\lib\threading.py", line 865, in run
self._target(*self._args, **self._kwargs)
File "d:\dev\python37\lib\site-packages\music_dl\extractors\xiami.py", line 88, in xiami_music_info
mj = mr.json()
File "d:\dev\python37\lib\site-packages\requests\models.py", line 897, in json
return complexjson.loads(self.text, **kwargs)
File "d:\dev\python37\lib\json\__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "d:\dev\python37\lib\json\decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "d:\dev\python37\lib\json\decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 2 column 1 (char 2)
====================================================
**修改建议**
建议加一个生成log的参数,方便上传错误信息

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

The error occurs in music_dl/extractors/xiami.py line 88 when parsing JSON from a response. Start by examining the xiami_music_info function and the mr response object. Check the raw response text to see why JSON decoding fails. Add error handling or logging to capture the invalid JSON. Run the CLI with -v and the keyword 'beyond' to reproduce the issue.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
python
Bereich
cli
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
50/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.