3 from .common
import InfoExtractor
10 class N1InfoAssetIE(InfoExtractor
):
11 _VALID_URL
= r
'https?://best-vod\.umn\.cdn\.united\.cloud/stream\?asset=(?P<id>[^&]+)'
13 'url': 'https://best-vod.umn.cdn.united.cloud/stream?asset=ljsottomazilirija3060921-n1info-si-worldwide&stream=hp1400&t=0&player=m3u8v&sp=n1info&u=n1info&p=n1Sh4redSecre7iNf0',
14 'md5': '28b08b32aeaff2b8562736ccd5a66fe7',
16 'id': 'ljsottomazilirija3060921-n1info-si-worldwide',
18 'title': 'ljsottomazilirija3060921-n1info-si-worldwide',
22 def _real_extract(self
, url
):
23 video_id
= self
._match
_id
(url
)
24 formats
= self
._extract
_m
3u8_formats
(
25 url
, video_id
, 'mp4', entry_protocol
='m3u8_native', m3u8_id
='hls', fatal
=False)
34 class N1InfoIIE(InfoExtractor
):
35 IE_NAME
= 'N1Info:article'
36 _VALID_URL
= r
'https?://(?:(?:\w+\.)?n1info\.\w+|nova\.rs)/(?:[^/?#]+/){1,2}(?P<id>[^/?#]+)'
39 'url': 'https://rs.n1info.com/sport-klub/tenis/kako-je-djokovic-propustio-istorijsku-priliku-video/',
40 'md5': '01ddb6646d0fd9c4c7d990aa77fe1c5a',
44 'upload_date': '20210913',
45 'title': 'Ozmo i USO21, ep. 13: Novak Đoković – Danil Medvedev | Ključevi Poraza, Budućnost | SPORT KLUB TENIS',
46 'description': 'md5:467f330af1effedd2e290f10dc31bb8e',
47 'uploader': 'Sport Klub',
48 'uploader_id': 'sportklub',
51 'url': 'https://rs.n1info.com/vesti/djilas-los-plan-za-metro-nece-resiti-nijedan-saobracajni-problem/',
53 'id': 'bgmetrosot2409zta20210924174316682-n1info-rs-worldwide',
55 'title': 'Đilas: Predlog izgradnje metroa besmislen; SNS odbacuje navode',
56 'upload_date': '20210924',
57 'timestamp': 1632481347,
60 'skip_download': True,
63 'url': 'https://n1info.si/novice/slovenija/zadnji-dnevi-na-kopaliscu-ilirija-ilirija-ni-umrla-ubili-so-jo/',
65 'id': 'ljsottomazilirija3060921-n1info-si-worldwide',
67 'title': 'Zadnji dnevi na kopališču Ilirija: “Ilirija ni umrla, ubili so jo”',
68 'timestamp': 1632567630,
69 'upload_date': '20210925',
72 'skip_download': True,
76 'url': 'https://ba.n1info.com/lifestyle/vucic-bolji-od-tita-ako-izgubi-ja-cu-da-crknem-jugoslavija-je-gotova/',
78 'id': '2wmfee9eycp71',
80 'title': '"Ako Vučić izgubi izbore, ja ću da crknem, Jugoslavija je gotova"',
81 'upload_date': '20210924',
82 'timestamp': 1632448649.0,
83 'uploader': 'YouLotWhatDontStop',
86 'skip_download': True,
89 'url': 'https://nova.rs/vesti/politika/zaklina-tatalovic-ani-brnabic-pricate-lazi-video/',
91 'id': 'tnjganabrnabicizaklinatatalovic100danavladegp-novas-worldwide',
93 'title': 'Žaklina Tatalović Ani Brnabić: Pričate laži (VIDEO)',
94 'upload_date': '20211102',
95 'timestamp': 1635861677,
98 'url': 'https://n1info.rs/vesti/cuta-biti-u-kosovskoj-mitrovici-znaci-da-te-docekaju-eksplozivnim-napravama/',
102 'title': 'Ćuta: Biti u Kosovskoj Mitrovici znači da te dočekaju eksplozivnim napravama',
103 'upload_date': '20230620',
104 'timestamp': 1687290536,
105 'thumbnail': 'https://cdn.brid.tv/live/partners/26827/snapshot/1332368_th_6492013a8356f_1687290170.jpg',
108 'url': 'https://hr.n1info.com/vijesti/pravobraniteljica-o-ubojstvu-u-zagrebu-radi-se-o-doista-nezapamcenoj-situaciji/',
109 'only_matching': True,
112 def _real_extract(self
, url
):
113 video_id
= self
._match
_id
(url
)
114 webpage
= self
._download
_webpage
(url
, video_id
)
116 title
= self
._html
_search
_regex
(r
'<h1[^>]+>(.+?)</h1>', webpage
, 'title')
117 timestamp
= unified_timestamp(self
._html
_search
_meta
('article:published_time', webpage
))
118 plugin_data
= self
._html
_search
_meta
('BridPlugin', webpage
)
121 site_id
= self
._html
_search
_regex
(r
'site:(\d+)', webpage
, 'site id')
122 for video_data
in re
.findall(r
'\$bp\("Brid_\d+", (.+)\);', webpage
):
123 video_id
= self
._parse
_json
(video_data
, title
)['video']
127 'timestamp': timestamp
,
128 'thumbnail': self
._html
_search
_meta
('thumbnailURL', webpage
),
129 'formats': self
._extract
_m
3u8_formats
(
130 f
'https://cdn-uc.brid.tv/live/partners/{site_id}/streaming/{video_id}/{video_id}.m3u8',
131 video_id
, fatal
=False),
134 # Old player still present in older articles
135 videos
= re
.findall(r
'(?m)(<video[^>]+>)', webpage
)
137 video_data
= extract_attributes(video
)
139 '_type': 'url_transparent',
140 'url': video_data
.get('data-url'),
141 'id': video_data
.get('id'),
143 'thumbnail': video_data
.get('data-thumbnail'),
144 'timestamp': timestamp
,
145 'ie_key': 'N1InfoAsset',
148 embedded_videos
= re
.findall(r
'(<iframe[^>]+>)', webpage
)
149 for embedded_video
in embedded_videos
:
150 video_data
= extract_attributes(embedded_video
)
151 url
= video_data
.get('src') or ''
152 if url
.startswith('https://www.youtube.com'):
153 entries
.append(self
.url_result(url
, ie
='Youtube'))
154 elif url
.startswith('https://www.redditmedia.com'):
155 entries
.append(self
.url_result(url
, ie
='RedditR'))
161 'timestamp': timestamp
,