4 from .common
import InfoExtractor
9 class VeohIE(InfoExtractor
):
10 _VALID_URL
= r
'http://www\.veoh\.com/watch/v(?P<id>\d*)'
13 u
'url': u
'http://www.veoh.com/watch/v56314296nk7Zdmz3',
14 u
'file': u
'56314296.mp4',
15 u
'md5': u
'620e68e6a3cff80086df3348426c9ca3',
17 u
'title': u
'Straight Backs Are Stronger',
18 u
'uploader': u
'LUMOback',
19 u
'description': u
'At LUMOback, we believe straight backs are stronger. The LUMOback Posture & Movement Sensor: It gently vibrates when you slouch, inspiring improved posture and mobility. Use the app to track your data and improve your posture over time. ',
23 def _real_extract(self
, url
):
24 mobj
= re
.match(self
._VALID
_URL
, url
)
25 video_id
= mobj
.group('id')
26 webpage
= self
._download
_webpage
(url
, video_id
)
28 m_youtube
= re
.search(r
'http://www\.youtube\.com/v/(.*?)(\&|")', webpage
)
29 if m_youtube
is not None:
30 youtube_id
= m_youtube
.group(1)
31 self
.to_screen(u
'%s: detected Youtube video.' % video_id
)
32 return self
.url_result(youtube_id
, 'Youtube')
34 self
.report_extraction(video_id
)
35 info
= self
._search
_regex
(r
'videoDetailsJSON = \'({.*?
})\';', webpage, 'info
')
36 info = json.loads(info)
37 video_url = info.get('fullPreviewHashHighPath
') or info.get('fullPreviewHashLowPath
')
39 return {'id': info['videoId
'],
40 'title
': info['title
'],
41 'ext
': determine_ext(video_url),
43 'uploader
': info['username
'],
44 'thumbnail
': info.get('highResImage
') or info.get('medResImage
'),
45 'description
': info['description
'],
46 'view_count
': info['views
'],