You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

42 lines
1.4 KiB

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