skylinewebcams.py 1.4 KB

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