3 from .common
import InfoExtractor
9 class AlJazeeraIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?P<base>\w+\.aljazeera\.\w+)/(?P<type>programs?/[^/]+|(?:feature|video|new)s)?/\d{4}/\d{1,2}/\d{1,2}/(?P<id>[^/?&#]+)'
13 'url': 'https://balkans.aljazeera.net/videos/2021/11/6/pojedini-domovi-u-sarajevu-jos-pod-vodom-mjestanima-se-dostavlja-hrana',
15 'id': '6280641530001',
17 'title': 'Pojedini domovi u Sarajevu još pod vodom, mještanima se dostavlja hrana',
18 'timestamp': 1636219149,
19 'description': 'U sarajevskim naseljima Rajlovac i Reljevo stambeni objekti, ali i industrijska postrojenja i dalje su pod vodom.',
20 'upload_date': '20211106',
23 'url': 'https://balkans.aljazeera.net/videos/2021/11/6/djokovic-usao-u-finale-mastersa-u-parizu',
25 'id': '6280654936001',
27 'title': 'Đoković ušao u finale Mastersa u Parizu',
28 'timestamp': 1636221686,
29 'description': 'Novak Đoković je u polufinalu Mastersa u Parizu nakon preokreta pobijedio Poljaka Huberta Hurkacza.',
30 'upload_date': '20211106',
33 BRIGHTCOVE_URL_RE
= r
'https?://players.brightcove.net/(?P<account>\d+)/(?P<player_id>[a-zA-Z0-9]+)_(?P<embed>[^/]+)/index.html\?videoId=(?P<id>\d+)'
35 def _real_extract(self
, url
):
36 base
, post_type
, display_id
= self
._match
_valid
_url
(url
).groups()
38 'balkans.aljazeera.net': 'ajb',
39 'chinese.aljazeera.net': 'chinese',
40 'mubasher.aljazeera.net': 'ajm',
45 'programs': 'episode',
48 }[post_type
.split('/')[0]]
49 video
= self
._download
_json
(
50 f
'https://{base}/graphql', display_id
, query
={
52 'operationName': 'ArchipelagoSingleArticleQuery',
53 'variables': json
.dumps({
55 'postType': post_type
,
60 video
= try_get(video
, lambda x
: x
['data']['article']['video']) or {}
61 video_id
= video
.get('id')
62 account
= video
.get('accountId') or '911432371001'
63 player_id
= video
.get('playerId') or 'csvTfAlKW'
67 webpage
= self
._download
_webpage
(url
, display_id
)
69 account
, player_id
, embed
, video_id
= self
._search
_regex
(self
.BRIGHTCOVE_URL_RE
, webpage
, 'video id',
70 group
=(1, 2, 3, 4), default
=(None, None, None, None))
74 '_type': 'url_transparent',
80 '_type': 'url_transparent',
81 'url': f
'https://players.brightcove.net/{account}/{player_id}_{embed}/index.html?videoId={video_id}',
82 'ie_key': 'BrightcoveNew',