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