标签:lib row obj class ade common pytho init res
After the spring festival, I found that the bilibili video could not download normally.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
标签:lib row obj class ade common pytho init res
原文地址:https://blog.51cto.com/cfy10/2472112