Browse Source

Simplify with itertools.islice().

totalwebcasting
reiv 9 years ago
committed by Sergey M․
parent
commit
b54b08c91b
1 changed files with 1 additions and 5 deletions
  1. +1
    -5
      youtube_dl/extractor/soundcloud.py

+ 1
- 5
youtube_dl/extractor/soundcloud.py View File

@ -532,11 +532,7 @@ class SoundcloudSearchIE(SearchInfoExtractor, SoundcloudIE):
collection_id='Query "{0}"'.format(query), collection_id='Query "{0}"'.format(query),
q=query.encode('utf-8')) 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'] uri = track['uri']
title = track['title'] title = track['title']
results.append(self.url_result(url=uri)) results.append(self.url_result(url=uri))


Loading…
Cancel
Save