fix: bilibili space video return 403 error

This commit is contained in:
Jad 2021-08-28 09:56:41 +08:00 committed by GitHub
parent 63fd9716a8
commit f884a1b275
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -139,7 +139,7 @@ class Bilibili(VideoExtractor):
self.stream_qualities = {s['quality']: s for s in self.stream_types}
try:
html_content = get_content(self.url, headers=self.bilibili_headers(referer=self.url))
html_content = get_content(self.url, headers=self.bilibili_headers(referer=self.url, cookie='CURRENT_FNVAL=16'))
except:
html_content = '' # live always returns 400 (why?)
#self.title = match1(html_content,
@ -582,7 +582,7 @@ class Bilibili(VideoExtractor):
self.url = url
kwargs['playlist'] = True
html_content = get_content(self.url, headers=self.bilibili_headers(referer=self.url))
html_content = get_content(self.url, headers=self.bilibili_headers(referer=self.url, cookie='CURRENT_FNVAL=16'))
# sort it out
if re.match(r'https?://(www\.)?bilibili\.com/bangumi/play/ep(\d+)', self.url):