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.

29 lines
1.1 KiB

  1. from __future__ import unicode_literals
  2. from .mtv import MTVServicesInfoExtractor
  3. class SpikeIE(MTVServicesInfoExtractor):
  4. _VALID_URL = r'''(?x)https?://
  5. (?:www\.spike\.com/(?:video-clips|(?:full-)?episodes)/.+|
  6. m\.spike\.com/videos/video\.rbml\?id=(?P<id>[^&]+))
  7. '''
  8. _TEST = {
  9. 'url': 'http://www.spike.com/video-clips/lhtu8m/auction-hunters-can-allen-ride-a-hundred-year-old-motorcycle',
  10. 'md5': '1a9265f32b0c375793d6c4ce45255256',
  11. 'info_dict': {
  12. 'id': 'b9c8221a-4e50-479a-b86d-3333323e38ba',
  13. 'ext': 'mp4',
  14. 'title': 'Auction Hunters|Can Allen Ride A Hundred Year-Old Motorcycle?',
  15. 'description': 'md5:fbed7e82ed5fad493615b3094a9499cb',
  16. },
  17. }
  18. _FEED_URL = 'http://www.spike.com/feeds/mrss/'
  19. _MOBILE_TEMPLATE = 'http://m.spike.com/videos/video.rbml?id=%s'
  20. def _real_extract(self, url):
  21. mobile_id = self._match_id(url)
  22. if mobile_id:
  23. url = 'http://www.spike.com/video-clips/%s' % mobile_id
  24. return super(SpikeIE, self)._real_extract(url)