+ @classmethod
+ def _resolv_url(cls, url):
+ return 'http://api.soundcloud.com/resolve.json?url=' + url + '&client_id=' + cls._CLIENT_ID
+
+ def _extract_info_dict(self, info, full_title=None, quiet=False):
+ track_id = compat_str(info['id'])
+ name = full_title or track_id
+ if quiet == False:
+ self.report_extraction(name)
+
+ thumbnail = info['artwork_url']
+ if thumbnail is not None:
+ thumbnail = thumbnail.replace('-large', '-t500x500')
+ result = {
+ 'id': track_id,
+ 'url': info['stream_url'] + '?client_id=' + self._CLIENT_ID,
+ 'uploader': info['user']['username'],
+ 'upload_date': unified_strdate(info['created_at']),
+ 'title': info['title'],
+ 'ext': u'mp3',
+ 'description': info['description'],
+ 'thumbnail': thumbnail,
+ }
+ if info.get('downloadable', False):
+ result['url'] = 'https://api.soundcloud.com/tracks/{0}/download?client_id={1}'.format(track_id, self._CLIENT_ID)
+ if not info.get('streamable', False):
+ # We have to get the rtmp url
+ stream_json = self._download_webpage(
+ 'http://api.soundcloud.com/i1/tracks/{0}/streams?client_id={1}'.format(track_id, self._CLIENT_ID),
+ track_id, u'Downloading track url')
+ rtmp_url = json.loads(stream_json)['rtmp_mp3_128_url']
+ # The url doesn't have an rtmp app, we have to extract the playpath
+ url, path = rtmp_url.split('mp3:', 1)
+ result.update({
+ 'url': url,
+ 'play_path': 'mp3:' + path,
+ })
+ return result
+