]> jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/skylinewebcams.py
[ie/orf:on] Improve extraction (#9677)
[yt-dlp.git] / yt_dlp / extractor / skylinewebcams.py
1 from .common import InfoExtractor
2
3
4 class SkylineWebcamsIE(InfoExtractor):
5 _WORKING = False
6 _VALID_URL = r'https?://(?:www\.)?skylinewebcams\.com/[^/]+/webcam/(?:[^/]+/)+(?P<id>[^/]+)\.html'
7 _TEST = {
8 'url': 'https://www.skylinewebcams.com/it/webcam/italia/lazio/roma/scalinata-piazza-di-spagna-barcaccia.html',
9 'info_dict': {
10 'id': 'scalinata-piazza-di-spagna-barcaccia',
11 'ext': 'mp4',
12 'title': 're:^Live Webcam Scalinata di Piazza di Spagna - La Barcaccia [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
13 'description': 'Roma, veduta sulla Scalinata di Piazza di Spagna e sulla Barcaccia',
14 'is_live': True,
15 },
16 'params': {
17 'skip_download': True,
18 }
19 }
20
21 def _real_extract(self, url):
22 video_id = self._match_id(url)
23
24 webpage = self._download_webpage(url, video_id)
25
26 stream_url = self._search_regex(
27 r'(?:url|source)\s*:\s*(["\'])(?P<url>(?:https?:)?//.+?\.m3u8.*?)\1', webpage,
28 'stream url', group='url')
29
30 title = self._og_search_title(webpage)
31 description = self._og_search_description(webpage)
32
33 return {
34 'id': video_id,
35 'url': stream_url,
36 'ext': 'mp4',
37 'title': title,
38 'description': description,
39 'is_live': True,
40 }