Skip to content

[Feature]: Add a way to bypass archive check via a preset or per-download override when download_archive is set in the global config #958

@L1ttl3F00t

Description

@L1ttl3F00t

Prerequisites

  • I have searched existing issues and discussions to ensure this bug hasn't been reported before
  • I have read the troubleshooting section in the README
  • I have tested this issue with yt-dlp directly (not just through MeTube UI) as described in the README
  • I have checked that this is not a yt-dlp issue (if it is, please report it to yt-dlp repository instead)

Bug Description

When download_archive is set in the global config (YTDL_OPTIONS / ytdl-options.json), it works correctly — previously archived videos are skipped before any download begins.
However, if download_archive is moved out of the global config and into a preset instead, the archive check no longer gates the download. The video is fully downloaded before yt-dlp determines it was already in the archive, at which point the download is effectively wasted. This defeats the purpose of the archive entirely when used via presets or per-download overrides. This appears to be caused by the timing of when the YoutubeDL instance is constructed relative to when preset options are merged in.

I discovered this while trying to work around another issue / limitation: there seems to be no way to override the download_archive on a per-download/per-profile basis if it is set in the global config (i.e., ytdl-options.json). The yt-dlp API has no equivalent to the CLI's --no-download-archive flag — there is no value that, when passed via a preset or the per-download Custom Options field, causes yt-dlp to skip the archive check for that invocation. Setting "download_archive": "/dev/null" (or to Null, None does not suppress the check. Again, it seems to be due to the order / manner in which the options are constructed.

Expected Behaviour:

  1. download_archive set via a preset should check the archive before beginning the download, consistent with how it behaves in the global config.

  2. It should be possible to disable download_archive on a per-download basis (e.g. via a Preset or Per-Download Overrides) when it is set in the global config — for example, by supporting a "download_archive": null sentinel or a dedicated "no_download_archive": true key that instructs MeTube to omit the archive key entirely when constructing the options for that download.

yt-dlp Direct Test Results

ytdlp https://www.youtube.com/shorts/nNcS2C84Cqc
[download] nNcS2C84Cqc: has already been recorded in the archive

Environment & Configuration

Running latest version of docker container (ghcr.io/alexta69/metube) in unRAID

ytdl-options.json:

{
  "updatetime": false,
  "writethumbnail": true,
  "writeinfojson": true,
  "ratelimit": 1875000,
  "writesubtitles":true,
  "subtitleslangs":["en","-live_chat"],
  "postprocessors":[
  	{"key":"Exec","exec_cmd":"chmod 0664","when":"after_move"},
	{"key":"FFmpegEmbedSubtitle","already_have_subtitle":false},
	{"key":"FFmpegMetadata","add_chapters":true}]
}

ytdl-options-presets.json

{
  "Archive": {
	  "download_archive": "/config/archive.txt"
  },

Paths and variables are all correctly defined in container config and all other general functionality is verified working. Have isolated this specific issue with dedicated testing.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions