From 2b2e2c551646d41852ea3fc3252be3820407d703 Mon Sep 17 00:00:00 2001 From: Nasy Date: Tue, 8 Jan 2019 21:34:15 +0800 Subject: [PATCH] Remove useless `len(url_list) > 1` in YoutubeDL.py Remove useless `len(url_list) > 1` in YoutubeDL.py so that `download` function can support not only list but also iterable object. --- youtube_dl/YoutubeDL.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 4493fd0e1..913754922 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1989,8 +1989,7 @@ class YoutubeDL(object): def download(self, url_list): """Download a given list of URLs.""" outtmpl = self.params.get('outtmpl', DEFAULT_OUTTMPL) - if (len(url_list) > 1 and - outtmpl != '-' and + if (outtmpl != '-' and '%' not in outtmpl and self.params.get('max_downloads') != 1): raise SameFileError(outtmpl)