mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-06-28 01:18:30 +00:00
fix and improve extractor
This commit is contained in:
parent
e67d786c7c
commit
b0c6cdc53b
@ -1,17 +1,21 @@
|
|||||||
from .common import InfoExtractor
|
from .common import InfoExtractor
|
||||||
|
from ..utils import int_or_none, urljoin
|
||||||
|
|
||||||
|
|
||||||
class SkylineWebcamsIE(InfoExtractor):
|
class SkylineWebcamsIE(InfoExtractor):
|
||||||
_WORKING = False
|
|
||||||
_VALID_URL = r'https?://(?:www\.)?skylinewebcams\.com/[^/]+/webcam/(?:[^/]+/)+(?P<id>[^/]+)\.html'
|
_VALID_URL = r'https?://(?:www\.)?skylinewebcams\.com/[^/]+/webcam/(?:[^/]+/)+(?P<id>[^/]+)\.html'
|
||||||
_TEST = {
|
_TEST = {
|
||||||
'url': 'https://www.skylinewebcams.com/it/webcam/italia/lazio/roma/scalinata-piazza-di-spagna-barcaccia.html',
|
'url': 'https://www.skylinewebcams.com/en/webcam/espana/comunidad-valenciana/alicante/benidorm-playa-levante.html',
|
||||||
'info_dict': {
|
'info_dict': {
|
||||||
'id': 'scalinata-piazza-di-spagna-barcaccia',
|
'id': 'benidorm-playa-levante',
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'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}$',
|
'title': 're:^【LIVE】 Webcam Benidorm - Levante Beach | SkylineWebcams [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
|
||||||
'description': 'Roma, veduta sulla Scalinata di Piazza di Spagna e sulla Barcaccia',
|
'description': 'View over the beach of the summer destination in Costa Blanca.',
|
||||||
'is_live': True,
|
'live_status': 'is_live',
|
||||||
|
'view_count': int,
|
||||||
|
'timestamp': int,
|
||||||
|
'thumbnail': 'https://cdn.skylinewebcams.com/social642.jpg',
|
||||||
|
'upload_date': '20240226'
|
||||||
},
|
},
|
||||||
'params': {
|
'params': {
|
||||||
'skip_download': True,
|
'skip_download': True,
|
||||||
@ -23,18 +27,19 @@ def _real_extract(self, url):
|
|||||||
|
|
||||||
webpage = self._download_webpage(url, video_id)
|
webpage = self._download_webpage(url, video_id)
|
||||||
|
|
||||||
stream_url = self._search_regex(
|
stream_url = urljoin('https://hd-auth.skylinewebcams.com', self._search_regex(
|
||||||
r'(?:url|source)\s*:\s*(["\'])(?P<url>(?:https?:)?//.+?\.m3u8.*?)\1', webpage,
|
r'(?:url|source)\s*:\s*(["\'])(?P<url>.+?\.m3u8.*?)\1', webpage,
|
||||||
'stream url', group='url')
|
'stream url', group='url'))
|
||||||
|
video_data = self._search_json_ld(webpage, video_id)
|
||||||
title = self._og_search_title(webpage)
|
|
||||||
description = self._og_search_description(webpage)
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'id': video_id,
|
'id': video_id,
|
||||||
'url': stream_url,
|
'url': stream_url,
|
||||||
'ext': 'mp4',
|
'ext': 'mp4',
|
||||||
'title': title,
|
'title': video_data.get('title') or self._og_search_title(webpage),
|
||||||
'description': description,
|
'description': video_data.get('description') or self._og_search_description(webpage),
|
||||||
|
'thumbnails': video_data.get('thumbnails'),
|
||||||
|
'timestamp': int_or_none(video_data.get('timestamp')),
|
||||||
|
'view_count': int_or_none(video_data.get('view_count')),
|
||||||
'is_live': True,
|
'is_live': True,
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user