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

get_favour报错value is not a valid integer (type=type_error.integer) #108

Closed
strobenights opened this issue Mar 12, 2023 · 11 comments
Closed

Comments

@strobenights
Copy link

这个收藏夹也是特例,辛苦大佬空了看一下~
还有下载视频数量较多(1700+)的收藏夹时总是批量弹出警告GET LocalProtocolError GET WriteError ,但url都是能正常打开的

版本:0.14.1
操作系统: Win10 x64
Python:3.83

执行命令:
bilix fav 1420600470 --image --subtitle --dm --max-con 1 --cookie 51*************************************22 -n 9999

报错信息:

Traceback (most recent call last):
  File "e:\python\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "e:\python\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "E:\Python\Scripts\bilix.exe\__main__.py", line 7, in <module>
  File "e:\python\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "e:\python\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "e:\python\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "e:\python\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "e:\python\lib\site-packages\bilix\__main__.py", line 333, in main
    loop.run_until_complete(cor)
  File "e:\python\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "e:\python\lib\site-packages\bilix\download\downloader_bilibili.py", line 112, in get_favour
    await asyncio.gather(*cors)
  File "e:\python\lib\site-packages\bilix\download\downloader_bilibili.py", line 125, in _get_favor_by_page
    await asyncio.gather(*cors)
  File "e:\python\lib\site-packages\bilix\download\downloader_bilibili.py", line 260, in get_series
    video_info = await api.get_video_info(self.client, url)
  File "e:\python\lib\site-packages\bilix\api\bilibili.py", line 332, in get_video_info
    video_info = VideoInfo.parse_html(url, res.text)
  File "e:\python\lib\site-packages\bilix\api\bilibili.py", line 246, in parse_html
    status = Status(**init_info['videoData']['stat'])
  File "pydantic\main.py", line 342, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 1 validation error for Status
view
  value is not a valid integer (type=type_error.integer)
@HFrost0
Copy link
Owner

HFrost0 commented Mar 13, 2023

没能复现你的错误,这个看上去是解析观看数等状态时报的错,如果还是报错可以试着升级一下pydantic的版本

@strobenights
Copy link
Author

strobenights commented Mar 13, 2023

找到原因了,有个视频(登录后可见)播放数异常导致实例化失败。好像b站早期某些视频都隐藏播放量了,原因

    'stat': {
            'aid': 1223159,
            'view': '--',
            'danmaku': 3411,
            'reply': 1300,
            'favorite': 24739,
            'coin': 3177,
            'share': 3256,
            'now_rank': 0,
            'his_rank': 0,
            'like': 15340,
            'dislike': 0,
            'evaluation': '',
            'argue_msg': '',
            'viewseo': '--'
        }

@HFrost0
Copy link
Owner

HFrost0 commented Mar 13, 2023

没想到还有这样的视频,之后会加入对这类视频的处理

HFrost0 added a commit that referenced this issue Mar 21, 2023
@HFrost0
Copy link
Owner

HFrost0 commented Mar 22, 2023

这个问题解决了,但是可能还是下载不了这种视频(会提示需要大会员或地区不支持),因为年代比较久远b站没有dash的下载方式

@HFrost0 HFrost0 closed this as completed Mar 22, 2023
@strobenights
Copy link
Author

可不可以当没有dash格式时能否尝试获取MP4的视频流,一个建议,谢谢!

https://api.bilibili.com/x/player/playurl?bvid=BV1rx411T7Ad&cid=1837805&fnval=1&qn=32

不过这个接口好像只能返回360p,试了下目前只有jijidown能拿到此类视频最高清晰度,不知道怎么实现的

参考:
https://github.com/SocialSisterYi/bilibili-API-collect/blob/master/docs/video/videostream_url.md
SocialSisterYi/bilibili-API-collect#606

@HFrost0
Copy link
Owner

HFrost0 commented Mar 22, 2023

既然有人需要的话,后续有时间会弄一下的

@strobenights
Copy link
Author

感谢

@HFrost0
Copy link
Owner

HFrost0 commented Mar 24, 2023

480P视频源嵌入在html中,而360P则是通过接口返回的。💩

@HFrost0
Copy link
Owner

HFrost0 commented Mar 24, 2023

基于这种情况,预计对这种视频不支持质量选择,也不支持info,仅支持下载

@strobenights
Copy link
Author

没事,本来这种视频也是少数特例

@HFrost0
Copy link
Owner

HFrost0 commented Apr 4, 2023

@strobenights 你提到的下载收藏夹时出现的GET报错问题,可能是因为在收藏夹过大的情况下,某些api请求的并发度没有得到有效控制,从而可能触发b站风控。在下一个版本会修复这个问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants