aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/soundcloud.py6
1 files changed, 1 insertions, 5 deletions
diff --git a/youtube_dl/extractor/soundcloud.py b/youtube_dl/extractor/soundcloud.py
index 3fe991849..959f27975 100644
--- a/youtube_dl/extractor/soundcloud.py
+++ b/youtube_dl/extractor/soundcloud.py
@@ -532,11 +532,7 @@ class SoundcloudSearchIE(SearchInfoExtractor, SoundcloudIE):
collection_id='Query "{0}"'.format(query),
q=query.encode('utf-8'))
- for _ in range(n):
- try:
- track = next(tracks)
- except StopIteration:
- break
+ for track in itertools.islice(tracks, n):
uri = track['uri']
title = track['title']
results.append(self.url_result(url=uri))