]> Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/ebaumsworld.py
debian/control: Annotate with bug numbers closed by this release.
[youtubedl] / youtube_dl / extractor / ebaumsworld.py
1 import re
2
3 from .common import InfoExtractor
4 from ..utils import determine_ext
5
6
7 class EbaumsWorldIE(InfoExtractor):
8 _VALID_URL = r'https?://www\.ebaumsworld\.com/video/watch/(?P<id>\d+)'
9
10 _TEST = {
11 u'url': u'http://www.ebaumsworld.com/video/watch/83367677/',
12 u'file': u'83367677.mp4',
13 u'info_dict': {
14 u'title': u'A Giant Python Opens The Door',
15 u'description': u'This is how nightmares start...',
16 u'uploader': u'jihadpizza',
17 },
18 }
19
20 def _real_extract(self, url):
21 mobj = re.match(self._VALID_URL, url)
22 video_id = mobj.group('id')
23 config = self._download_xml(
24 'http://www.ebaumsworld.com/video/player/%s' % video_id, video_id)
25 video_url = config.find('file').text
26
27 return {
28 'id': video_id,
29 'title': config.find('title').text,
30 'url': video_url,
31 'ext': determine_ext(video_url),
32 'description': config.find('description').text,
33 'thumbnail': config.find('image').text,
34 'uploader': config.find('username').text,
35 }