if status != 200:
raise ExtractorError(' '.join(response['errors']), expected=True)
- def _get_video_url(self, url_or_request, video_id, note='Downloading JSON metadata'):
- response = self._download_json(url_or_request, video_id, note)
+ def _download_json(self, url_or_request, video_id, note='Downloading JSON metadata'):
+ response = super(EaglePlatformIE, self)._download_json(url_or_request, video_id, note)
self._handle_error(response)
- return response['data'][0]
+ return response
+
+ def _get_video_url(self, url_or_request, video_id, note='Downloading JSON metadata'):
+ return self._download_json(url_or_request, video_id, note)['data'][0]
def _real_extract(self, url):
mobj = re.match(self._VALID_URL, url)
if age_restriction:
age_limit = 0 if age_restriction == 'allow_all' else 18
- secure_m3u8 = self._proto_relative_url(media['sources']['secure_m3u8']['auto'])
+ secure_m3u8 = self._proto_relative_url(media['sources']['secure_m3u8']['auto'], 'http:')
m3u8_url = self._get_video_url(secure_m3u8, video_id, 'Downloading m3u8 JSON')
formats = self._extract_m3u8_formats(
'mp4', entry_protocol='m3u8_native')
mp4_url = self._get_video_url(
- secure_m3u8.replace("m3u8", "mp4").replace("hlsvod", "mp4").replace("hls", "mp4"),
+ # Secure mp4 URL is constructed according to Player.prototype.mp4 from
+ # http://lentaru.media.eagleplatform.com/player/player.js
+ re.sub(r'm3u8|hlsvod|hls|f4m', 'mp4', secure_m3u8),
video_id, 'Downloading mp4 JSON')
formats.append({'url': mp4_url, 'format_id': 'mp4'})