]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/nowvideo.py
ab52ad4011851405e9a6b17f73720a8cd646860c
3 from .common
import InfoExtractor
4 from ..utils
import compat_urlparse
7 class NowVideoIE(InfoExtractor
):
8 _VALID_URL
= r
'(?:https?://)?(?:www\.)?nowvideo\.ch/video/(?P<id>\w+)'
10 u
'url': u
'http://www.nowvideo.ch/video/0mw0yow7b6dxa',
11 u
'file': u
'0mw0yow7b6dxa.flv',
12 u
'md5': u
'f8fbbc8add72bd95b7850c6a02fc8817',
14 u
"title": u
"youtubedl test video _BaW_jenozKc.mp4"
18 def _real_extract(self
, url
):
19 mobj
= re
.match(self
._VALID
_URL
, url
)
21 video_id
= mobj
.group('id')
22 webpage_url
= 'http://www.nowvideo.ch/video/' + video_id
23 webpage
= self
._download
_webpage
(webpage_url
, video_id
)
25 self
.report_extraction(video_id
)
27 video_title
= self
._html
_search
_regex
(r
'<h4>(.*)</h4>',
28 webpage
, u
'video title')
30 video_key
= self
._search
_regex
(r
'var fkzd="(.*)";',
31 webpage
, u
'video key')
33 api_call
= "http://www.nowvideo.ch/api/player.api.php?file={0}&numOfErrors=0&cid=1&key={1}".format(video_id
, video_key
)
34 api_response
= self
._download
_webpage
(api_call
, video_id
,
35 u
'Downloading API page')
36 video_url
= compat_urlparse
.parse_qs(api_response
)[u
'url'][0]