vh1.py 1.5 KB

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