]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/roxwel.py
1 from __future__
import unicode_literals
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 'url': 'http://www.roxwel.com/player/passionpittakeawalklive.html',
14 'id': 'passionpittakeawalklive',
16 'title': 'Take A Walk (live)',
17 'uploader': 'Passion Pit',
18 'uploader_id': 'passionpit',
19 'upload_date': '20120928',
20 'description': 'Passion Pit performs "Take A Walk\" live at The Backyard in Austin, Texas. ',
24 'skip_download': True,
28 def _real_extract(self
, url
):
29 mobj
= self
._match
_valid
_url
(url
)
30 filename
= mobj
.group('filename')
31 info_url
= 'http://www.roxwel.com/api/videos/%s' % filename
32 info
= self
._download
_json
(info_url
, filename
)
34 rtmp_rates
= sorted([int(r
.replace('flv_', '')) for r
in info
['media_rates'] if r
.startswith('flv_')])
35 best_rate
= rtmp_rates
[-1]
36 url_page_url
= 'http://roxwel.com/pl_one_time.php?filename=%s&quality=%s' % (filename
, best_rate
)
37 rtmp_url
= self
._download
_webpage
(url_page_url
, filename
, 'Downloading video url')
38 ext
= determine_ext(rtmp_url
)
40 rtmp_url
= rtmp_url
.replace(filename
, 'mp4:%s' % filename
)
44 'title': info
['title'],
47 'description': info
['description'],
48 'thumbnail': info
.get('player_image_url') or info
.get('image_url_large'),
49 'uploader': info
['artist'],
50 'uploader_id': info
['artistname'],
51 'upload_date': unified_strdate(info
['dbdate']),