Giter Club home page Giter Club logo

Comments (6)

HFrost0 avatar HFrost0 commented on May 31, 2024

Unable to reproduce in local, it looks like the CI network environment may not be able to get the backup_url. We can remove the site api test like bilix info 'https://www.bilibili.com/xxx' temporarily.

from bilix.

chenrui333 avatar chenrui333 commented on May 31, 2024

which python version are you using?

from bilix.

chenrui333 avatar chenrui333 commented on May 31, 2024

I can reproduce it in my local

==> Testing bilix
/opt/homebrew/Library/Homebrew/test.rb (Formulary::FromPathLoader): loading /opt/homebrew/Library/Taps/homebrew/homebrew-core/Formula/b/bilix.rb
==> /opt/homebrew/Cellar/bilix/0.18.6/bin/bilix info https://www.bilibili.com/video/av20203945/
INFO     Directory videos not exists, auto created

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/bilix/download/utils.py", line 90, in wrapped
    return await func(client, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/bilix/sites/bilibili/api.py", line 400, in get_video_info
    return await _get_video_info_from_html(client, url)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/bilix/sites/bilibili/api.py", line 410, in _get_video_info_from_html
    video_info = VideoInfo.parse_html(url, res.text)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/bilix/sites/bilibili/api.py", line 377, in parse_html
    dash = Dash.from_dict(play_info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/bilix/sites/bilibili/api.py", line 233, in from_dict
    m = Media(quality=quality, codec=d['codecs'], **d)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/pydantic/main.py", line 164, in __init__
    __pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
pydantic_core._pydantic_core.ValidationError: 1 validation error for Media
backup_url
  Input should be a valid list [type=list_type, input_value=None, input_type=NoneType]
    For further information visit https://errors.pydantic.dev/2.5/v/list_type

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

Traceback (most recent call last):
  File "/opt/homebrew/Cellar/bilix/0.18.6/bin/bilix", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/bilix/cli/main.py", line 374, in main
    loop.run_until_complete(cor)
  File "/opt/homebrew/Cellar/[email protected]/3.12.1_1/Frameworks/Python.framework/Versions/3.12/lib/python3.12/asyncio/base_events.py", line 684, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/bilix/sites/bilibili/informer.py", line 88, in temp
    await informer.info_key(key)
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/bilix/sites/bilibili/informer.py", line 23, in info_key
    await self.parse_url(key)(self, key)
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-packages/bilix/sites/bilibili/informer.py", line 36, in info_video
    video_info = await api.get_video_info(self.client, url)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/homebrew/Cellar/bilix/0.18.6/libexec/lib/python3.12/site-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>

from bilix.

HFrost0 avatar HFrost0 commented on May 31, 2024

In some area(overseas), backup_url is unavailable so the pydanticV2 validation failed. I believe it's not related to python version(I tried 3.12 and 3.11). Can you try the master branch? I made some properties optional so it should pass the validation.

from bilix.

chenrui333 avatar chenrui333 commented on May 31, 2024

I will do the master branch test later.

from bilix.

chenrui333 avatar chenrui333 commented on May 31, 2024

@HFrost0 the build patch works for me, closing the issue now.

from bilix.

Related Issues (20)

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.