1 from __future__ import unicode_literals
5 from .common import InfoExtractor
13 class AENetworksIE(InfoExtractor):
14 IE_NAME = 'aenetworks'
15 IE_DESC = 'A+E Networks: A&E, Lifetime, History.com, FYI Network'
16 _VALID_URL = r'https?://(?:www\.)?(?:(?:history|aetv|mylifetime)\.com|fyi\.tv)/(?P<type>[^/]+)/(?:[^/]+/)+(?P<id>[^/]+?)(?:$|[?#])'
19 'url': 'http://www.history.com/topics/valentines-day/history-of-valentines-day/videos/bet-you-didnt-know-valentines-day?m=528e394da93ae&s=undefined&f=1&free=false',
23 'title': "Bet You Didn't Know: Valentine's Day",
24 'description': 'md5:7b57ea4829b391995b405fa60bd7b5f7',
28 'skip_download': True,
30 'add_ie': ['ThePlatform'],
31 'expected_warnings': ['JSON-LD'],
33 'url': 'http://www.history.com/shows/mountain-men/season-1/episode-1',
34 'md5': '8ff93eb073449f151d6b90c0ae1ef0c7',
38 'title': 'Winter Is Coming',
39 'description': 'md5:641f424b7a19d8e24f26dea22cf59d74',
41 'add_ie': ['ThePlatform'],
43 'url': 'http://www.aetv.com/shows/duck-dynasty/video/inlawful-entry',
46 'url': 'http://www.fyi.tv/shows/tiny-house-nation/videos/207-sq-ft-minnesota-prairie-cottage',
49 'url': 'http://www.mylifetime.com/shows/project-runway-junior/video/season-1/episode-6/superstar-clients',
53 def _real_extract(self, url):
54 page_type, video_id = re.match(self._VALID_URL, url).groups()
56 webpage = self._download_webpage(url, video_id)
59 r'data-href="[^"]*/%s"[^>]+data-release-url="([^"]+)"' % video_id,
60 r"media_url\s*=\s*'([^']+)'"
62 video_url = unescapeHTML(self._search_regex(video_url_re, webpage, 'video url'))
63 query = {'mbr': 'true'}
64 if page_type == 'shows':
65 query['assetTypes'] = 'medium_video_s3'
66 if 'switch=hds' in video_url:
67 query['switch'] = 'hls'
69 info = self._search_json_ld(webpage, video_id, fatal=False)
71 '_type': 'url_transparent',
72 'url': smuggle_url(update_url_query(
77 'force_smil_url': True