projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c30943b
)
Simplify with itertools.islice().
author
reiv
<metareiv@gmail.com>
Sat, 17 Oct 2015 20:36:08 +0000
(22:36 +0200)
committer
Sergey M․
<dstftw@gmail.com>
Sat, 21 Nov 2015 13:41:19 +0000
(19:41 +0600)
youtube_dl/extractor/soundcloud.py
patch
|
blob
|
history
diff --git
a/youtube_dl/extractor/soundcloud.py
b/youtube_dl/extractor/soundcloud.py
index 3fe991849b67fb7ebf447715c7c34301ebc190ca..959f27975da7d6d4a930b8bd3dde92f30e4c4b60 100644
(file)
--- 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))