aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorreiv <metareiv@gmail.com>2015-10-17 22:47:16 +0200
committerSergey M․ <dstftw@gmail.com>2015-11-21 19:41:26 +0600
commit6ea7190a3e6165f3d5c49e1e142eb85951b44712 (patch)
treec1b6580892a9253f7a13601d1cec2149ff1ad766
parentb54b08c91bb7f59a9ea720abbf944809d1ea8956 (diff)
Rewrite as list comprehension.
-rw-r--r--youtube_dl/extractor/soundcloud.py8
1 files 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(