github jmbannon/ytdl-sub 2026.08.26.post1
ytdl-sub 2026.08.26.post1

2 hours ago

[FEATURE] Add sync_with_source option to delete files removed from the source (#1490)

  • Add sync_with_source option to delete files removed from the source

Adds an opt-in output_options field that deletes local files when their
source entry is no longer present in a subscription's URL(s). After the
metadata pass, any download archive entry whose ID is absent from the
source is removed along with all of its files.

Reuses the existing keep_files/keep_max_files deletion path. The new
predicate calls the same EnhancedDownloadArchive._remove_entry, so media,
.nfo, thumbnail and .info.json files, the archive entry, and the
transaction log are all handled the same, and no re-downloading occurs.

Because ytdl-sub cannot distinguish "this video was removed" from
"metadata collection stopped early", enabling sync_with_source forces a
full enumeration of the source during the metadata pass:
break_on_existing is overridden to False, and the max_downloads cap that
keep_max_files injects is suppressed, only if the flag is set to True.
For truncation ytdl-sub cannot override, YTDLP now reports which
early-stop exception fired, and any such run skips pruning entirely with
a warning. A source that returns zero entries, or a run that never
enumerated the source at all (update_with_info_json), also never deletes.

Defaults to False, requires maintain_download_archive, and leaves
existing behavior unchanged.

Thanks @sapphimars for the addition!

Don't miss a new ytdl-sub release

NewReleases is sending notifications on new releases.