YTSpoofingStream
Force 100% Genuine Studio Opus 774 Audio on YouTube via Dual-Stream Synchronization Engine
Tip
Enjoying studio-grade sound on YouTube? If this extension improves your music listening experience, please consider giving it a ⭐ Star on GitHub to support the project!
Important
RECOMMENDED: UPDATE TO v0.2.3
v0.2.3 is now the official stable release fixing YouTube player volume/mute controls, track-ending autoplay replay glitches, SABR/UMP micro-gap buffering stalls, and adding full native player loop support. Please see the Release Notes or jump to recent update highlights below.
Warning
Requirement: Active YouTube Premium Subscription
This extension is engineered specifically for users with an active YouTube Premium subscription. YouTube's internal servers only serve unthrottled studio-grade Opus (ITAG 774, ~256k-301kbps, >20kHz) and AAC (ITAG 141, ~256kbps) to authenticated Premium sessions.
Important
Smart TV Authentication (TVHTML5): To unlock zero-delay Direct TV UMP-to-MSE Opus 774 streaming across all video types (including covers and UGC videos not available on YouTube Music), log in via the TVHTML5 section in the popup:
- Open the extension popup and click the Login to TVHTML5 button.
- Ensure you sign in with the Google account that has active YouTube Premium.
- Once authenticated,
HYBRID_HQandTV_HEADLESSautomatically prioritize zero-overhead Direct TV UMP 774 streaming!
Read this in other languages: Tiếng Việt.
📑 Table of Contents
- ✨ Recent Update Highlights (v0.2.3)
- 🌟 Why YTSpoofingStream?
- 🧠 System Architecture (v0.2.3)
- 1. Codebase & Directory Structure
- 2. YouTube's SABR / UMP Infrastructure & Why Legacy Spoofing Fails
- 3. Dual-Engine 774 Acquisition Pipeline (
UmpMseController774+YTM_HARVESTER) - 4. Hardware-Level Descriptor Volume Silencing & Anti-Mute Guard
- 5. Bit-Perfect 1.0x Master Clock & Lag-Resilient Synchronization
- 🎛️ Operation Modes
- 📊 Full-Track FFT Spectrum Benchmark Results
- 🚀 Installation
- 🌐 Localization & Adding Your Language
- ⚙️ Configuration & Controls
- 🐞 Troubleshooting & FAQ
- 💖 Support / Sponsor the Project
- ⭐ Star History
- 🤝 Contributing & Community
- ⚠️ Disclaimer
- 📄 License
✨ Recent Update Highlights (v0.2.3)
The v0.2.3 release resolves critical player interaction and stream transition bugs, ensuring a seamless listening experience:
- 🎚️ Native Player Volume & Mute Controls Restored: Fixed YouTube's internal audio capability probe (
passedProbe) on detached DOM elements, keeping the player volume slider, drag handle, and mute button fully enabled (aria-disabled="false"). - ⏭️ Clean Autoplay Track Transitions: Fixed the track-ending bug where a completed video rewound to 0:00 and replayed for 1–1.5s before advancing. Playback now cleanly pauses at track end and immediately hands off to YouTube's native Autoplay or playlist queue without stutter.
- 🔁 Native Player Loop Support: Respects YouTube player right-click "Loop" and single-track playlist repeat, seamlessly looping both Opus 774 audio and video from 0:00 without triggering premature Autonav.
- ⚡ SABR / UMP Stream Micro-Gap & Duplicate Fetch Resilience: Fixed audio freezes around buffer chunk boundaries (micro-gap stall) via automatic gap-jumping and deduplication in
UmpMseController774, preventing infinite reconnect loops and stuck playback. - 🧠 Direct TV UMP-to-MSE Demuxer (
UmpMseController774): Zero-copy in-page UMP/SABR binary demuxer feedingMediaSource(audio/webm; codecs="opus") with 0 MB background iframe RAM overhead. - 🔇 UI Anti-Mute Guard (
774↔251Transitions): Eliminates player UI muting when switching between 774 and standard videos.
🌟 Why YTSpoofingStream?
Across YouTube's ecosystem today, audio quality is strictly tiered:
- Standard YouTube Web (
www.youtube.com): Artificially limits audio playback to low-bitrate streams (ITAG 251 Opus at ~145–160kbps with a steep brickwall frequency cutoff at 15–16kHz, or ITAG 140 AAC at ~128kbps), even for paying YouTube Premium subscribers. - YouTube Music Web Client (
music.youtube.com): Despite being a dedicated music service, the web browser version of YouTube Music only serves up to AAC 141 (~256kbps) and does not serve ITAG 774 Opus to desktop web browsers. - The Only Places YouTube Serves Opus 774: The highest-fidelity unclipped studio sound (ITAG 774 Opus at ~256k–301kbps with full frequency spectrum exceeding 20,000 Hz) is locked away, served exclusively to YouTube Music mobile apps (Android/iOS) and Smart TV Living Room devices (
TVHTML5).
❓ How Does YTSpoofingStream Unlock Authentic ITAG 774 on Desktop Web?
- Direct TVHTML5 UMP/SABR Demuxing: Queries YouTube's
TVHTML5InnerTube endpoint using your linked TV Premium OAuth token, negotiates an unthrottledITAG 774stream via Google Video's SABR/UMP protocol, and demuxes the binary Opus chunks directly into an in-pageMediaSourcebuffer. - Authenticated YTM Session Harvesting: When TVHTML5 is not linked or a track is YTM-exclusive, an isolated offscreen subframe queries YouTube Music's internal endpoints under emulated high-tier client rules to extract the direct HTTPS Opus 774 URL.
- Dual-Stream Synchronization Engine (
StudioEngine774): Plays the pristine Opus 774 studio stream through a dedicated audio pipeline while silencing the native video's audio at the browser hardware descriptor level, keeping 4K/1080p video and all YouTube UI controls 100% intact.
🧠 System Architecture (v0.2.3)
1. Codebase & Directory Structure
YTSpoofingStream is built with 100% pure vanilla JavaScript (ES6+)—no bundlers, external libraries, or remote dependencies—for maximum speed, security, and auditability:
YTSpoofingStream/
├── manifest.json # Manifest V3 configuration, permissions & content script bindings
├── src/
│ ├── background.js # MV3 Service Worker: InnerTube TV/YTM resolver, OAuth2 & DNR rules
│ ├── inject.js # MAIN world core: StudioEngine774, UmpMseController774, HUD & sync
│ ├── bridge.js # ISOLATED world bridge: Bidirectional message relay (MAIN <-> SW)
│ ├── ytm_harvester_cs.js # MAIN world harvester script inside offscreen YTM subframe
│ ├── harvester.html / .js # Offscreen document container for YTM Harvester
│ └── popup.html / .js # Extension popup UI, live status telemetry & i18n controller
├── assets/
│ └── logo.svg, icon*.png # Extension branding & vector/raster toolbar icons
├── locales/
│ └── en, vi, ja, ru, zh-cn, zh-tw # Built-in i18n dictionaries & translation template
└── .github/
└── CONTRIBUTING.md, ... # Community guidelines, security policy & issue templates
2. YouTube's SABR / UMP Infrastructure & Why Legacy Spoofing Fails
Modern YouTube desktop web streaming uses Google's proprietary SABR (Server-side Adaptive Bitrate) / UMP (Unified Media Protocol):
- The
/youtubei/v1/playerresponse on desktop web no longer exposes standalone media URLs inadaptiveFormats. Instead, encrypted/multiplexed binary chunks are pushed overserverAbrStreamingUrl, strictly capped atITAG 251(~160kbps Opus) for desktop browsers. - Why legacy format-replacement extensions fail:
- Deleting
serverAbrStreamingUrltriggers fatal player errors:80(HTML5_NO_AVAILABLE_FORMATS_FALLBACK). - Injecting mobile/TV URLs directly into YouTube's native player triggers CORS and token-binding errors
s:49(poToken/ client platform mismatch).
- Deleting
3. Dual-Engine 774 Acquisition Pipeline (UmpMseController774 + YTM_HARVESTER)
To guarantee 100% crash-free playback while delivering bit-perfect ITAG 774, YTSpoofingStream v0.2.3 completely decouples video rendering from studio audio acquisition using two specialized engines:
flowchart TD
A["YouTube Watch Page / SPA Navigation"] --> B["MAIN World Engine (src/inject.js)"]
B -->|"Untouched Native Video"| C["YouTube Player (4K/1080p Video Track)"]
B -->|"RESOLVE_VIDEO (src/bridge.js)"| D["Service Worker (src/background.js)"]
D -->|"Engine A: TV Authenticated (100ms Cache / 1.5s Live)"| E["TVHTML5 InnerTube (/player)"]
E -->|"SABR URL + UMP Config"| F["UmpMseController774 (In-Page UMP Demuxer)"]
F -->|"Part 20/21/22 WebM Opus"| G["MediaSource SourceBuffer (0MB Iframe RAM)"]
D -->|"Engine B: YTM Harvester (Fallback or YTM Mode)"| H["Offscreen YTM Frame (src/ytm_harvester_cs.js)"]
H -->|"Direct HTTPS ITAG 774 URL"| I["Direct HTML5 Stream"]
G --> J["StudioEngine774 (<audio> Master Clock)"]
I --> J
J -->|"HTMLMediaElement.prototype.volume = 0"| K["Native Video Silenced at Hardware Level"]
J -->|"Bit-Perfect 1.0x Studio Opus 774 (>20kHz)"| L["Speaker / DAC Output"]
C -.->|"Lag-Resilient Clock Alignment"| J
- Engine A — Direct TV UMP-to-MSE Demuxer (
UmpMseController774):- Uses your authenticated
TVHTML5OAuth2 token insrc/background.jsto fetch the TV/playerresponse (100msfast path on pre-warmed cache,1500mscap on live query). - Constructs custom Protobuf
VideoPlaybackAbrRequestpayloads pinned specifically toITAG 774(rn,rbuf,ClientAbrState, andFormatIddescriptors) and streams the response from Google Video CDN. - Parses Google's binary UMP framing in real time inside
src/inject.js(Part 20 MEDIA_HEADER,Part 21 MEDIA,Part 22 MEDIA_END,Part 35 NEXT_REQUEST_POLICY,Part 43 SABR_REDIRECT,Part 58 STREAM_PROTECTION_STATUS) and appends the raw WebM/Opus initialization and media segments directly into a browserMediaSourceSourceBufferwith automatic sliding-window buffer eviction.
- Uses your authenticated
- Engine B — Authenticated YTM Offscreen Harvester (
YTM_HARVESTER):- Operates in a lightweight offscreen document (
src/harvester.html+src/ytm_harvester_cs.js) backed by scoped Declarative Net Request (DNR) rules to extract direct HTTPSITAG 774URLs from YouTube Music Premium sessions. - Serves as both the primary engine in
YTM_HARVESTERmode and the automatic zero-interruption failover engine inHYBRID_HQmode.
- Operates in a lightweight offscreen document (
4. Hardware-Level Descriptor Volume Silencing & Anti-Mute Guard
Setting video.muted = true or video.volume = 0 via standard DOM properties causes the browser to dispatch volumechange events, which tricks YouTube's player into showing a muted speaker icon and persisting "muted": true into localStorage['yt-player-volume'].
YTSpoofingStream v0.2.3 solves this with a two-layer hardware descriptor shield in src/inject.js:
- Prototype Descriptor Routing: Calls the native
HTMLMediaElement.prototype.volumesetter (descVolume.set.call(video, 0)) directly on the<video>element while intercepting property getters so YouTube's player UI always sees the user's chosen volume and mute state. - Transition Anti-Mute Guard: Suppresses synthetic
volumechangeevents triggered during hardware silencing/restoration (_suppressNextVolumeEvent) and proactively unmutes stale player states when transitioning from a★ 774song to a standard251video (fallbackTo251()), ensuring the player never gets stuck muted across playlist changes.
5. Bit-Perfect 1.0x Master Clock & Lag-Resilient Synchronization
StudioEngine774 treats the studio <audio> stream as the continuous master clock:
- Zero Pitch/Resampling Artifacts:
audio.playbackRateis strictly locked tovideo.playbackRate(1.0xnative playback)—never micro-adjusted with0.99x/1.01xpitch warbling. - SPA Transition Seek Lock: Ignores YouTube's internal SPA reload seeks (
timeJump < -0.25s) during the first1500msof a track switch or whenvideo.currentTime < 1.5s, preventing songs from restarting a second after playback begins. - Lag-Resilient Forward Alignment: When backgrounding tabs or heavy CPU/GPU load causes video frames to drop, the audio continues playing smoothly without interruption. Once the video decoder has sufficient buffered data (
video.readyState >= 3), the video clock gently aligns forward to matchaudio.currentTime(drift > 0.35sthreshold with a2.5scooldown).
🎛️ Operation Modes
| Mode | Name | Primary Acquisition Engine | Failover / Fallback Behavior | Best For |
|---|---|---|---|---|
HYBRID_HQ (Recommended) |
Hybrid Mix (774 Opus ★) | Direct TV UMP-to-MSE 774 (when TV linked) + YTM Harvester | Auto-failovers from TV UMP to YTM Harvester if TV lacks 774; falls back to native 251 if neither has 774 |
Everyday YouTube listening, playlists, MVs & covers |
YTM_HARVESTER |
YTM Harvester Only (774 Opus ★) | Direct HTTPS 774 from YouTube Music Offscreen Harvester | Falls back cleanly to native 251 if no YTM 774 stream exists |
Official music tracks & albums without TV login |
TV_HEADLESS |
Smart TV UMP Only (774 Opus ★) | Direct TVHTML5 UMP/SABR 774 Demuxer via MediaSource (0MB iframe RAM) |
Falls back cleanly to native 251 if no TV login or no TV 774 stream |
Zero-overhead playback, covers, live sessions & UGC videos |
Note
Audio Loudness Characteristics (YouTube Music vs Standard YouTube):
Audio streams harvested from YouTube Music (YTM_HARVESTER) typically have a higher perceived loudness compared to regular YouTube video audio (approximately +3dB to +6dB louder) because YouTube Music master tracks follow dedicated music streaming loudness normalization targets compared to standard YouTube video uploads.
📊 Full-Track FFT Spectrum Benchmark Results
Comprehensive 1x real-time full-duration tests across 4 diverse benchmark tracks with extension ON (Studio 774) vs OFF (Hard Disabled in Chrome Settings):
| Track | Video ID | Full Duration | Native Stream (Extension OFF) | YTSpoofingStream v0.2.3 (774 ON) | High Frequency (>16kHz - 22kHz) |
|---|---|---|---|---|---|
| Track 1 (Song to the Mirrored Moon) | MI4I7v-0tnc |
211.7s (100%) | ITAG 251 (~155kbps) | ITAG 774 (301kbps) | Active (>20,000 Hz) |
| Track 2 (Kirara Magic - Sunny Rain) | Xy6sPZc0CKA |
184.2s (100%) | ITAG 251 (~160kbps) | ITAG 774 (280kbps) | Active (>20,500 Hz) |
| Track 3 (Fontaine) | tiulg9ySfR8 |
185.0s (100%) | ITAG 251 (~160kbps) | ITAG 774 (280kbps) | Active (>21,000 Hz) |
| Track 4 (Dazbee - Chidori Cover) | fs_pEYuMZio |
224.5s (100%) | ITAG 251 (~155kbps) | ITAG 774 (280kbps) | Active (>20,000 Hz) |
Observation: Standard ITAG 251 applies a steep low-pass brickwall filter cutoff at 15.5kHz–16kHz. YTSpoofingStream v0.2.3 delivers unclipped spectral density up to 21kHz+, resulting in noticeably clearer cymbals, vocals, and soundstage.
🚀 Installation
Chromium Browsers (Google Chrome, Brave, Edge, Opera, Cốc Cốc)
- Download or clone the repository:
- For standard users (No Git required):
Click the green Code button at the top of this repository and select Download ZIP (or visit Releases, scroll down to the bottom of the latest release under Assets, and downloadSource code (zip)). Extract the downloaded ZIP file to a folder on your computer. - For developers (using Git):
git clone https://github.com/alithw/YTSpoofingStream.git
- For standard users (No Git required):
- Open
chrome://extensions/and toggle on Developer mode in the top-right corner. - Click Load unpacked and select the root
YTSpoofingStreamfolder (the folder containingmanifest.json). - Open YouTube, ensure you are logged into your Premium account, and verify the
★ 774badge in the player control bar!
Mozilla Firefox / Firefox ESR
Warning
Support for Mozilla Firefox has been officially discontinued as of commit 63ff08d due to technical constraints on the Gecko engine (strict CORS enforcement, background iframe blocking, and MV3 streaming limitations). Please use Chromium-based browsers (Google Chrome, Microsoft Edge, Brave, Opera, Cốc Cốc).
🌐 Localization & Adding Your Language
YTSpoofingStream supports 6 languages out of the box (English, Tiếng Việt, 日本語, Русский, 简体中文, and 繁體中文) with automatic browser language detection.
Want to contribute your language?
We welcome community translations! You can easily add your native language in 3 steps:
- Copy the Template:
Duplicatelocales/template.jsonand rename it to your ISO 639-1 language code (e.g.es.jsonfor Spanish,ko.jsonfor Korean,de.jsonfor German,fr.jsonfor French) inside thelocales/directory. - Translate the Strings:
- Fill in the
_metasection with your language details and your GitHub username for credit. - Translate each value accurately while keeping placeholder tokens (
{version},{method},{label},{error},{url}) and symbols (★,•,↻,⟳) intact.
- Fill in the
- Register & Submit:
- Add your language
<option value="code">Language Name</option>to the#langSelectdropdown insrc/popup.html. - Submit a Pull Request (PR)!
- Add your language
⚙️ Configuration & Controls
- Enable Extension: Master toggle switch. When turned off, completely unhooks all listeners and restores standard native YouTube playback.
- Operation Mode: Switch between
HYBRID_HQ(Recommended),YTM_HARVESTER, orTV_HEADLESS. - Audio-Only Mode: Pauses video element rendering and hides the video canvas (also accessible via the headphone icon right next to the
★ 774badge in the player bar) to save RAM & GPU/CPU while listening to studio audio. - Auto-reload page on change: Automatically reloads the active YouTube tab when switching operation modes.
- Stats for Nerds Override (774 Spoof): Displays live
ITAG 774Opus codec and bitrate telemetry inside YouTube's native Stats for Nerds overlay. - TVHTML5 Login: OAuth2 device-code activation portal for linking your YouTube Premium account to the
TVHTML5engine.
🐞 Troubleshooting & FAQ
Q: Why does the badge show 251 instead of ★ 774?
A: Some videos (such as non-music vlogs, gaming streams, or older uploads) are encoded by YouTube exclusively up to ITAG 251. The extension strictly verifies stream authenticity and falls back cleanly to native 251 audio if no genuine 774 stream exists.
Q: Does this extension affect YouTube Music (music.youtube.com)?
A: Content scripts are excluded from hooking the foreground music.youtube.com UI, however, if you actively browse music.youtube.com in a foreground tab, we recommend switching Enable Extension: OFF in the popup so background Declarative Net Request (DNR) rules for the YTM Harvester do not interfere with foreground music.youtube.com requests. Note that music.youtube.com on desktop browsers only serves up to AAC 141 (~256kbps)—to listen to genuine Opus 774, play your music directly on www.youtube.com with YTSpoofingStream enabled!
💖 Support / Sponsor the Project
If YTSpoofingStream enhances your music listening experience on YouTube, consider supporting its active development and maintenance:
You can sponsor directly via GitHub Sponsors (github.com/sponsors/alithw) or buy a coffee on Ko-fi (ko-fi.com/alithw). Every contribution helps maintain and update the engine against YouTube's frequent backend changes! ☕✨
Star History
🤝 Contributing & Community
Contributions of all kinds are welcome! Whether you are reporting a bug, proposing new stream extraction strategies, or submitting code improvements, please read our community guidelines:
- 📘 Contributing Guide (CONTRIBUTING.md): Local development setup, codebase architecture map, vanilla ES6+ coding standards, and PR submission checklist.
- 📜 Code of Conduct (CODE_OF_CONDUCT.md): Our standards for a welcoming, constructive, and harassment-free community (Contributor Covenant 2.1).
- 🔒 Security Policy (SECURITY.md): Guidelines for responsibly disclosing vulnerabilities.
- 🐛 Report a Bug: Use our structured issue form with video details and player console logs.
- 💡 Request a Feature: Share ideas to enhance audio streaming and client compatibility.
⚠️ Disclaimer
- Independent Project: YTSpoofingStream is an independent, open-source project and is not affiliated, associated, authorized, endorsed by, or in any way officially connected with YouTube, Google LLC, or Alphabet Inc. The official YouTube website can be found at https://www.youtube.com. "YouTube" and "YouTube Music" are registered trademarks of Google LLC.
- No DRM Circumvention: This extension does not bypass Widevine DRM, crack protected content, or provide unauthorized downloads/piracy. It strictly functions within legitimate, authenticated browser sessions to route streams already authorized for the user.
- Educational & Personal Use: This software is provided for educational and personal research purposes only. Use of this software is at your own discretion and responsibility in compliance with YouTube's Terms of Service. The software is provided "as is", without warranty of any kind.
📄 License
Distributed under the Apache License 2.0. See LICENSE for complete details.