Skip to content

fix(network): add a Prefer IPv4 switch for YouTube bot checks on IPv6 - #656

Merged
A-EDev merged 3 commits into
mainfrom
fix/prefer-ipv4
Nov 16, 2026
Merged

A-EDev merged 3 commits into
mainfrom
fix/prefer-ipv4

Conversation

@A-EDev

@A-EDev A-EDev commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • New Prefer IPv4 switch in Settings > Network & Buffer (Playback sources), off by default, device-only (not synced, same across profiles).
  • When it is on, every internet client resolves host names to IPv4 addresses only. A host with no IPv4 address keeps its IPv6 ones, so IPv6-only and NAT64 networks still connect.
  • The filter is a custom reqwest DNS resolver (api/ip_family.rs) read on every new connection, so clients built at startup follow a change without a restart, like the proxy setting.
  • with_app_proxy is renamed with_app_network and installs both the proxy and the resolver. Innertube requests and googlevideo media, SABR and download fetches all go through it, so they use the same address family (googlevideo URLs are bound to the requesting IP).
  • The bot check error hint now points to the new switch.
  • Changelog line under PLAYER.

Related issue

Closes #622

Change type

  • Bug fix
  • Feature
  • Refactor or maintenance
  • Documentation
  • Build, packaging, or CI

Validation

  • pnpm test: 456 files, 2706 tests, 0 failures
  • pnpm build: tsc and vite build pass
  • cargo fmt --manifest-path src-tauri/Cargo.toml --all -- --check: clean
  • cargo clippy --manifest-path src-tauri/Cargo.toml --all-targets --all-features: no new warnings
  • cargo test --manifest-path src-tauri/Cargo.toml --all-targets --all-features: 74 test binaries, 1853 passed, 0 failed, 12 ignored
  • I smoke-tested the affected desktop behavior.

New unit tests cover the address filter (off, IPv4 only, IPv6 and NAT64 fallback, empty list) and a client built before the setting changes following it on a local request. Not tested on a real IPv6 network that YouTube flags; the reporter can confirm.

Screenshots or recordings

Risk and compatibility

  • Network: only changes which resolved addresses are used, and only while the switch is on. With it off, resolution goes through the same system lookup as before.

  • Connections already open when the switch changes keep their family until they close, and a cached player response keeps its URLs until it expires, so a video started right before switching may need a retry.

  • The BotGuard sidecar and token webview connect directly, as they already do for the proxy, and are not affected.

  • No migrations or database schema changes; the new key is a device setting.

  • No new secrets, private data, telemetry, or broad Tauri permissions were introduced.

  • User-facing documentation was updated where needed.

  • Dependency and lockfile changes are intentional and limited to this PR.

  • Breaking changes and upgrade steps are clearly documented.

@A-EDev
A-EDev merged commit cfef453 into main Nov 16, 2026
11 checks passed
@A-EDev
A-EDev deleted the fix/prefer-ipv4 branch November 16, 2026 18:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: YouTube playback fails on Airtel Xstream Fiber when IPv6 is enabled – works when IPv6 is disabled

1 participant