]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/thesun.py
3 from .common
import InfoExtractor
4 from ..utils
import extract_attributes
7 class TheSunIE(InfoExtractor
):
8 _VALID_URL
= r
'https://(?:www\.)?thesun\.co\.uk/[^/]+/(?P<id>\d+)'
10 'url': 'https://www.thesun.co.uk/tvandshowbiz/2261604/orlando-bloom-and-katy-perry-post-adorable-instagram-video-together-celebrating-thanksgiving-after-split-rumours/',
13 'title': 'md5:cba22f48bad9218b64d5bbe0e16afddf',
17 BRIGHTCOVE_URL_TEMPLATE
= 'http://players.brightcove.net/%s/default_default/index.html?videoId=%s'
19 def _real_extract(self
, url
):
20 article_id
= self
._match
_id
(url
)
22 webpage
= self
._download
_webpage
(url
, article_id
)
25 for video
in re
.findall(
26 r
'<video[^>]+data-video-id-pending=[^>]+>',
28 attrs
= extract_attributes(video
)
29 video_id
= attrs
['data-video-id-pending']
30 account_id
= attrs
.get('data-account', '5067014667001')
31 entries
.append(self
.url_result(
32 self
.BRIGHTCOVE_URL_TEMPLATE
% (account_id
, video_id
),
33 'BrightcoveNew', video_id
))
35 return self
.playlist_result(
36 entries
, article_id
, self
._og
_search
_title
(webpage
, fatal
=False))