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

pydantic_core._pydantic_core.ValidationError: 1 validation error for VideoInfo #162

Closed
wencan opened this issue Jul 17, 2023 · 4 comments
Closed
Labels
bug Something isn't working

Comments

@wencan
Copy link

wencan commented Jul 17, 2023

bilix s 'https://www.bilibili.com/bangumi/play/ep753931'

os: 5.10.0-23-amd64 #1 SMP Debian 5.10.179-1 (2023-05-12) x86_64 GNU/Linux

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/bilix/download/utils.py", line 90, in wrapped
    return await func(client, *args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/bilix/sites/bilibili/api.py", line 395, in get_video_info
    video_info = VideoInfo.parse_html(url, res.text)
  File "/usr/local/lib/python3.9/dist-packages/bilix/sites/bilibili/api.py", line 387, in parse_html
    video_info = VideoInfo(title=title, h1_title=h1_title, aid=aid, cid=cid, status=status,
  File "/usr/local/lib/python3.9/dist-packages/pydantic/main.py", line 150, in __init__
    __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 1 validation error for VideoInfo
bvid
  Input should be a valid string [type=string_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.0.3/v/string_type

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

Traceback (most recent call last):
  File "/usr/local/bin/bilix", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/bilix/cli/main.py", line 374, in main
    loop.run_until_complete(cor)
  File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.9/dist-packages/bilix/sites/bilibili/downloader.py", line 299, in get_series
    video_info = await api.get_video_info(self.client, url)
  File "/usr/local/lib/python3.9/dist-packages/bilix/download/utils.py", line 94, in wrapped
    raise APIParseError(e, func) from e
bilix.exception.APIParseError: APIParseError Caused by ValidationError in <bilix.sites.bilibili.api:get_video_info>

@HFrost0
Copy link
Owner

HFrost0 commented Jul 17, 2023

这个是因为pydantic最近有大版本升级(2.0),而bilix目前没有指定1.x版本,之后会修复这个

可以通过手动安装pip install pydantic==1.*来修复

@HFrost0 HFrost0 added the bug Something isn't working label Jul 17, 2023
@HFrost0
Copy link
Owner

HFrost0 commented Jul 17, 2023

0.18.4应该修复了这个

@wencan
Copy link
Author

wencan commented Jul 17, 2023

yes!
升到0.18.4后,正常了
感谢!

@HFrost0 HFrost0 closed this as completed Jul 17, 2023
@healer-ywy
Copy link

请问什么升到0.18.4呢?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants