Per-channel "skip auth check" toggle for the youtubetab warning

yt-dlp prints a scary-looking ERROR when it can't confirm a channel
tab loaded authenticated:

  ERROR: [youtube:tab] @Channel: Playlists that require authentication
  may not extract correctly without a successful webpage download…
  pass "--extractor-args youtubetab:skip=authcheck" to skip this check

For PUBLIC channels that's just noise — there's no auth-gated content
to miss, and the flag silences it without changing which videos are
found. But for members-only/private channels archived with cookies,
the warning is a real "your cookies may not be working, you might be
getting an incomplete list" signal worth keeping.

So make it a per-channel toggle rather than a blanket setting:

- DownloadOptions gains `skip_auth_check: bool`; apply() emits
  `--extractor-args youtubetab:skip=authcheck` when set. (Its own flag;
  the youtubetab: namespace is distinct from the POT provider's
  youtubepot-bgutilhttp: one, so they coexist.)
- Desktop + web channel-options dialogs gain a checkbox with a tooltip
  spelling out the public-vs-private trade-off.

1 new test; 81 pass.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
Luna 2026-06-01 05:25:06 -07:00
parent 5cb011a13d
commit 6cefc0c0e5
3 changed files with 39 additions and 0 deletions

View file

@ -79,6 +79,19 @@ pub struct DownloadOptions {
/// When on, the web UI's player modal exposes a Comments tab.
#[serde(default)]
pub fetch_comments: bool,
/// Skip yt-dlp's channel-tab authentication sanity check by passing
/// `--extractor-args youtubetab:skip=authcheck`.
///
/// yt-dlp warns ("Playlists that require authentication may not
/// extract correctly…") when it can't confirm a channel page loaded
/// authenticated. For PUBLIC channels that warning is noise — there's
/// no auth-gated content to miss — so this silences it. Leave OFF for
/// channels where you archive members-only / private content with
/// cookies: there the warning is a real "your cookies aren't working,
/// you may be getting an incomplete list" signal worth keeping.
#[serde(default)]
pub skip_auth_check: bool,
}
impl DownloadOptions {
@ -129,6 +142,12 @@ impl DownloadOptions {
if self.fetch_comments {
cmd.arg("--write-comments");
}
if self.skip_auth_check {
// Its own --extractor-args flag; the youtubetab: namespace is
// distinct from the POT provider's youtubepot-bgutilhttp: one,
// so they coexist as separate flags without clobbering.
cmd.arg("--extractor-args").arg("youtubetab:skip=authcheck");
}
}
/// Deserialize from the JSON blob stored in `channel_options.options_json`.
@ -182,6 +201,14 @@ mod tests {
assert_eq!(args, vec!["--sub-langs", "en,ja,es"]);
}
#[test]
fn skip_auth_check_emits_extractor_arg() {
let mut cmd = Command::new("yt-dlp");
DownloadOptions { skip_auth_check: true, ..Default::default() }.apply(&mut cmd);
let args: Vec<String> = cmd.get_args().map(|a| a.to_string_lossy().into_owned()).collect();
assert_eq!(args, vec!["--extractor-args", "youtubetab:skip=authcheck"]);
}
#[test]
fn audio_only_adds_extract_audio_chain() {
let mut cmd = Command::new("yt-dlp");