logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

thescene.py (1373B)


  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. from ..compat import compat_urlparse
  4. class TheSceneIE(InfoExtractor):
  5. _VALID_URL = r'https?://thescene\.com/watch/[^/]+/(?P<id>[^/#?]+)'
  6. _TEST = {
  7. 'url': 'https://thescene.com/watch/vogue/narciso-rodriguez-spring-2013-ready-to-wear',
  8. 'info_dict': {
  9. 'id': '520e8faac2b4c00e3c6e5f43',
  10. 'ext': 'mp4',
  11. 'title': 'Narciso Rodriguez: Spring 2013 Ready-to-Wear',
  12. 'display_id': 'narciso-rodriguez-spring-2013-ready-to-wear',
  13. 'duration': 127,
  14. 'series': 'Style.com Fashion Shows',
  15. 'season': 'Ready To Wear Spring 2013',
  16. 'tags': list,
  17. 'categories': list,
  18. 'upload_date': '20120913',
  19. 'timestamp': 1347512400,
  20. 'uploader': 'vogue',
  21. },
  22. }
  23. def _real_extract(self, url):
  24. display_id = self._match_id(url)
  25. webpage = self._download_webpage(url, display_id)
  26. player_url = compat_urlparse.urljoin(
  27. url,
  28. self._html_search_regex(
  29. r'id=\'js-player-script\'[^>]+src=\'(.+?)\'', webpage, 'player url'))
  30. return {
  31. '_type': 'url_transparent',
  32. 'display_id': display_id,
  33. 'url': player_url,
  34. 'ie_key': 'CondeNast',
  35. }