You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Refs #1038
0 commit comments