]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/n1.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
13 class N1InfoAssetIE(InfoExtractor
):
14 _VALID_URL
= r
'https?://best-vod\.umn\.cdn\.united\.cloud/stream\?asset=(?P<id>[^&]+)'
16 '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',
17 'md5': '28b08b32aeaff2b8562736ccd5a66fe7',
19 'id': 'ljsottomazilirija3060921-n1info-si-worldwide',
21 'title': 'ljsottomazilirija3060921-n1info-si-worldwide',
25 def _real_extract(self
, url
):
26 video_id
= self
._match
_id
(url
)
27 formats
= self
._extract
_m
3u8_formats
(
28 url
, video_id
, 'mp4', entry_protocol
='m3u8_native', m3u8_id
='hls', fatal
=False)
30 self
._sort
_formats
(formats
)
39 class N1InfoIIE(InfoExtractor
):
40 IE_NAME
= 'N1Info:article'
41 _VALID_URL
= r
'https?://(?:(?:(?:ba|rs|hr)\.)?n1info\.(?:com|si)|nova\.rs)/(?:[^/]+/){1,2}(?P<id>[^/]+)'
44 'url': 'https://rs.n1info.com/sport-klub/tenis/kako-je-djokovic-propustio-istorijsku-priliku-video/',
45 'md5': '01ddb6646d0fd9c4c7d990aa77fe1c5a',
49 'upload_date': '20210913',
50 'title': 'Ozmo i USO21, ep. 13: Novak Đoković – Danil Medvedev | Ključevi Poraza, Budućnost | SPORT KLUB TENIS',
51 'description': 'md5:467f330af1effedd2e290f10dc31bb8e',
52 'uploader': 'Sport Klub',
53 'uploader_id': 'sportklub',
56 'url': 'https://rs.n1info.com/vesti/djilas-los-plan-za-metro-nece-resiti-nijedan-saobracajni-problem/',
58 'id': 'bgmetrosot2409zta20210924174316682-n1info-rs-worldwide',
60 'title': 'Đilas: Predlog izgradnje metroa besmislen; SNS odbacuje navode',
61 'upload_date': '20210924',
62 'timestamp': 1632481347,
65 'skip_download': True,
68 'url': 'https://n1info.si/novice/slovenija/zadnji-dnevi-na-kopaliscu-ilirija-ilirija-ni-umrla-ubili-so-jo/',
70 'id': 'ljsottomazilirija3060921-n1info-si-worldwide',
72 'title': 'Zadnji dnevi na kopališču Ilirija: “Ilirija ni umrla, ubili so jo”',
73 'timestamp': 1632567630,
74 'upload_date': '20210925',
77 'skip_download': True,
81 'url': 'https://ba.n1info.com/lifestyle/vucic-bolji-od-tita-ako-izgubi-ja-cu-da-crknem-jugoslavija-je-gotova/',
83 'id': '2wmfee9eycp71',
85 'title': '"Ako Vučić izgubi izbore, ja ću da crknem, Jugoslavija je gotova"',
86 'upload_date': '20210924',
87 'timestamp': 1632448649.0,
88 'uploader': 'YouLotWhatDontStop',
91 'format': 'bestvideo',
92 'skip_download': True,
95 'url': 'https://nova.rs/vesti/politika/zaklina-tatalovic-ani-brnabic-pricate-lazi-video/',
97 'id': 'tnjganabrnabicizaklinatatalovic100danavladegp-novas-worldwide',
99 'title': 'Žaklina Tatalović Ani Brnabić: Pričate laži (VIDEO)',
100 'upload_date': '20211102',
101 'timestamp': 1635861677,
104 'url': 'https://hr.n1info.com/vijesti/pravobraniteljica-o-ubojstvu-u-zagrebu-radi-se-o-doista-nezapamcenoj-situaciji/',
105 'only_matching': True,
108 def _real_extract(self
, url
):
109 video_id
= self
._match
_id
(url
)
110 webpage
= self
._download
_webpage
(url
, video_id
)
112 title
= self
._html
_search
_regex
(r
'<h1[^>]+>(.+?)</h1>', webpage
, 'title')
113 timestamp
= unified_timestamp(self
._html
_search
_meta
('article:published_time', webpage
))
115 videos
= re
.findall(r
'(?m)(<video[^>]+>)', webpage
)
118 video_data
= extract_attributes(video
)
120 '_type': 'url_transparent',
121 'url': video_data
.get('data-url'),
122 'id': video_data
.get('id'),
124 'thumbnail': video_data
.get('data-thumbnail'),
125 'timestamp': timestamp
,
126 'ie_key': 'N1InfoAsset'})
128 embedded_videos
= re
.findall(r
'(<iframe[^>]+>)', webpage
)
129 for embedded_video
in embedded_videos
:
130 video_data
= extract_attributes(embedded_video
)
131 url
= video_data
.get('src') or ''
132 if url
.startswith('https://www.youtube.com'):
133 entries
.append(self
.url_result(url
, ie
='Youtube'))
134 elif url
.startswith('https://www.redditmedia.com'):
135 entries
.append(self
.url_result(url
, ie
='RedditR'))
141 'timestamp': timestamp
,