Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

番剧下载失败,提示API错误 #183

Closed
aizhimoran opened this issue Aug 13, 2023 · 4 comments
Closed

番剧下载失败,提示API错误 #183

aizhimoran opened this issue Aug 13, 2023 · 4 comments
Assignees
Labels
api invalid api is invalid next release will be provided in next release

Comments

@aizhimoran
Copy link

bilix get_video https://www.bilibili.com/bangumi/play/ep754767 --cookie f028c2d9%2C1707306526%2C73a05%2A81nQbaAP7rcFmlHRaNTvE4HruRS3AlNpn1YiaHRSbkZYY******************************QA

Traceback (most recent call last):
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\site-packages\bilix\download\utils.py", line 90, in wrapped
return await func(client, args, **kwargs)
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\site-packages\bilix\sites\bilibili\api.py", line 399, in get_video_info
return await _get_video_info_from_html(client, url)
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\site-packages\bilix\sites\bilibili\api.py", line 407, in _get_video_info_from_html
video_info = VideoInfo.parse_html(url, res.text)
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\site-packages\bilix\sites\bilibili\api.py", line 331, in parse_html
init_info = re.search(r'<script>window.INITIAL_STATE=({.
});(', html).groups()[0] # this line may raise
AttributeError: 'NoneType' object has no attribute 'groups'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 196, in _run_module_as_main
return _run_code(code, main_globals, None,
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\runpy.py", line 86, in run_code
exec(code, run_globals)
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\Scripts\bilix.exe_main
.py", line 7, in
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1130, in call
return self.main(*args, **kwargs)
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\site-packages\bilix\cli\main.py", line 374, in main
loop.run_until_complete(cor)
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
return future.result()
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\site-packages\bilix\sites\bilibili\downloader.py", line 335, in get_video
video_info = await api.get_video_info(self.client, url)
File "C:\Users\Shion\AppData\Local\Programs\Python\Python310\lib\site-packages\bilix\download\utils.py", line 94, in wrapped
raise APIParseError(e, func) from e
bilix.exception.APIParseError: APIParseError Caused by AttributeError in bilix.sites.bilibili.api:get_video_info

@aizhimoran
Copy link
Author

版本号:0.18.4

@HFrost0 HFrost0 self-assigned this Aug 14, 2023
@HFrost0 HFrost0 added the enhancement New feature or request label Aug 14, 2023
@yosandev
Copy link

0.18.6也还是有同样的问题。

@HFrost0 HFrost0 added api invalid api is invalid next release will be provided in next release and removed enhancement New feature or request labels Feb 3, 2024
@HFrost0
Copy link
Owner

HFrost0 commented Feb 3, 2024

fixed in 0.18.8

@HFrost0 HFrost0 closed this as completed Feb 3, 2024
@9ihbd2DZSMjtsf7vecXjz
Copy link

fixed in 0.18.8

您好 18.8依然这个报错
raceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Scripts\bilix.exe_main
.py", line 7, in
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1157, in call
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\bilix\cli\main.py", line 374, in main
loop.run_until_complete(cor)
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\asyncio\base_events.py", line 654, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\bilix\sites\bilibili\downloader.py", line 335, in get_video
video_info = await api.get_video_info(self.client, url)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Administrator\AppData\Local\Programs\Python\Python311\Lib\site-packages\bilix\download\utils.py", line 94, in wrapped
raise APIParseError(e, func) from e
bilix.exception.APIParseError: APIParseError Caused by JSONDecodeError in bilix.sites.bilibili.api:get_video_info

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api invalid api is invalid next release will be provided in next release
Projects
None yet
Development

No branches or pull requests

4 participants