]> jfr.im git - yt-dlp.git/blame - youtube_dl/extractor/ae.py
[compat] Clarify the versions requiring compat_kwargs
[yt-dlp.git] / youtube_dl / extractor / ae.py
CommitLineData
b9c7a973
S
1from __future__ import unicode_literals
2
3from .common import InfoExtractor
4from ..utils import smuggle_url
5
6
587dfd44 7class AEIE(InfoExtractor):
a78d6a9b 8 _VALID_URL = r'https?://(?:www\.)?(?:(?:history|aetv|mylifetime)\.com|fyi\.tv)/(?:[^/]+/)+(?P<id>[^/]+?)(?:$|[?#])'
b9c7a973
S
9
10 _TESTS = [{
11 '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',
b9c7a973 12 'info_dict': {
52767c1b 13 'id': 'g12m5Gyt3fdR',
b9c7a973
S
14 'ext': 'mp4',
15 'title': "Bet You Didn't Know: Valentine's Day",
16 'description': 'md5:7b57ea4829b391995b405fa60bd7b5f7',
17 },
52767c1b 18 'params': {
19 # m3u8 download
20 'skip_download': True,
21 },
22 'add_ie': ['ThePlatform'],
1358b941 23 'expected_warnings': ['JSON-LD'],
52767c1b 24 }, {
25 'url': 'http://www.history.com/shows/mountain-men/season-1/episode-1',
26 'info_dict': {
27 'id': 'eg47EERs_JsZ',
28 'ext': 'mp4',
29 'title': "Winter Is Coming",
1358b941 30 'description': 'md5:641f424b7a19d8e24f26dea22cf59d74',
52767c1b 31 },
32 'params': {
33 # m3u8 download
34 'skip_download': True,
35 },
b9c7a973 36 'add_ie': ['ThePlatform'],
587dfd44 37 }, {
38 'url': 'http://www.aetv.com/shows/duck-dynasty/video/inlawful-entry',
39 'only_matching': True
40 }, {
41 'url': 'http://www.fyi.tv/shows/tiny-house-nation/videos/207-sq-ft-minnesota-prairie-cottage',
42 'only_matching': True
43 }, {
44 'url': 'http://www.mylifetime.com/shows/project-runway-junior/video/season-1/episode-6/superstar-clients',
45 'only_matching': True
b9c7a973
S
46 }]
47
48 def _real_extract(self, url):
49 video_id = self._match_id(url)
50
51 webpage = self._download_webpage(url, video_id)
52
52767c1b 53 video_url_re = [
fad7a336 54 r'data-href="[^"]*/%s"[^>]+data-release-url="([^"]+)"' % video_id,
52767c1b 55 r"media_url\s*=\s*'([^']+)'"
56 ]
57 video_url = self._search_regex(video_url_re, webpage, 'video url')
b9c7a973 58
b4e44234
S
59 info = self._search_json_ld(webpage, video_id, fatal=False)
60 info.update({
61 '_type': 'url_transparent',
62 'url': smuggle_url(video_url, {'sig': {'key': 'crazyjava', 'secret': 's3cr3t'}}),
63 })
64 return info