logo

youtube-dl

[mirror] Download/Watch videos from video hostersgit clone https://hacktivis.me/git/mirror/youtube-dl.git

ebaumsworld.py (1086B)


  1. from __future__ import unicode_literals
  2. from .common import InfoExtractor
  3. class EbaumsWorldIE(InfoExtractor):
  4. _VALID_URL = r'https?://(?:www\.)?ebaumsworld\.com/videos/[^/]+/(?P<id>\d+)'
  5. _TEST = {
  6. 'url': 'http://www.ebaumsworld.com/videos/a-giant-python-opens-the-door/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. }