]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/aol.py
b51eafc45928f8e6ff4ce571763593f71b715583
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
8 class AolIE(InfoExtractor
):
16 playlist/(?P<playlist_display_id>[^/?#]+?)-(?P<playlist_id>[0-9]+)[?#].*_videoid=
24 'url': 'http://on.aol.com/video/u-s--official-warns-of-largest-ever-irs-phone-scam-518167793?icid=OnHomepageC2Wide_MustSee_Img',
25 'md5': '18ef68f48740e86ae94b98da815eec42',
29 'title': 'U.S. Official Warns Of \'Largest Ever\' IRS Phone Scam',
31 'add_ie': ['FiveMin'],
33 'url': 'http://on.aol.com/playlist/brace-yourself---todays-weirdest-news-152147?icid=OnHomepageC4_Omg_Img#_videoid=518184316',
36 'title': 'Brace Yourself - Today\'s Weirdest News',
38 'playlist_mincount': 10,
41 def _real_extract(self
, url
):
42 mobj
= re
.match(self
._VALID
_URL
, url
)
43 video_id
= mobj
.group('id')
44 playlist_id
= mobj
.group('playlist_id')
45 if not playlist_id
or self
._downloader
.params
.get('noplaylist'):
46 return self
.url_result('5min:%s' % video_id
)
48 self
.to_screen('Downloading playlist %s - add --no-playlist to just download video %s' % (playlist_id
, video_id
))
50 webpage
= self
._download
_webpage
(url
, playlist_id
)
51 title
= self
._html
_search
_regex
(
52 r
'<h1 class="video-title[^"]*">(.+?)</h1>', webpage
, 'title')
53 playlist_html
= self
._search
_regex
(
54 r
"(?s)<ul\s+class='video-related[^']*'>(.*?)</ul>", webpage
,
58 'url': 'aol-video:%s' % m
.group('id'),
60 } for m
in re
.finditer(
61 r
"<a\s+href='.*videoid=(?P<id>[0-9]+)'\s+class='video-thumb'>",
67 'display_id': mobj
.group('playlist_display_id'),