fix: SkylineWebcams extractor

SkylineWebcams extractor was not working.
Here are the list of changes to make it work:

1. Update the regex to extract the stream URL from the webpage.
In the webpage there is just a variable in the form `livee.m3u8?a=<id>`.
The usage of that link by appending it to
`https://hd-auth.skylinewebcams.com/` do not work. The solution was
to extract just the `?a=<id>` area and appending it to
`https://hd-auth.skylinewebcams.com/live.m3u8`.
The extractor works properly.

2. Updated `_TEST` with a new `url`. The old one was disabled.

It solves #28873.
This commit is contained in:
Piero Macaluso 2022-01-20 15:16:12 +01:00
parent 5014bd67c2
commit e6e12b1d1b

View file

@ -7,7 +7,7 @@ from .common import InfoExtractor
class SkylineWebcamsIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?skylinewebcams\.com/[^/]+/webcam/(?:[^/]+/)+(?P<id>[^/]+)\.html'
_TEST = {
'url': 'https://www.skylinewebcams.com/it/webcam/italia/lazio/roma/scalinata-piazza-di-spagna-barcaccia.html',
'url': 'https://www.skylinewebcams.com/it/webcam/italia/lazio/roma/piazza-di-spagna.html',
'info_dict': {
'id': 'scalinata-piazza-di-spagna-barcaccia',
'ext': 'mp4',
@ -24,10 +24,9 @@ class SkylineWebcamsIE(InfoExtractor):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
stream_url = self._search_regex(
r'(?:url|source)\s*:\s*(["\'])(?P<url>(?:https?:)?//.+?\.m3u8.*?)\1', webpage,
'stream url', group='url')
stream_url = 'https://hd-auth.skylinewebcams.com/live.m3u8' + self._search_regex(
r'(?:url|source)\s*:\s*(["\'])(livee\.m3u8(?P<a_param>\?a=\w+))\1', webpage,
'stream url', group='a_param')
title = self._og_search_title(webpage)
description = self._og_search_description(webpage)