2016-07-02 14:20:59 -06:00
|
|
|
|
from .theplatform import ThePlatformIE
|
2016-04-01 02:56:18 -06:00
|
|
|
|
from ..utils import (
|
2019-04-14 04:46:33 -06:00
|
|
|
|
ExtractorError,
|
2021-01-01 05:26:37 -07:00
|
|
|
|
GeoRestrictedError,
|
2019-04-14 04:46:33 -06:00
|
|
|
|
int_or_none,
|
2023-05-24 12:00:43 -06:00
|
|
|
|
remove_start,
|
|
|
|
|
traverse_obj,
|
2016-04-01 02:56:18 -06:00
|
|
|
|
update_url_query,
|
2021-01-01 05:26:37 -07:00
|
|
|
|
urlencode_postdata,
|
2016-06-29 08:49:17 -06:00
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
2022-11-15 17:57:43 -07:00
|
|
|
|
class AENetworksBaseIE(ThePlatformIE): # XXX: Do not subclass from concrete IE
|
2021-01-01 05:26:37 -07:00
|
|
|
|
_BASE_URL_REGEX = r'''(?x)https?://
|
|
|
|
|
(?:(?:www|play|watch)\.)?
|
|
|
|
|
(?P<domain>
|
|
|
|
|
(?:history(?:vault)?|aetv|mylifetime|lifetimemovieclub)\.com|
|
|
|
|
|
fyi\.tv
|
|
|
|
|
)/'''
|
2021-08-07 21:52:31 -06:00
|
|
|
|
_THEPLATFORM_KEY = '43jXaGRQud'
|
|
|
|
|
_THEPLATFORM_SECRET = 'S10BPXHMlb'
|
2021-01-01 05:26:37 -07:00
|
|
|
|
_DOMAIN_MAP = {
|
|
|
|
|
'history.com': ('HISTORY', 'history'),
|
|
|
|
|
'aetv.com': ('AETV', 'aetv'),
|
|
|
|
|
'mylifetime.com': ('LIFETIME', 'lifetime'),
|
|
|
|
|
'lifetimemovieclub.com': ('LIFETIMEMOVIECLUB', 'lmc'),
|
|
|
|
|
'fyi.tv': ('FYI', 'fyi'),
|
|
|
|
|
'historyvault.com': (None, 'historyvault'),
|
|
|
|
|
'biography.com': (None, 'biography'),
|
|
|
|
|
}
|
2015-02-14 15:57:52 -07:00
|
|
|
|
|
2019-04-14 04:46:33 -06:00
|
|
|
|
def _extract_aen_smil(self, smil_url, video_id, auth=None):
|
2022-08-13 11:26:41 -06:00
|
|
|
|
query = {
|
|
|
|
|
'mbr': 'true',
|
|
|
|
|
'formats': 'M3U+none,MPEG-DASH+none,MPEG4,MP3',
|
|
|
|
|
}
|
2019-04-14 04:46:33 -06:00
|
|
|
|
if auth:
|
|
|
|
|
query['auth'] = auth
|
|
|
|
|
TP_SMIL_QUERY = [{
|
|
|
|
|
'assetTypes': 'high_video_ak',
|
2022-08-13 11:26:41 -06:00
|
|
|
|
'switch': 'hls_high_ak',
|
2019-04-14 04:46:33 -06:00
|
|
|
|
}, {
|
2022-08-13 11:26:41 -06:00
|
|
|
|
'assetTypes': 'high_video_s3',
|
2019-04-14 04:46:33 -06:00
|
|
|
|
}, {
|
|
|
|
|
'assetTypes': 'high_video_s3',
|
2021-01-01 05:26:37 -07:00
|
|
|
|
'switch': 'hls_high_fastly',
|
2019-04-14 04:46:33 -06:00
|
|
|
|
}]
|
|
|
|
|
formats = []
|
|
|
|
|
subtitles = {}
|
|
|
|
|
last_e = None
|
|
|
|
|
for q in TP_SMIL_QUERY:
|
|
|
|
|
q.update(query)
|
|
|
|
|
m_url = update_url_query(smil_url, q)
|
|
|
|
|
m_url = self._sign_url(m_url, self._THEPLATFORM_KEY, self._THEPLATFORM_SECRET)
|
|
|
|
|
try:
|
|
|
|
|
tp_formats, tp_subtitles = self._extract_theplatform_smil(
|
|
|
|
|
m_url, video_id, 'Downloading %s SMIL data' % (q.get('switch') or q['assetTypes']))
|
|
|
|
|
except ExtractorError as e:
|
2021-01-01 05:26:37 -07:00
|
|
|
|
if isinstance(e, GeoRestrictedError):
|
|
|
|
|
raise
|
2019-04-14 04:46:33 -06:00
|
|
|
|
last_e = e
|
|
|
|
|
continue
|
|
|
|
|
formats.extend(tp_formats)
|
|
|
|
|
subtitles = self._merge_subtitles(subtitles, tp_subtitles)
|
|
|
|
|
if last_e and not formats:
|
|
|
|
|
raise last_e
|
|
|
|
|
return {
|
|
|
|
|
'id': video_id,
|
|
|
|
|
'formats': formats,
|
|
|
|
|
'subtitles': subtitles,
|
|
|
|
|
}
|
|
|
|
|
|
2021-01-01 05:26:37 -07:00
|
|
|
|
def _extract_aetn_info(self, domain, filter_key, filter_value, url):
|
|
|
|
|
requestor_id, brand = self._DOMAIN_MAP[domain]
|
|
|
|
|
result = self._download_json(
|
2024-06-11 17:09:58 -06:00
|
|
|
|
f'https://feeds.video.aetnd.com/api/v2/{brand}/videos',
|
|
|
|
|
filter_value, query={f'filter[{filter_key}]': filter_value})
|
2023-05-24 12:00:43 -06:00
|
|
|
|
result = traverse_obj(
|
|
|
|
|
result, ('results',
|
|
|
|
|
lambda k, v: k == 0 and v[filter_key] == filter_value),
|
|
|
|
|
get_all=False)
|
|
|
|
|
if not result:
|
|
|
|
|
raise ExtractorError('Show not found in A&E feed (too new?)', expected=True,
|
|
|
|
|
video_id=remove_start(filter_value, '/'))
|
2021-01-01 05:26:37 -07:00
|
|
|
|
title = result['title']
|
|
|
|
|
video_id = result['id']
|
|
|
|
|
media_url = result['publicUrl']
|
|
|
|
|
theplatform_metadata = self._download_theplatform_metadata(self._search_regex(
|
|
|
|
|
r'https?://link\.theplatform\.com/s/([^?]+)', media_url, 'theplatform_path'), video_id)
|
|
|
|
|
info = self._parse_theplatform_metadata(theplatform_metadata)
|
|
|
|
|
auth = None
|
|
|
|
|
if theplatform_metadata.get('AETN$isBehindWall'):
|
|
|
|
|
resource = self._get_mvpd_resource(
|
|
|
|
|
requestor_id, theplatform_metadata['title'],
|
|
|
|
|
theplatform_metadata.get('AETN$PPL_pplProgramId') or theplatform_metadata.get('AETN$PPL_pplProgramId_OLD'),
|
2024-01-18 14:18:04 -07:00
|
|
|
|
traverse_obj(theplatform_metadata, ('ratings', 0, 'rating')))
|
2021-01-01 05:26:37 -07:00
|
|
|
|
auth = self._extract_mvpd_auth(
|
|
|
|
|
url, video_id, requestor_id, resource)
|
|
|
|
|
info.update(self._extract_aen_smil(media_url, video_id, auth))
|
|
|
|
|
info.update({
|
|
|
|
|
'title': title,
|
|
|
|
|
'series': result.get('seriesName'),
|
|
|
|
|
'season_number': int_or_none(result.get('tvSeasonNumber')),
|
|
|
|
|
'episode_number': int_or_none(result.get('tvSeasonEpisodeNumber')),
|
|
|
|
|
})
|
|
|
|
|
return info
|
|
|
|
|
|
2015-02-14 15:57:52 -07:00
|
|
|
|
|
2016-06-29 08:49:17 -06:00
|
|
|
|
class AENetworksIE(AENetworksBaseIE):
|
2016-01-16 14:02:45 -07:00
|
|
|
|
IE_NAME = 'aenetworks'
|
2018-12-09 02:04:00 -07:00
|
|
|
|
IE_DESC = 'A+E Networks: A&E, Lifetime, History.com, FYI Network and History Vault'
|
2021-01-01 05:26:37 -07:00
|
|
|
|
_VALID_URL = AENetworksBaseIE._BASE_URL_REGEX + r'''(?P<id>
|
|
|
|
|
shows/[^/]+/season-\d+/episode-\d+|
|
|
|
|
|
(?:
|
|
|
|
|
(?:movie|special)s/[^/]+|
|
|
|
|
|
(?:shows/[^/]+/)?videos
|
|
|
|
|
)/[^/?#&]+
|
|
|
|
|
)'''
|
2015-02-14 15:57:52 -07:00
|
|
|
|
_TESTS = [{
|
2016-01-15 07:16:57 -07:00
|
|
|
|
'url': 'http://www.history.com/shows/mountain-men/season-1/episode-1',
|
|
|
|
|
'info_dict': {
|
2016-06-29 08:49:17 -06:00
|
|
|
|
'id': '22253814',
|
2016-01-15 07:16:57 -07:00
|
|
|
|
'ext': 'mp4',
|
2023-12-11 17:00:35 -07:00
|
|
|
|
'title': 'Winter Is Coming',
|
|
|
|
|
'description': 'md5:a40e370925074260b1c8a633c632c63a',
|
2016-04-01 11:06:11 -06:00
|
|
|
|
'timestamp': 1338306241,
|
|
|
|
|
'upload_date': '20120529',
|
|
|
|
|
'uploader': 'AENE-NEW',
|
2023-12-11 17:00:35 -07:00
|
|
|
|
'duration': 2592.0,
|
|
|
|
|
'thumbnail': r're:^https?://.*\.jpe?g$',
|
|
|
|
|
'chapters': 'count:5',
|
|
|
|
|
'tags': 'count:14',
|
|
|
|
|
'categories': ['Mountain Men'],
|
|
|
|
|
'episode_number': 1,
|
|
|
|
|
'episode': 'Episode 1',
|
|
|
|
|
'season': 'Season 1',
|
|
|
|
|
'season_number': 1,
|
|
|
|
|
'series': 'Mountain Men',
|
2016-01-15 07:16:57 -07:00
|
|
|
|
},
|
2019-04-14 04:46:33 -06:00
|
|
|
|
'params': {
|
|
|
|
|
# m3u8 download
|
|
|
|
|
'skip_download': True,
|
|
|
|
|
},
|
2015-02-14 15:57:52 -07:00
|
|
|
|
'add_ie': ['ThePlatform'],
|
2024-06-11 17:09:58 -06:00
|
|
|
|
'skip': 'Geo-restricted - This content is not available in your location.',
|
2016-01-15 08:18:07 -07:00
|
|
|
|
}, {
|
2021-01-01 05:26:37 -07:00
|
|
|
|
'url': 'http://www.aetv.com/shows/duck-dynasty/season-9/episode-1',
|
2016-06-29 08:49:17 -06:00
|
|
|
|
'info_dict': {
|
2021-01-01 05:26:37 -07:00
|
|
|
|
'id': '600587331957',
|
|
|
|
|
'ext': 'mp4',
|
|
|
|
|
'title': 'Inlawful Entry',
|
|
|
|
|
'description': 'md5:57c12115a2b384d883fe64ca50529e08',
|
|
|
|
|
'timestamp': 1452634428,
|
|
|
|
|
'upload_date': '20160112',
|
|
|
|
|
'uploader': 'AENE-NEW',
|
2023-12-11 17:00:35 -07:00
|
|
|
|
'duration': 1277.695,
|
|
|
|
|
'thumbnail': r're:^https?://.*\.jpe?g$',
|
|
|
|
|
'chapters': 'count:4',
|
|
|
|
|
'tags': 'count:23',
|
|
|
|
|
'episode': 'Episode 1',
|
|
|
|
|
'episode_number': 1,
|
|
|
|
|
'season': 'Season 9',
|
|
|
|
|
'season_number': 9,
|
|
|
|
|
'series': 'Duck Dynasty',
|
2016-06-29 08:49:17 -06:00
|
|
|
|
},
|
2021-01-01 05:26:37 -07:00
|
|
|
|
'params': {
|
|
|
|
|
# m3u8 download
|
|
|
|
|
'skip_download': True,
|
2016-06-29 08:49:17 -06:00
|
|
|
|
},
|
2021-01-01 05:26:37 -07:00
|
|
|
|
'add_ie': ['ThePlatform'],
|
2023-05-24 12:00:43 -06:00
|
|
|
|
'skip': 'This video is only available for users of participating TV providers.',
|
2016-01-15 08:18:07 -07:00
|
|
|
|
}, {
|
2016-06-29 08:49:17 -06:00
|
|
|
|
'url': 'http://www.fyi.tv/shows/tiny-house-nation/season-1/episode-8',
|
2024-06-11 17:09:58 -06:00
|
|
|
|
'only_matching': True,
|
2016-01-15 08:18:07 -07:00
|
|
|
|
}, {
|
2016-06-29 08:49:17 -06:00
|
|
|
|
'url': 'http://www.mylifetime.com/shows/project-runway-junior/season-1/episode-6',
|
2024-06-11 17:09:58 -06:00
|
|
|
|
'only_matching': True,
|
2016-06-29 09:55:17 -06:00
|
|
|
|
}, {
|
|
|
|
|
'url': 'http://www.mylifetime.com/movies/center-stage-on-pointe/full-movie',
|
2024-06-11 17:09:58 -06:00
|
|
|
|
'only_matching': True,
|
2017-02-12 05:18:11 -07:00
|
|
|
|
}, {
|
2021-01-01 05:26:37 -07:00
|
|
|
|
'url': 'https://watch.lifetimemovieclub.com/movies/10-year-reunion/full-movie',
|
2024-06-11 17:09:58 -06:00
|
|
|
|
'only_matching': True,
|
2017-04-13 10:39:55 -06:00
|
|
|
|
}, {
|
|
|
|
|
'url': 'http://www.history.com/specials/sniper-into-the-kill-zone/full-special',
|
2024-06-11 17:09:58 -06:00
|
|
|
|
'only_matching': True,
|
2018-12-09 02:04:00 -07:00
|
|
|
|
}, {
|
2021-01-01 05:26:37 -07:00
|
|
|
|
'url': 'https://www.aetv.com/specials/hunting-jonbenets-killer-the-untold-story/preview-hunting-jonbenets-killer-the-untold-story',
|
2024-06-11 17:09:58 -06:00
|
|
|
|
'only_matching': True,
|
2021-01-01 05:26:37 -07:00
|
|
|
|
}, {
|
|
|
|
|
'url': 'http://www.history.com/videos/history-of-valentines-day',
|
2024-06-11 17:09:58 -06:00
|
|
|
|
'only_matching': True,
|
2019-04-14 04:46:33 -06:00
|
|
|
|
}, {
|
2021-01-01 05:26:37 -07:00
|
|
|
|
'url': 'https://play.aetv.com/shows/duck-dynasty/videos/best-of-duck-dynasty-getting-quack-in-shape',
|
2024-06-11 17:09:58 -06:00
|
|
|
|
'only_matching': True,
|
2015-02-14 15:57:52 -07:00
|
|
|
|
}]
|
|
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2021-08-18 19:41:24 -06:00
|
|
|
|
domain, canonical = self._match_valid_url(url).groups()
|
2021-01-01 05:26:37 -07:00
|
|
|
|
return self._extract_aetn_info(domain, 'canonical', '/' + canonical, url)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AENetworksListBaseIE(AENetworksBaseIE):
|
|
|
|
|
def _call_api(self, resource, slug, brand, fields):
|
|
|
|
|
return self._download_json(
|
|
|
|
|
'https://yoga.appsvcs.aetnd.com/graphql',
|
|
|
|
|
slug, query={'brand': brand}, data=urlencode_postdata({
|
|
|
|
|
'query': '''{
|
|
|
|
|
%s(slug: "%s") {
|
|
|
|
|
%s
|
|
|
|
|
}
|
2024-06-11 17:09:58 -06:00
|
|
|
|
}''' % (resource, slug, fields), # noqa: UP031
|
2021-01-01 05:26:37 -07:00
|
|
|
|
}))['data'][resource]
|
|
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2021-08-18 19:41:24 -06:00
|
|
|
|
domain, slug = self._match_valid_url(url).groups()
|
2021-01-01 05:26:37 -07:00
|
|
|
|
_, brand = self._DOMAIN_MAP[domain]
|
|
|
|
|
playlist = self._call_api(self._RESOURCE, slug, brand, self._FIELDS)
|
2024-06-11 17:09:58 -06:00
|
|
|
|
base_url = f'http://watch.{domain}'
|
2021-01-01 05:26:37 -07:00
|
|
|
|
|
|
|
|
|
entries = []
|
|
|
|
|
for item in (playlist.get(self._ITEMS_KEY) or []):
|
|
|
|
|
doc = self._get_doc(item)
|
|
|
|
|
canonical = doc.get('canonical')
|
|
|
|
|
if not canonical:
|
|
|
|
|
continue
|
|
|
|
|
entries.append(self.url_result(
|
|
|
|
|
base_url + canonical, AENetworksIE.ie_key(), doc.get('id')))
|
|
|
|
|
|
|
|
|
|
description = None
|
|
|
|
|
if self._PLAYLIST_DESCRIPTION_KEY:
|
|
|
|
|
description = playlist.get(self._PLAYLIST_DESCRIPTION_KEY)
|
|
|
|
|
|
|
|
|
|
return self.playlist_result(
|
|
|
|
|
entries, playlist.get('id'),
|
|
|
|
|
playlist.get(self._PLAYLIST_TITLE_KEY), description)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AENetworksCollectionIE(AENetworksListBaseIE):
|
|
|
|
|
IE_NAME = 'aenetworks:collection'
|
|
|
|
|
_VALID_URL = AENetworksBaseIE._BASE_URL_REGEX + r'(?:[^/]+/)*(?:list|collections)/(?P<id>[^/?#&]+)/?(?:[?#&]|$)'
|
|
|
|
|
_TESTS = [{
|
|
|
|
|
'url': 'https://watch.historyvault.com/list/america-the-story-of-us',
|
|
|
|
|
'info_dict': {
|
|
|
|
|
'id': '282',
|
|
|
|
|
'title': 'America The Story of Us',
|
|
|
|
|
},
|
|
|
|
|
'playlist_mincount': 12,
|
|
|
|
|
}, {
|
|
|
|
|
'url': 'https://watch.historyvault.com/shows/america-the-story-of-us-2/season-1/list/america-the-story-of-us',
|
2024-06-11 17:09:58 -06:00
|
|
|
|
'only_matching': True,
|
2021-01-01 05:26:37 -07:00
|
|
|
|
}, {
|
|
|
|
|
'url': 'https://www.historyvault.com/collections/mysteryquest',
|
2024-06-11 17:09:58 -06:00
|
|
|
|
'only_matching': True,
|
2021-01-01 05:26:37 -07:00
|
|
|
|
}]
|
|
|
|
|
_RESOURCE = 'list'
|
|
|
|
|
_ITEMS_KEY = 'items'
|
|
|
|
|
_PLAYLIST_TITLE_KEY = 'display_title'
|
|
|
|
|
_PLAYLIST_DESCRIPTION_KEY = None
|
|
|
|
|
_FIELDS = '''id
|
|
|
|
|
display_title
|
|
|
|
|
items {
|
|
|
|
|
... on ListVideoItem {
|
|
|
|
|
doc {
|
|
|
|
|
canonical
|
|
|
|
|
id
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}'''
|
|
|
|
|
|
|
|
|
|
def _get_doc(self, item):
|
|
|
|
|
return item.get('doc') or {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class AENetworksShowIE(AENetworksListBaseIE):
|
|
|
|
|
IE_NAME = 'aenetworks:show'
|
|
|
|
|
_VALID_URL = AENetworksBaseIE._BASE_URL_REGEX + r'shows/(?P<id>[^/?#&]+)/?(?:[?#&]|$)'
|
|
|
|
|
_TESTS = [{
|
|
|
|
|
'url': 'http://www.history.com/shows/ancient-aliens',
|
|
|
|
|
'info_dict': {
|
2021-02-04 00:56:01 -07:00
|
|
|
|
'id': 'SERIES1574',
|
2021-01-01 05:26:37 -07:00
|
|
|
|
'title': 'Ancient Aliens',
|
|
|
|
|
'description': 'md5:3f6d74daf2672ff3ae29ed732e37ea7f',
|
|
|
|
|
},
|
2021-01-16 10:12:05 -07:00
|
|
|
|
'playlist_mincount': 150,
|
2021-01-01 05:26:37 -07:00
|
|
|
|
}]
|
|
|
|
|
_RESOURCE = 'series'
|
|
|
|
|
_ITEMS_KEY = 'episodes'
|
|
|
|
|
_PLAYLIST_TITLE_KEY = 'title'
|
|
|
|
|
_PLAYLIST_DESCRIPTION_KEY = 'description'
|
|
|
|
|
_FIELDS = '''description
|
|
|
|
|
id
|
|
|
|
|
title
|
|
|
|
|
episodes {
|
|
|
|
|
canonical
|
|
|
|
|
id
|
|
|
|
|
}'''
|
|
|
|
|
|
|
|
|
|
def _get_doc(self, item):
|
|
|
|
|
return item
|
2015-02-14 15:57:52 -07:00
|
|
|
|
|
|
|
|
|
|
2016-06-29 08:49:17 -06:00
|
|
|
|
class HistoryTopicIE(AENetworksBaseIE):
|
|
|
|
|
IE_NAME = 'history:topic'
|
|
|
|
|
IE_DESC = 'History.com Topic'
|
2019-04-14 04:46:33 -06:00
|
|
|
|
_VALID_URL = r'https?://(?:www\.)?history\.com/topics/[^/]+/(?P<id>[\w+-]+?)-video'
|
2016-06-29 08:49:17 -06:00
|
|
|
|
_TESTS = [{
|
2019-04-14 04:46:33 -06:00
|
|
|
|
'url': 'https://www.history.com/topics/valentines-day/history-of-valentines-day-video',
|
2016-06-29 08:49:17 -06:00
|
|
|
|
'info_dict': {
|
|
|
|
|
'id': '40700995724',
|
|
|
|
|
'ext': 'mp4',
|
2024-06-11 17:09:58 -06:00
|
|
|
|
'title': 'History of Valentine’s Day',
|
2016-06-29 08:49:17 -06:00
|
|
|
|
'description': 'md5:7b57ea4829b391995b405fa60bd7b5f7',
|
|
|
|
|
'timestamp': 1375819729,
|
|
|
|
|
'upload_date': '20130806',
|
2021-01-01 05:26:37 -07:00
|
|
|
|
'uploader': 'AENE-NEW',
|
2016-06-29 08:49:17 -06:00
|
|
|
|
},
|
|
|
|
|
'params': {
|
|
|
|
|
# m3u8 download
|
|
|
|
|
'skip_download': True,
|
|
|
|
|
},
|
|
|
|
|
'add_ie': ['ThePlatform'],
|
|
|
|
|
}]
|
|
|
|
|
|
2021-01-01 05:26:37 -07:00
|
|
|
|
def _real_extract(self, url):
|
|
|
|
|
display_id = self._match_id(url)
|
|
|
|
|
return self.url_result(
|
|
|
|
|
'http://www.history.com/videos/' + display_id,
|
|
|
|
|
AENetworksIE.ie_key())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class HistoryPlayerIE(AENetworksBaseIE):
|
|
|
|
|
IE_NAME = 'history:player'
|
|
|
|
|
_VALID_URL = r'https?://(?:www\.)?(?P<domain>(?:history|biography)\.com)/player/(?P<id>\d+)'
|
2023-05-24 12:00:43 -06:00
|
|
|
|
_TESTS = []
|
2021-01-01 05:26:37 -07:00
|
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
2021-08-18 19:41:24 -06:00
|
|
|
|
domain, video_id = self._match_valid_url(url).groups()
|
2021-01-01 05:26:37 -07:00
|
|
|
|
return self._extract_aetn_info(domain, 'id', video_id, url)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class BiographyIE(AENetworksBaseIE):
|
|
|
|
|
_VALID_URL = r'https?://(?:www\.)?biography\.com/video/(?P<id>[^/?#&]+)'
|
|
|
|
|
_TESTS = [{
|
|
|
|
|
'url': 'https://www.biography.com/video/vincent-van-gogh-full-episode-2075049808',
|
|
|
|
|
'info_dict': {
|
|
|
|
|
'id': '30322987',
|
|
|
|
|
'ext': 'mp4',
|
|
|
|
|
'title': 'Vincent Van Gogh - Full Episode',
|
|
|
|
|
'description': 'A full biography about the most influential 20th century painter, Vincent Van Gogh.',
|
|
|
|
|
'timestamp': 1311970571,
|
|
|
|
|
'upload_date': '20110729',
|
|
|
|
|
'uploader': 'AENE-NEW',
|
|
|
|
|
},
|
|
|
|
|
'params': {
|
|
|
|
|
# m3u8 download
|
|
|
|
|
'skip_download': True,
|
|
|
|
|
},
|
|
|
|
|
'add_ie': ['ThePlatform'],
|
2023-10-06 17:56:19 -06:00
|
|
|
|
'skip': '404 Not Found',
|
2021-01-01 05:26:37 -07:00
|
|
|
|
}]
|
2016-07-02 14:20:59 -06:00
|
|
|
|
|
2016-06-29 08:49:17 -06:00
|
|
|
|
def _real_extract(self, url):
|
2019-04-14 04:46:33 -06:00
|
|
|
|
display_id = self._match_id(url)
|
|
|
|
|
webpage = self._download_webpage(url, display_id)
|
2021-01-01 05:26:37 -07:00
|
|
|
|
player_url = self._search_regex(
|
2024-06-11 17:09:58 -06:00
|
|
|
|
rf'<phoenix-iframe[^>]+src="({HistoryPlayerIE._VALID_URL})',
|
2021-01-01 05:26:37 -07:00
|
|
|
|
webpage, 'player URL')
|
|
|
|
|
return self.url_result(player_url, HistoryPlayerIE.ie_key())
|