From 45e5bcee27fb5702c0b4e0868919cb3d27646273 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Wed, 8 May 2024 13:54:56 +0400 Subject: [PATCH] Fix: del playlist_items parameter only when set This code sometimes had raised KeyError --- backend/ydl_pool.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/backend/ydl_pool.py b/backend/ydl_pool.py index 6d85a30..8a78e64 100644 --- a/backend/ydl_pool.py +++ b/backend/ydl_pool.py @@ -155,7 +155,9 @@ class Downloader: ydl.params['playlist_items'] = ','.join(str(i) for i in playlist_items) ret = ydl.download(url) - del ydl.params['playlist_items'] + + if playlist_items: + del ydl.params['playlist_items'] return ret