]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/veehd.py
4 from .common
import InfoExtractor
11 class VeeHDIE(InfoExtractor
):
12 _VALID_URL
= r
'https?://veehd.com/video/(?P<id>\d+)'
15 u
'url': u
'http://veehd.com/video/4686958',
16 u
'file': u
'4686958.mp4',
18 u
'title': u
'Time Lapse View from Space ( ISS)',
19 u
'uploader_id': u
'spotted',
20 u
'description': u
'md5:f0094c4cf3a72e22bc4e4239ef767ad7',
24 def _real_extract(self
, url
):
25 mobj
= re
.match(self
._VALID
_URL
, url
)
26 video_id
= mobj
.group('id')
28 webpage
= self
._download
_webpage
(url
, video_id
)
29 player_path
= self
._search
_regex
(r
'\$\("#playeriframe"\).attr\({src : "(.+?)"',
30 webpage
, u
'player path')
31 player_url
= compat_urlparse
.urljoin(url
, player_path
)
32 player_page
= self
._download
_webpage
(player_url
, video_id
,
33 u
'Downloading player page')
34 config_json
= self
._search
_regex
(r
'value=\'config
=({.+?
})\'',
35 player_page, u'config json
')
36 config = json.loads(config_json)
38 video_url = compat_urlparse.unquote(config['clip
']['url
'])
39 title = clean_html(get_element_by_id('videoName
', webpage).rpartition('|
')[0])
40 uploader_id = self._html_search_regex(r'<a href
="/profile/\d+">(.+?
)</a
>',
42 thumbnail = self._search_regex(r'<img
id="veehdpreview" src
="(.+?)"',
43 webpage, u'thumbnail
')
44 description = self._html_search_regex(r'<td
class="infodropdown".*?
<div
>(.*?
)<ul
',
45 webpage, u'description
', flags=re.DOTALL)
53 'uploader_id
': uploader_id,
54 'thumbnail
': thumbnail,
55 'description
': description,