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