fix(dl): preserve attachments when rebuilding track list

Attachments (screenshots, fonts) were being dropped when title.tracks was rebuilt from kept_tracks, causing image files to remain in temp directory after muxing. The cleanup code iterated over an empty attachments list since they were orphaned during track filtering.
This commit is contained in:
Andy
2025-11-27 23:03:53 +00:00
parent 2d4bf140fa
commit 6fa3554b70

View File

@@ -1368,6 +1368,8 @@ class dl:
kept_tracks.extend(title.tracks.subtitles) kept_tracks.extend(title.tracks.subtitles)
if keep_chapters: if keep_chapters:
kept_tracks.extend(title.tracks.chapters) kept_tracks.extend(title.tracks.chapters)
# Always preserve attachments (screenshots, fonts, etc.) for cleanup
kept_tracks.extend(title.tracks.attachments)
title.tracks = Tracks(kept_tracks) title.tracks = Tracks(kept_tracks)