Compare commits

...

5 Commits

Author SHA1 Message Date
Piero Macaluso
484bd468c0
Merge c010f357da27efa5b5be6eacd20f9b068fca7db6 into 3eb8d22ddb8982ca4fb56bb7a8d6517538bf14c6 2025-04-01 09:09:02 +02:00
dirkf
3eb8d22ddb
[JSInterp] Temporary fix for #33102 2025-03-31 04:21:09 +01:00
Piero Macaluso
c010f357da Remove an unuseful print 2022-01-20 17:09:33 +01:00
Piero Macaluso
b50cc676e3 Update test info 2022-01-20 16:01:32 +01:00
Piero Macaluso
e6e12b1d1b 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.
2022-01-20 15:16:12 +01:00
2 changed files with 8 additions and 7 deletions

View File

@ -9,10 +9,10 @@ class SkylineWebcamsIE(InfoExtractor):
_TEST = {
'url': 'https://www.skylinewebcams.com/it/webcam/italia/lazio/roma/scalinata-piazza-di-spagna-barcaccia.html',
'info_dict': {
'id': 'scalinata-piazza-di-spagna-barcaccia',
'id': 'piazza-di-spagna',
'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}$',
'description': 'Roma, veduta sulla Scalinata di Piazza di Spagna e sulla Barcaccia',
'title': 're:^【LIVE】 Webcam Roma - Piazza di Spagna | SkylineWebcams [0-9]{4}-[0-9]{2}-[0-9]{2} [0-9]{2}:[0-9]{2}$',
'description': 'Guarda la webcam su Piazza di Spagna a Roma! Scopri in diretta il traffico dei turisti ai piedi della scalinata di Trinità dei Monti ed intorno alla Barcaccia',
'is_live': True,
},
'params': {
@ -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)

View File

@ -686,6 +686,8 @@ class JSInterpreter(object):
raise self.Exception('Cannot get index {idx!r:.100}'.format(**locals()), expr=repr(obj), cause=e)
def _dump(self, obj, namespace):
if obj is JS_Undefined:
return 'undefined'
try:
return json.dumps(obj)
except TypeError: