From f4ca81416bb09f2917ab075da781792fc073baa1 Mon Sep 17 00:00:00 2001 From: ALurker Date: Sun, 26 Aug 2018 10:25:52 -0500 Subject: [PATCH] [generic] Correct apply order on playlist-reverse (closes #6845) --- youtube_dl/YoutubeDL.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 19370f62b..d0cc24be4 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -938,6 +938,9 @@ class YoutubeDL(object): '[%s] playlist %s: Downloading %d videos' % (ie_result['extractor'], playlist, num_entries)) + if self.params.get('playlistreverse', False): + ie_entries = ie_entries[::-1] + if isinstance(ie_entries, list): n_all_entries = len(ie_entries) if playlistitems: @@ -970,9 +973,6 @@ class YoutubeDL(object): n_entries = len(entries) report_download(n_entries) - if self.params.get('playlistreverse', False): - entries = entries[::-1] - if self.params.get('playlistrandom', False): random.shuffle(entries)