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.

33 lines
1.0 KiB

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