]>
Commit | Line | Data |
---|---|---|
d5fd9a3b S |
1 | from .common import InfoExtractor |
2 | ||
3 | ||
4 | class SkylineWebcamsIE(InfoExtractor): | |
5 | _VALID_URL = r'https?://(?:www\.)?skylinewebcams\.com/[^/]+/webcam/(?:[^/]+/)+(?P<id>[^/]+)\.html' | |
6 | _TEST = { | |
7 | 'url': 'https://www.skylinewebcams.com/it/webcam/italia/lazio/roma/scalinata-piazza-di-spagna-barcaccia.html', | |
8 | 'info_dict': { | |
9 | 'id': 'scalinata-piazza-di-spagna-barcaccia', | |
10 | 'ext': 'mp4', | |
11 | '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}$', | |
12 | 'description': 'Roma, veduta sulla Scalinata di Piazza di Spagna e sulla Barcaccia', | |
13 | 'is_live': True, | |
14 | }, | |
15 | 'params': { | |
16 | 'skip_download': True, | |
17 | } | |
18 | } | |
19 | ||
20 | def _real_extract(self, url): | |
21 | video_id = self._match_id(url) | |
22 | ||
23 | webpage = self._download_webpage(url, video_id) | |
24 | ||
25 | stream_url = self._search_regex( | |
10026329 | 26 | r'(?:url|source)\s*:\s*(["\'])(?P<url>(?:https?:)?//.+?\.m3u8.*?)\1', webpage, |
d5fd9a3b S |
27 | 'stream url', group='url') |
28 | ||
29 | title = self._og_search_title(webpage) | |
30 | description = self._og_search_description(webpage) | |
31 | ||
32 | return { | |
33 | 'id': video_id, | |
34 | 'url': stream_url, | |
35 | 'ext': 'mp4', | |
39ca3b5c | 36 | 'title': title, |
d5fd9a3b S |
37 | 'description': description, |
38 | 'is_live': True, | |
39 | } |