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.

34 lines
1.3 KiB

  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. class LemondeIE(InfoExtractor):
  4. _VALID_URL = r'https?://(?:.+?\.)?lemonde\.fr/(?:[^/]+/)*(?P<id>[^/]+)\.html'
  5. _TESTS = [{
  6. 'url': 'http://www.lemonde.fr/police-justice/video/2016/01/19/comprendre-l-affaire-bygmalion-en-cinq-minutes_4849702_1653578.html',
  7. 'md5': '01fb3c92de4c12c573343d63e163d302',
  8. 'info_dict': {
  9. 'id': 'lqm3kl',
  10. 'ext': 'mp4',
  11. 'title': "Comprendre l'affaire Bygmalion en 5 minutes",
  12. 'thumbnail': r're:^https?://.*\.jpg',
  13. 'duration': 320,
  14. 'upload_date': '20160119',
  15. 'timestamp': 1453194778,
  16. 'uploader_id': '3pmkp',
  17. },
  18. }, {
  19. 'url': 'http://redaction.actu.lemonde.fr/societe/video/2016/01/18/calais-debut-des-travaux-de-defrichement-dans-la-jungle_4849233_3224.html',
  20. 'only_matching': True,
  21. }]
  22. def _real_extract(self, url):
  23. display_id = self._match_id(url)
  24. webpage = self._download_webpage(url, display_id)
  25. digiteka_url = self._proto_relative_url(self._search_regex(
  26. r'url\s*:\s*(["\'])(?P<url>(?:https?://)?//(?:www\.)?(?:digiteka\.net|ultimedia\.com)/deliver/.+?)\1',
  27. webpage, 'digiteka url', group='url'))
  28. return self.url_result(digiteka_url, 'Digiteka')