fixes incomplete yt-dlp parts download

This commit is contained in:
msramalho
2026-04-27 12:34:47 +01:00
parent 20fddce3a3
commit bc06de8e5c
4 changed files with 68 additions and 0 deletions

View File

@@ -120,6 +120,9 @@ def ydl_entry_to_filename(ydl, entry: dict) -> str:
directory = os.path.dirname(base_filename) # '/get/path/to'
basename = os.path.basename(base_filename) # 'file'
for f in os.listdir(directory):
# skip incomplete downloads left behind by yt-dlp
if f.endswith(".part"):
continue
if (
f.startswith(basename)
or (entry_url and os.path.splitext(f)[0] in entry_url)