From 6ea7190a3e6165f3d5c49e1e142eb85951b44712 Mon Sep 17 00:00:00 2001 From: reiv Date: Sat, 17 Oct 2015 22:47:16 +0200 Subject: [PATCH] Rewrite as list comprehension. --- youtube_dl/extractor/soundcloud.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/youtube_dl/extractor/soundcloud.py b/youtube_dl/extractor/soundcloud.py index 959f27975..c623bb6de 100644 --- a/youtube_dl/extractor/soundcloud.py +++ b/youtube_dl/extractor/soundcloud.py @@ -526,16 +526,12 @@ class SoundcloudSearchIE(SearchInfoExtractor, SoundcloudIE): next_url = response.get('next_href', None) def _get_n_results(self, query, n): - results = [] - tracks = self._get_collection('/search/tracks', collection_id='Query "{0}"'.format(query), q=query.encode('utf-8')) - for track in itertools.islice(tracks, n): - uri = track['uri'] - title = track['title'] - results.append(self.url_result(url=uri)) + results = [self.url_result(url=track['uri']) + for track in itertools.islice(tracks, n)] if not results: raise ExtractorError(