]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/aenetworks.py
1bbfe264177dab80c6e40009e8543e52600c3d9d
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',
25 'timestamp': 1375819729,
26 'upload_date': '20130806',
27 'uploader': 'AENE-NEW',
31 'skip_download': True,
33 'add_ie': ['ThePlatform'],
34 'expected_warnings': ['JSON-LD'],
36 'url': 'http://www.history.com/shows/mountain-men/season-1/episode-1',
37 'md5': '8ff93eb073449f151d6b90c0ae1ef0c7',
41 'title': 'Winter Is Coming',
42 'description': 'md5:641f424b7a19d8e24f26dea22cf59d74',
43 'timestamp': 1338306241,
44 'upload_date': '20120529',
45 'uploader': 'AENE-NEW',
47 'add_ie': ['ThePlatform'],
49 'url': 'http://www.aetv.com/shows/duck-dynasty/video/inlawful-entry',
52 'url': 'http://www.fyi.tv/shows/tiny-house-nation/videos/207-sq-ft-minnesota-prairie-cottage',
55 'url': 'http://www.mylifetime.com/shows/project-runway-junior/video/season-1/episode-6/superstar-clients',
59 def _real_extract(self
, url
):
60 page_type
, video_id
= re
.match(self
._VALID
_URL
, url
).groups()
62 webpage
= self
._download
_webpage
(url
, video_id
)
65 r
'data-href="[^"]*/%s"[^>]+data-release-url="([^"]+)"' % video_id
,
66 r
"media_url\s*=\s*'([^']+)'"
68 video_url
= unescapeHTML(self
._search
_regex
(video_url_re
, webpage
, 'video url'))
69 query
= {'mbr': 'true'}
70 if page_type
== 'shows':
71 query
['assetTypes'] = 'medium_video_s3'
72 if 'switch=hds' in video_url
:
73 query
['switch'] = 'hls'
75 info
= self
._search
_json
_ld
(webpage
, video_id
, fatal
=False)
77 '_type': 'url_transparent',
79 update_url_query(video_url
, query
),
84 'force_smil_url': True