3 from .common
import InfoExtractor
6 class WebcameraplIE(InfoExtractor
):
7 _VALID_URL
= r
'https?://(?P<id>[\w-]+)\.webcamera\.pl'
9 'url': 'https://warszawa-plac-zamkowy.webcamera.pl',
11 'id': 'warszawa-plac-zamkowy',
13 'title': r
're:WIDOK NA PLAC ZAMKOWY W WARSZAWIE \d{4}-\d{2}-\d{2} \d{2}:\d{2}$',
14 'live_status': 'is_live',
17 'url': 'https://gdansk-stare-miasto.webcamera.pl/',
19 'id': 'gdansk-stare-miasto',
21 'title': r
're:GDAĆSK - widok na Stare Miasto \d{4}-\d{2}-\d{2} \d{2}:\d{2}$',
22 'live_status': 'is_live',
26 def _real_extract(self
, url
):
27 video_id
= self
._match
_id
(url
)
28 webpage
= self
._download
_webpage
(url
, video_id
)
30 rot13_m3u8_url
= self
._search
_regex
(r
'data-src\s*=\s*"(uggc[^"]+\.z3h8)"',
31 webpage
, 'm3u8 url', default
=None)
32 if not rot13_m3u8_url
:
33 self
.raise_no_formats('No video/audio found at the provided url', expected
=True)
35 m3u8_url
= codecs
.decode(rot13_m3u8_url
, 'rot-13')
36 formats
, subtitles
= self
._extract
_m
3u8_formats
_and
_subtitles
(m3u8_url
, video_id
, live
=True)
40 'title': self
._html
_search
_regex
(r
'<h1\b[^>]*>([^>]+)</h1>', webpage
, 'title'),
42 'subtitles': subtitles
,