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.

36 lines
1.1 KiB

  1. from __future__ import unicode_literals
  2. import re
  3. from .common import InfoExtractor
  4. class EbaumsWorldIE(InfoExtractor):
  5. _VALID_URL = r'https?://www\.ebaumsworld\.com/video/watch/(?P<id>\d+)'
  6. _TEST = {
  7. 'url': 'http://www.ebaumsworld.com/video/watch/83367677/',
  8. 'info_dict': {
  9. 'id': '83367677',
  10. 'ext': 'mp4',
  11. 'title': 'A Giant Python Opens The Door',
  12. 'description': 'This is how nightmares start...',
  13. 'uploader': 'jihadpizza',
  14. },
  15. }
  16. def _real_extract(self, url):
  17. mobj = re.match(self._VALID_URL, url)
  18. video_id = mobj.group('id')
  19. config = self._download_xml(
  20. 'http://www.ebaumsworld.com/video/player/%s' % video_id, video_id)
  21. video_url = config.find('file').text
  22. return {
  23. 'id': video_id,
  24. 'title': config.find('title').text,
  25. 'url': video_url,
  26. 'description': config.find('description').text,
  27. 'thumbnail': config.find('image').text,
  28. 'uploader': config.find('username').text,
  29. }