logo

youtube-dl

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

vh1.py (1541B)


  1. # coding: utf-8
  2. from __future__ import unicode_literals
  3. from .mtv import MTVServicesInfoExtractor
  4. class VH1IE(MTVServicesInfoExtractor):
  5. IE_NAME = 'vh1.com'
  6. _FEED_URL = 'http://www.vh1.com/feeds/mrss/'
  7. _TESTS = [{
  8. 'url': 'http://www.vh1.com/episodes/0umwpq/hip-hop-squares-kent-jones-vs-nick-young-season-1-ep-120',
  9. 'info_dict': {
  10. 'title': 'Kent Jones vs. Nick Young',
  11. 'description': 'Come to Play. Stay to Party. With Mike Epps, TIP, O’Shea Jackson Jr., T-Pain, Tisha Campbell-Martin and more.',
  12. },
  13. 'playlist_mincount': 4,
  14. }, {
  15. # Clip
  16. 'url': 'http://www.vh1.com/video-clips/t74mif/scared-famous-scared-famous-extended-preview',
  17. 'info_dict': {
  18. 'id': '0a50c2d2-a86b-4141-9565-911c7e2d0b92',
  19. 'ext': 'mp4',
  20. 'title': 'Scared Famous|October 9, 2017|1|NO-EPISODE#|Scared Famous + Extended Preview',
  21. 'description': 'md5:eff5551a274c473a29463de40f7b09da',
  22. 'upload_date': '20171009',
  23. 'timestamp': 1507574700,
  24. },
  25. 'params': {
  26. # m3u8 download
  27. 'skip_download': True,
  28. },
  29. }]
  30. _VALID_URL = r'https?://(?:www\.)?vh1\.com/(?:video-clips|episodes)/(?P<id>[^/?#.]+)'
  31. def _real_extract(self, url):
  32. playlist_id = self._match_id(url)
  33. webpage = self._download_webpage(url, playlist_id)
  34. mgid = self._extract_triforce_mgid(webpage)
  35. videos_info = self._get_videos_info(mgid)
  36. return videos_info