2 from __future__ import unicode_literals
7 from .common import InfoExtractor
9 compat_urllib_parse_urlparse,
15 class RBMARadioIE(InfoExtractor):
16 _VALID_URL = r'https?://(?:www\.)?rbmaradio\.com/shows/(?P<videoID>[^/]+)$'
18 'url': 'http://www.rbmaradio.com/shows/ford-lopatin-live-at-primavera-sound-2011',
19 'file': 'ford-lopatin-live-at-primavera-sound-2011.mp3',
20 'md5': '6bc6f9bcb18994b4c983bc3bf4384d95',
22 "uploader_id": "ford-lopatin",
24 "description": "Joel Ford and Daniel ’Oneohtrix Point Never’ Lopatin fly their midified pop extravaganza to Spain. Live at Primavera Sound 2011.",
25 "uploader": "Ford & Lopatin",
26 "title": "Live at Primavera Sound 2011",
30 def _real_extract(self, url):
31 m = re.match(self._VALID_URL, url)
32 video_id = m.group('videoID')
34 webpage = self._download_webpage(url, video_id)
36 json_data = self._search_regex(r'window\.gon.*?gon\.show=(.+?);$',
37 webpage, 'json data', flags=re.MULTILINE)
40 data = json.loads(json_data)
41 except ValueError as e:
42 raise ExtractorError('Invalid JSON: ' + str(e))
44 video_url = data['akamai_url'] + '&cbr=256'
45 url_parts = compat_urllib_parse_urlparse(video_url)
50 'title': data['title'],
51 'description': data.get('teaser_text'),
52 'location': data.get('country_of_origin'),
53 'uploader': data.get('host', {}).get('name'),
54 'uploader_id': data.get('host', {}).get('slug'),
55 'thumbnail': data.get('image', {}).get('large_url_2x'),
56 'duration': data.get('duration'),