]> git.bitcoin.ninja Git - youtube-dl/blob - youtube_dl/extractor/aol.py
[auroravid] Add extractor (Closes #9070)
[youtube-dl] / youtube_dl / extractor / aol.py
1 from __future__ import unicode_literals
2
3 from .common import InfoExtractor
4
5
6 class AolIE(InfoExtractor):
7     IE_NAME = 'on.aol.com'
8     _VALID_URL = r'(?:aol-video:|https?://on\.aol\.com/video/.*-)(?P<id>[0-9]+)(?:$|\?)'
9
10     _TESTS = [{
11         'url': 'http://on.aol.com/video/u-s--official-warns-of-largest-ever-irs-phone-scam-518167793?icid=OnHomepageC2Wide_MustSee_Img',
12         'md5': '18ef68f48740e86ae94b98da815eec42',
13         'info_dict': {
14             'id': '518167793',
15             'ext': 'mp4',
16             'title': 'U.S. Official Warns Of \'Largest Ever\' IRS Phone Scam',
17         },
18         'add_ie': ['FiveMin'],
19     }]
20
21     def _real_extract(self, url):
22         video_id = self._match_id(url)
23         return self.url_result('5min:%s' % video_id)
24
25
26 class AolFeaturesIE(InfoExtractor):
27     IE_NAME = 'features.aol.com'
28     _VALID_URL = r'https?://features\.aol\.com/video/(?P<id>[^/?#]+)'
29
30     _TESTS = [{
31         'url': 'http://features.aol.com/video/behind-secret-second-careers-late-night-talk-show-hosts',
32         'md5': '7db483bb0c09c85e241f84a34238cc75',
33         'info_dict': {
34             'id': '519507715',
35             'ext': 'mp4',
36             'title': 'What To Watch - February 17, 2016',
37         },
38         'add_ie': ['FiveMin'],
39     }]
40
41     def _real_extract(self, url):
42         display_id = self._match_id(url)
43         webpage = self._download_webpage(url, display_id)
44         return self.url_result(self._search_regex(
45             r'<script type="text/javascript" src="(https?://[^/]*?5min\.com/Scripts/PlayerSeed\.js[^"]+)"',
46             webpage, '5min embed url'), 'FiveMin')