diff options
author | Sergey M․ <dstftw@gmail.com> | 2020-03-24 00:24:39 +0700 |
---|---|---|
committer | Sergey M․ <dstftw@gmail.com> | 2020-03-24 00:24:39 +0700 |
commit | 63dce3094bf45964b49a2c9f26c94b10cf60c2c2 (patch) | |
tree | 29d020628d190a06db8a3aed7b78676b5000d2ca /youtube_dl/extractor/bilibili.py | |
parent | b4eb08bb03f69c587f8440912cf56aadc9e52879 (diff) | |
download | youtube-dl-63dce3094bf45964b49a2c9f26c94b10cf60c2c2.tar.xz |
[bilibili] Add support for player.bilibili.com (closes #24402)
Diffstat (limited to 'youtube_dl/extractor/bilibili.py')
-rw-r--r-- | youtube_dl/extractor/bilibili.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/youtube_dl/extractor/bilibili.py b/youtube_dl/extractor/bilibili.py index e9d0a8d0c..4dc597e16 100644 --- a/youtube_dl/extractor/bilibili.py +++ b/youtube_dl/extractor/bilibili.py @@ -434,3 +434,17 @@ class BilibiliAudioAlbumIE(BilibiliAudioBaseIE): entries, am_id, album_title, album_data.get('intro')) return self.playlist_result(entries, am_id) + + +class BiliBiliPlayerIE(InfoExtractor): + _VALID_URL = r'https?://player\.bilibili\.com/player\.html\?.*?\baid=(?P<id>\d+)' + _TEST = { + 'url': 'http://player.bilibili.com/player.html?aid=92494333&cid=157926707&page=1', + 'only_matching': True, + } + + def _real_extract(self, url): + video_id = self._match_id(url) + return self.url_result( + 'http://www.bilibili.tv/video/av%s/' % video_id, + ie=BiliBiliIE.ie_key(), video_id=video_id) |