]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/roxwel.py
4 from .common
import InfoExtractor
5 from ..utils
import unified_strdate
, determine_ext
8 class RoxwelIE(InfoExtractor
):
9 _VALID_URL
= r
'https?://www\.roxwel\.com/player/(?P<filename>.+?)(\.|\?|$)'
12 u
'url': u
'http://www.roxwel.com/player/passionpittakeawalklive.html',
13 u
'file': u
'passionpittakeawalklive.flv',
14 u
'md5': u
'd9dea8360a1e7d485d2206db7fe13035',
16 u
'title': u
'Take A Walk (live)',
17 u
'uploader': u
'Passion Pit',
18 u
'description': u
'Passion Pit performs "Take A Walk\" live at The Backyard in Austin, Texas. ',
20 u
'skip': u
'Requires rtmpdump',
23 def _real_extract(self
, url
):
24 mobj
= re
.match(self
._VALID
_URL
, url
)
25 filename
= mobj
.group('filename')
26 info_url
= 'http://www.roxwel.com/api/videos/%s' % filename
27 info_page
= self
._download
_webpage
(info_url
, filename
,
28 u
'Downloading video info')
30 self
.report_extraction(filename
)
31 info
= json
.loads(info_page
)
32 rtmp_rates
= sorted([int(r
.replace('flv_', '')) for r
in info
['media_rates'] if r
.startswith('flv_')])
33 best_rate
= rtmp_rates
[-1]
34 url_page_url
= 'http://roxwel.com/pl_one_time.php?filename=%s&quality=%s' % (filename
, best_rate
)
35 rtmp_url
= self
._download
_webpage
(url_page_url
, filename
, u
'Downloading video url')
36 ext
= determine_ext(rtmp_url
)
38 rtmp_url
= rtmp_url
.replace(filename
, 'mp4:%s' % filename
)
40 return {'id': filename
,
41 'title': info
['title'],
44 'description': info
['description'],
45 'thumbnail': info
.get('player_image_url') or info
.get('image_url_large'),
46 'uploader': info
['artist'],
47 'uploader_id': info
['artistname'],
48 'upload_date': unified_strdate(info
['dbdate']),