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.

54 lines
1.9 KiB

  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. class FiveMinIE(InfoExtractor):
  4. IE_NAME = '5min'
  5. _VALID_URL = r'(?:5min:|https?://(?:[^/]*?5min\.com/|delivery\.vidible\.tv/aol)(?:(?:Scripts/PlayerSeed\.js|playerseed/?)?\?.*?playList=)?)(?P<id>\d+)'
  6. _TESTS = [
  7. {
  8. # From http://www.engadget.com/2013/11/15/ipad-mini-retina-display-review/
  9. 'url': 'http://pshared.5min.com/Scripts/PlayerSeed.js?sid=281&width=560&height=345&playList=518013791',
  10. 'md5': '4f7b0b79bf1a470e5004f7112385941d',
  11. 'info_dict': {
  12. 'id': '518013791',
  13. 'ext': 'mp4',
  14. 'title': 'iPad Mini with Retina Display Review',
  15. 'description': 'iPad mini with Retina Display review',
  16. 'duration': 177,
  17. 'uploader': 'engadget',
  18. 'upload_date': '20131115',
  19. 'timestamp': 1384515288,
  20. },
  21. 'params': {
  22. # m3u8 download
  23. 'skip_download': True,
  24. }
  25. },
  26. {
  27. # From http://on.aol.com/video/how-to-make-a-next-level-fruit-salad-518086247
  28. 'url': '5min:518086247',
  29. 'md5': 'e539a9dd682c288ef5a498898009f69e',
  30. 'info_dict': {
  31. 'id': '518086247',
  32. 'ext': 'mp4',
  33. 'title': 'How to Make a Next-Level Fruit Salad',
  34. 'duration': 184,
  35. },
  36. 'skip': 'no longer available',
  37. },
  38. {
  39. 'url': 'http://embed.5min.com/518726732/',
  40. 'only_matching': True,
  41. },
  42. {
  43. 'url': 'http://delivery.vidible.tv/aol?playList=518013791',
  44. 'only_matching': True,
  45. }
  46. ]
  47. def _real_extract(self, url):
  48. video_id = self._match_id(url)
  49. return self.url_result('aol-video:%s' % video_id)