1 from .common
import InfoExtractor
2 from ..networking
import HEADRequest
5 class FujiTVFODPlus7IE(InfoExtractor
):
6 _VALID_URL
= r
'https?://fod\.fujitv\.co\.jp/title/(?P<sid>[0-9a-z]{4})/(?P<id>[0-9a-z]+)'
7 _BASE_URL
= 'https://i.fod.fujitv.co.jp/'
17 'url': 'https://fod.fujitv.co.jp/title/5d40/5d40110076',
21 'title': '#1318 『まる子、まぼろしの洋館を見る』の巻',
24 'description': 'md5:b3f51dbfdda162ac4f789e0ff4d65750',
25 'thumbnail': 'https://i.fod.fujitv.co.jp/img/program/5d40/episode/5d40110076_a.jpg',
28 'url': 'https://fod.fujitv.co.jp/title/5d40/5d40810083',
32 'title': '#1324 『まる子とオニの子』の巻/『結成!2月をムダにしない会』の巻',
33 'description': 'md5:3972d900b896adc8ab1849e310507efa',
36 'thumbnail': 'https://i.fod.fujitv.co.jp/img/program/5d40/episode/5d40810083_a.jpg'},
37 'skip': 'Video available only in one week',
40 def _real_extract(self
, url
):
41 series_id
, video_id
= self
._match
_valid
_url
(url
).groups()
42 self
._request
_webpage
(HEADRequest(url
), video_id
)
44 token
= self
._get
_cookies
(url
).get('CT')
46 json_info
= self
._download
_json
(
47 f
'https://fod-sp.fujitv.co.jp/apps/api/episode/detail/?ep_id={video_id}&is_premium=false',
48 video_id
, headers
={'x-authorization': f
'Bearer {token.value}'}, fatal
=False)
50 self
.report_warning(f
'The token cookie is needed to extract video metadata. {self._login_hint("cookies")}')
51 formats
, subtitles
= [], {}
52 src_json
= self
._download
_json
(f
'{self._BASE_URL}abrjson_v2/tv_android/{video_id}', video_id
)
53 for src
in src_json
['video_selector']:
54 if not src
.get('url'):
56 fmt
, subs
= self
._extract
_m
3u8_formats
_and
_subtitles
(src
['url'], video_id
, 'ts')
58 f
.update(dict(zip(('height', 'width'),
59 self
._BITRATE
_MAP
.get(f
.get('tbr'), ()))))
61 subtitles
= self
._merge
_subtitles
(subtitles
, subs
)
65 'title': json_info
.get('ep_title'),
66 'series': json_info
.get('lu_title'),
67 'series_id': series_id
,
68 'description': json_info
.get('ep_description'),
70 'subtitles': subtitles
,
71 'thumbnail': f
'{self._BASE_URL}img/program/{series_id}/episode/{video_id}_a.jpg',
72 '_format_sort_fields': ('tbr', ),