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.

46 lines
1.6 KiB

  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. class AolIE(InfoExtractor):
  4. IE_NAME = 'on.aol.com'
  5. _VALID_URL = r'(?:aol-video:|https?://on\.aol\.com/video/.*-)(?P<id>[0-9]+)(?:$|\?)'
  6. _TESTS = [{
  7. 'url': 'http://on.aol.com/video/u-s--official-warns-of-largest-ever-irs-phone-scam-518167793?icid=OnHomepageC2Wide_MustSee_Img',
  8. 'md5': '18ef68f48740e86ae94b98da815eec42',
  9. 'info_dict': {
  10. 'id': '518167793',
  11. 'ext': 'mp4',
  12. 'title': 'U.S. Official Warns Of \'Largest Ever\' IRS Phone Scam',
  13. },
  14. 'add_ie': ['FiveMin'],
  15. }]
  16. def _real_extract(self, url):
  17. video_id = self._match_id(url)
  18. return self.url_result('5min:%s' % video_id)
  19. class AolFeaturesIE(InfoExtractor):
  20. IE_NAME = 'features.aol.com'
  21. _VALID_URL = r'https?://features\.aol\.com/video/(?P<id>[^/?#]+)'
  22. _TESTS = [{
  23. 'url': 'http://features.aol.com/video/behind-secret-second-careers-late-night-talk-show-hosts',
  24. 'md5': '7db483bb0c09c85e241f84a34238cc75',
  25. 'info_dict': {
  26. 'id': '519507715',
  27. 'ext': 'mp4',
  28. 'title': 'What To Watch - February 17, 2016',
  29. },
  30. 'add_ie': ['FiveMin'],
  31. }]
  32. def _real_extract(self, url):
  33. display_id = self._match_id(url)
  34. webpage = self._download_webpage(url, display_id)
  35. return self.url_result(self._search_regex(
  36. r'<script type="text/javascript" src="(https?://[^/]*?5min\.com/Scripts/PlayerSeed\.js[^"]+)"',
  37. webpage, '5min embed url'), 'FiveMin')