From: dannycolligan Date: Tue, 7 Apr 2009 15:21:27 +0000 (-0700) Subject: Added cap if user requests ytsearch number over 1000 (with warning) X-Git-Url: http://git.oshgnacknak.de/?a=commitdiff_plain;h=257453b92bf07920814ce68620ee8fe0949fb6de;p=youtube-dl Added cap if user requests ytsearch number over 1000 (with warning) --- diff --git a/youtube-dl b/youtube-dl index e41134546..6757a896c 100755 --- a/youtube-dl +++ b/youtube-dl @@ -786,6 +786,9 @@ class YoutubeSearchIE(InfoExtractor): if n <= 0: self.to_stderr(u'ERROR: invalid download number %s for query "%s"' % (n, query)) return [None] + elif n > self._max_youtube_results: + self.to_stderr(u'WARNING: ytsearch returns max %i results (you requested %i)' % (self._max_youtube_results, n)) + n = self._max_youtube_results return self._download_n_results(query, n) except ValueError: # parsing prefix as int fails return self._download_n_results(query, 1)