2017-02-23 20:44:04 +09:00
|
|
|
# coding: utf-8
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
|
|
|
|
from .common import InfoExtractor
|
|
|
|
|
|
|
|
|
|
|
|
class SkylineWebcamsIE(InfoExtractor):
|
|
|
|
_VALID_URL = r'https?://(?:www\.)?skylinewebcams\.com/[^/]+/webcam/(?:[^/]+/)+(?P<id>[^/]+)\.html'
|
|
|
|
_TEST = {
|
2022-01-20 23:16:12 +09:00
|
|
|
'url': 'https://www.skylinewebcams.com/it/webcam/italia/lazio/roma/piazza-di-spagna.html',
|
2017-02-23 20:44:04 +09:00
|
|
|
'info_dict': {
|
|
|
|
'id': 'scalinata-piazza-di-spagna-barcaccia',
|
|
|
|
'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',
|
|
|
|
'is_live': True,
|
|
|
|
},
|
|
|
|
'params': {
|
|
|
|
'skip_download': True,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
def _real_extract(self, url):
|
|
|
|
video_id = self._match_id(url)
|
|
|
|
|
|
|
|
webpage = self._download_webpage(url, video_id)
|
2022-01-20 23:16:12 +09:00
|
|
|
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')
|
2017-02-23 20:44:04 +09:00
|
|
|
|
|
|
|
title = self._og_search_title(webpage)
|
|
|
|
description = self._og_search_description(webpage)
|
|
|
|
|
|
|
|
return {
|
|
|
|
'id': video_id,
|
|
|
|
'url': stream_url,
|
|
|
|
'ext': 'mp4',
|
|
|
|
'title': self._live_title(title),
|
|
|
|
'description': description,
|
|
|
|
'is_live': True,
|
|
|
|
}
|