]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/thesun.py
1 from __future__
import unicode_literals
5 from .common
import InfoExtractor
6 from .ooyala
import OoyalaIE
9 class TheSunIE(InfoExtractor
):
10 _VALID_URL
= r
'https://(?:www\.)?thesun\.co\.uk/[^/]+/(?P<id>\d+)'
12 'url': 'https://www.thesun.co.uk/tvandshowbiz/2261604/orlando-bloom-and-katy-perry-post-adorable-instagram-video-together-celebrating-thanksgiving-after-split-rumours/',
15 'title': 'md5:cba22f48bad9218b64d5bbe0e16afddf',
20 def _real_extract(self
, url
):
21 article_id
= self
._match
_id
(url
)
23 webpage
= self
._download
_webpage
(url
, article_id
)
26 for ooyala_id
in re
.findall(
27 r
'<[^>]+\b(?:id\s*=\s*"thesun-ooyala-player-|data-content-id\s*=\s*")([^"]+)',
29 entries
.append(OoyalaIE
._build
_url
_result
(ooyala_id
))
31 return self
.playlist_result(
32 entries
, article_id
, self
._og
_search
_title
(webpage
, fatal
=False))