Fixing getting video from bilibili.com by you-get

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Fixing getting video from bilibili.com by you-get相关的知识,希望对你有一定的参考价值。

After the spring festival, I found that the bilibili video could not download normally.
The ERROR log:
[DEBUG] HTTP Error with code403
......
File "D:Python36Libjson__init.py", line 348, in loads
‘not {!r}‘.format(s.
class.name__))
TypeError: the JSON object must be str, bytes or bytearray, not ‘NoneType‘

Log indicates that a website request was rejected.
When I use brower to play the video, it is normally.

Solution:
Adding the fake header info.
{
req.add_header(‘User-Agent‘, "Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:10.0) Gecko/20100101 Firefox/10.0 ")
}
in common.py (line 431) after
{
req = request.Request(url, headers=headers)
}

Result:
Try again, download the video normally.

以上是关于Fixing getting video from bilibili.com by you-get的主要内容,如果未能解决你的问题,请参考以下文章

JEasyUI: Bug Fixing for perpertygrid

MIP启发式算法:Variable fixing heuristic

Fixing the train-test resolution discrepancy

《Depth from Videos in the Wild:Unsupervised Monocular Depth Learning from Unknown Cameras》论文笔记

48 Fixing relationship Problems with Humor 用幽默解决人际关系问题

get_video_info YouTube 端点突然返回 404 未找到