A feature-rich command-line audio/video downloader
Fix wrong variable in position swap corrupting archive list
Jody Bruchona4d834fb3ef0
diff --git a/youtube_dlc/YoutubeDL.py b/youtube_dlc/YoutubeDL.pyindex 03bb245ba6..fab56f2f86 100644--- a/youtube_dlc/YoutubeDL.py+++ b/youtube_dlc/YoutubeDL.py@@ -423,17 +423,15 @@ class YoutubeDL(object):raiselmax = len(lines)if lmax > 10:- # Populate binary search tree by splitting the archive list in half- # and then adding from the outside edges inward- # This mitigates the worst case where the archive has been sortedpos = 0while pos < lmax:if lmax - pos <= 2:breaktarget = random.randrange(pos + 1, lmax - 1)+ # Swap line at pos with randomly chosen targettemp = lines[pos]lines[pos] = lines[target]- lines[target] = lines[pos]+ lines[target] = temppos += 1elif lmax < 1:# No lines were loaded