aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRemita Amine <remitamine@gmail.com>2017-12-06 22:56:14 +0100
committerRemita Amine <remitamine@gmail.com>2017-12-06 22:56:14 +0100
commit684ae102360dbef6d1e5fcd75a0f86266030e02d (patch)
tree61124e6abf07fcf6665a69e123db55e72128a93c
parent3c4fbfeca2431b120537b9eaedf5977dd0ab13b1 (diff)
[fox] add support for adobe pass auth and extract subtitles(close #14489)(closes #14205)
-rw-r--r--youtube_dl/extractor/fox.py25
1 files changed, 22 insertions, 3 deletions
diff --git a/youtube_dl/extractor/fox.py b/youtube_dl/extractor/fox.py
index 5f98d017b..11d6c9c32 100644
--- a/youtube_dl/extractor/fox.py
+++ b/youtube_dl/extractor/fox.py
@@ -11,6 +11,7 @@ from ..utils import (
parse_duration,
try_get,
unified_timestamp,
+ update_url_query,
)
@@ -62,7 +63,8 @@ class FOXIE(AdobePassIE):
duration = int_or_none(video.get('durationInSeconds')) or int_or_none(
video.get('duration')) or parse_duration(video.get('duration'))
timestamp = unified_timestamp(video.get('datePublished'))
- age_limit = parse_age_limit(video.get('contentRating'))
+ rating = video.get('contentRating')
+ age_limit = parse_age_limit(rating)
data = try_get(
video, lambda x: x['trackingData']['properties'], dict) or {}
@@ -77,8 +79,24 @@ class FOXIE(AdobePassIE):
release_year = int_or_none(video.get('releaseYear'))
if data.get('authRequired'):
- # TODO: AP
- pass
+ resource = self._get_mvpd_resource(
+ 'fbc-fox', title, video.get('guid'), rating)
+ release_url = update_url_query(
+ release_url, {
+ 'auth': self._extract_mvpd_auth(
+ url, video_id, 'fbc-fox', resource)
+ })
+
+ subtitles = {}
+ for doc_rel in video.get('documentReleases', []):
+ rel_url = doc_rel.get('url')
+ if not url or doc_rel.get('format') != 'SCC':
+ continue
+ subtitles['en'] = [{
+ 'url': rel_url,
+ 'ext': 'scc',
+ }]
+ break
info = {
'id': video_id,
@@ -93,6 +111,7 @@ class FOXIE(AdobePassIE):
'episode': episode,
'episode_number': episode_number,
'release_year': release_year,
+ 'subtitles': subtitles,
}
urlh = self._request_webpage(HEADRequest(release_url), video_id)