[bilibili] redirect /s/ URLs

This commit is contained in:
Mort Yao 2021-04-04 02:59:00 +02:00
parent ef9ff72183
commit 1c841f7e8c
No known key found for this signature in database
GPG Key ID: 07DA00CB78203251

View File

@ -162,6 +162,11 @@ class Bilibili(VideoExtractor):
self.url = 'https://www.bilibili.com/bangumi/play/ep%s' % ep_id
html_content = get_content(self.url, headers=self.bilibili_headers(referer=self.url))
# redirect: s
elif re.match(r'https?://(www\.)?bilibili\.com/s/(.+)', self.url):
self.url = 'https://www.bilibili.com/%s' % match1(self.url, r'/s/(.+)')
html_content = get_content(self.url, headers=self.bilibili_headers())
# sort it out
if re.match(r'https?://(www\.)?bilibili\.com/audio/au(\d+)', self.url):
sort = 'audio'