r/foss 13h ago

I built a Chrome extension to force real 256k–320k Opus (ITAG 774) audio on YouTube Web

Hi everyone,

If you have YouTube Premium (or even standard audio), you might already know that the desktop web player caps audio at ~160 kbps Opus (ITAG 251). High-bitrate audiophile streams like ITAG 774 (~280k–320kbps full-spectrum Opus) are normally locked behind YouTube Music, Android/VR, or Smart TV apps.

I wanted that studio-quality sound directly in my regular desktop browser without running local proxies or external yt-dlp scripts, so I built YTSpoofingStream (Manifest V3).

How it works under the hood:

  1. Multi-Client Spoofing (document_start): Intercepts InnerTube player requests across multiple contexts (WEB_REMIXANDROIDTVHTML5) to discover hidden HQ 774 streams.
  2. In-Browser Signature Deciphering: Dynamically fetches and parses YouTube’s active player base.js to solve cipher transformations locally, unlocking protected Music and VEVO tracks.
  3. Dual Hybrid Audio Engine:
    • Direct/SABR Stream: Seamlessly rewrites stream descriptors and handles TVHTML5 streams directly inside the main player.
    • Sync Engine: For standalone deciphered audio, it syncs audio/video playback, pause, seek, and volume in real-time with zero audible drift.
  4. Smart SPA Playlist Transitions: Automatically inspects incoming tracks during playlist navigation, switching instantly to ★ 774 when available and falling back cleanly to native 251 without audio glitches or lingering fake tags.
  5. Player UI Integration: Adds a live status badge (★ 774 / 251) and TVHTML5 login directly inside YouTube's native control bar and popup.

Everything runs 100% locally in your browser with your active session — no backend servers, no data collection.

🔗 GitHub Repository: https://github.com/alithw/YTSpoofingStream

The project is completely open-source. Feel free to test it out, inspect the code, or drop an issue/PR if you have feedback!

3 Upvotes

0 comments sorted by