X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Faol.py;h=95a99c6b0d567c52b477a1964d9c055d0b0a6b8a;hb=5886b38d73c54239c85c3e0d8e7c1585d1bbb7da;hp=abc668912d0b3b9bbc06b93bfeea7b2d3c09c402;hpb=0f2a2ba14b2cbf4bd8bec0ce32f8d7c27a733c68;p=youtube-dl diff --git a/youtube_dl/extractor/aol.py b/youtube_dl/extractor/aol.py index abc668912..95a99c6b0 100644 --- a/youtube_dl/extractor/aol.py +++ b/youtube_dl/extractor/aol.py @@ -1,16 +1,13 @@ from __future__ import unicode_literals -import re - from .common import InfoExtractor -from .fivemin import FiveMinIE class AolIE(InfoExtractor): IE_NAME = 'on.aol.com' - _VALID_URL = r'http://on\.aol\.com/video/.*-(?P\d+)($|\?)' + _VALID_URL = r'(?:aol-video:|https?://on\.aol\.com/video/.*-)(?P[0-9]+)(?:$|\?)' - _TEST = { + _TESTS = [{ 'url': 'http://on.aol.com/video/u-s--official-warns-of-largest-ever-irs-phone-scam-518167793?icid=OnHomepageC2Wide_MustSee_Img', 'md5': '18ef68f48740e86ae94b98da815eec42', 'info_dict': { @@ -19,10 +16,31 @@ class AolIE(InfoExtractor): 'title': 'U.S. Official Warns Of \'Largest Ever\' IRS Phone Scam', }, 'add_ie': ['FiveMin'], - } + }] + + def _real_extract(self, url): + video_id = self._match_id(url) + return self.url_result('5min:%s' % video_id) + + +class AolFeaturesIE(InfoExtractor): + IE_NAME = 'features.aol.com' + _VALID_URL = r'https?://features\.aol\.com/video/(?P[^/?#]+)' + + _TESTS = [{ + 'url': 'http://features.aol.com/video/behind-secret-second-careers-late-night-talk-show-hosts', + 'md5': '7db483bb0c09c85e241f84a34238cc75', + 'info_dict': { + 'id': '519507715', + 'ext': 'mp4', + 'title': 'What To Watch - February 17, 2016', + }, + 'add_ie': ['FiveMin'], + }] def _real_extract(self, url): - mobj = re.match(self._VALID_URL, url) - video_id = mobj.group('id') - self.to_screen('Downloading 5min.com video %s' % video_id) - return FiveMinIE._build_result(video_id) + display_id = self._match_id(url) + webpage = self._download_webpage(url, display_id) + return self.url_result(self._search_regex( + r'