]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/aol.py
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
6 from .fivemin
import FiveMinIE
9 class AolIE(InfoExtractor
):
10 IE_NAME
= 'on.aol.com'
17 playlist/(?P<playlist_display_id>[^/?#]+?)-(?P<playlist_id>[0-9]+)[?#].*_videoid=
25 'url': 'http://on.aol.com/video/u-s--official-warns-of-largest-ever-irs-phone-scam-518167793?icid=OnHomepageC2Wide_MustSee_Img',
26 'md5': '18ef68f48740e86ae94b98da815eec42',
30 'title': 'U.S. Official Warns Of \'Largest Ever\' IRS Phone Scam',
32 'add_ie': ['FiveMin'],
34 'url': 'http://on.aol.com/playlist/brace-yourself---todays-weirdest-news-152147?icid=OnHomepageC4_Omg_Img#_videoid=518184316',
37 'title': 'Brace Yourself - Today\'s Weirdest News',
39 'playlist_mincount': 10,
42 def _real_extract(self
, url
):
43 mobj
= re
.match(self
._VALID
_URL
, url
)
44 video_id
= mobj
.group('id')
46 playlist_id
= mobj
.group('playlist_id')
47 if playlist_id
and not self
._downloader
.params
.get('noplaylist'):
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'),
72 return FiveMinIE
._build
_result
(video_id
)