diff options
author | Remita Amine <remitamine@gmail.com> | 2020-12-02 21:36:51 +0100 |
---|---|---|
committer | Remita Amine <remitamine@gmail.com> | 2020-12-02 21:49:09 +0100 |
commit | 64554c12e121a5dc0ab3f715fbf2452e5969a722 (patch) | |
tree | bcdee33eb976b15a3fdb89993bf6f74353eb3da6 /youtube_dl/extractor/fujitv.py | |
parent | 4ded9c0f0018f45034070092e4899668f58b4690 (diff) |
[tver] Add new extractor (closes #26662)(closes #27284)
Diffstat (limited to 'youtube_dl/extractor/fujitv.py')
-rw-r--r-- | youtube_dl/extractor/fujitv.py | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/youtube_dl/extractor/fujitv.py b/youtube_dl/extractor/fujitv.py new file mode 100644 index 000000000..39685e075 --- /dev/null +++ b/youtube_dl/extractor/fujitv.py @@ -0,0 +1,35 @@ +# coding: utf-8 +from __future__ import unicode_literals + +from .common import InfoExtractor + + +class FujiTVFODPlus7IE(InfoExtractor): + _VALID_URL = r'https?://i\.fod\.fujitv\.co\.jp/plus7/web/[0-9a-z]{4}/(?P<id>[0-9a-z]+)' + _BASE_URL = 'http://i.fod.fujitv.co.jp/' + _BITRATE_MAP = { + 300: (320, 180), + 800: (640, 360), + 1200: (1280, 720), + 2000: (1280, 720), + } + + def _real_extract(self, url): + video_id = self._match_id(url) + formats = self._extract_m3u8_formats( + self._BASE_URL + 'abr/pc_html5/%s.m3u8' % video_id, video_id) + for f in formats: + wh = self._BITRATE_MAP.get(f.get('tbr')) + if wh: + f.update({ + 'width': wh[0], + 'height': wh[1], + }) + self._sort_formats(formats) + + return { + 'id': video_id, + 'title': video_id, + 'formats': formats, + 'thumbnail': self._BASE_URL + 'pc/image/wbtn/wbtn_%s.jpg' % video_id, + } |