Repository navigation
YTSpoofingStream v0.3.0 — Startup Optimization, Next-Track Sync Fixes, Volume Balance & TV OAuth UX
v0.3.0 improves cold-start loading speed, fixes next-track stuttering and A/V clock desync across playback modes and throttled networks, stabilizes Volume Balance across miniplayer and native fallback transitions, and adds persistent TVHTML5 device-auth waiting controls.
Startup & Loading Optimization
- Service Worker & Bridge Caching: Caches
SAPISIDHASHheaders (15s TTL, invalidated on cookie changes), caches OAuth client tokens in memory, persistslastKnownSts, skips redundantdeclarativeNetRequestrebuilds viadnrMetaand duplicate keepalive alarm creation, and deduplicatesbridge.jssettings/locale pushes while ignoring unrelated session storage churn. - Non-Blocking Cold Boot: Queues early
postToBridgemessages untilYTSS_BRIDGE_READY, restricts blocking/youtubei/v1/player(1200ms) and/videoplayback(900ms) Async Gates toTV_RELAYso other modes attach asynchronously without delaying initial playback, raiseswaitForVideo()cold-boot timeout to 45s for slow connections, and preservespending774until<video>mounts. - Reduced Offscreen Harvester Overhead: Removes muxed formats in
src/ytm_harvester_cs.js, keeping onlyITAG 774and the lowest-bitrate video format, and extends offscreen idle lifetime to 180s to cut repeated cold re-spawns.
Next-Track Transitions, Seek Locking & A/V Sync
- Eliminated Mid-Opening Freezes & Startup Desync: Prevents
UmpMseController774.onSeekfrom aborting in-flightseq=1downloads during early startup, lowers post-buffer audio alignment threshold to> 0.04s, starts<audio>before resuming buffered<video>, waits for AudioSink stabilization (>= 180msin_alignClockOnPlayback) before locking initial sync, holds advancing silent video early via_startupHoldTimerwhen initial audio chunks lag, and sets steady-state drift correction to0.15s. - Event & Mode Loop Prevention: Tracks
endedVideoIdinhookPlayerto prevent false[PlayerReplay]fresh fetches on autoplay track-end, guardsTV_RELAYwithtvRelayHandlingCurrentto stop repeated[PlayerVideoDataChange]cycles, and preventsonStateChange(2)from pausing<audio>during internal buffer waits (_pausedForAudioBuffer). - Slow Network Seek Alignment: Keeps video paused cleanly until target audio chunks finish buffering on throttled network seeks.
Volume Balance & Fallback Stability
- Consistent Normalization & Native Fallback: Updates
-14 LUFSloudness normalization (getYoutubeLoudnessNorm/updateNormalizedGain) across track changes, miniplayer toggles, and expand transitions, and restores native playback status/volume (applyNativeStatusUpdate,getNativeAudioInfo) for videos withoutITAG 774/251.
TVHTML5 Device Login UX
- Persistent Waiting State & Quick Controls: Persists
pendingAuth_TVHTML5inchrome.storage.sessionso reopened popups or restarted service workers resume polling cleanly, and adds a click-to-copy code box, a copy-and-open activate button, and an inline new-code button in all 6 supported locales.
YTSpoofingStream v0.3.0 — Tối ưu khởi động, sửa giật chuyển bài, Volume Balance & UX đăng nhập TV
v0.3.0 tối ưu tốc độ nạp khi khởi động, khắc phục hiện tượng giật cục và lệch đồng bộ A/V khi chuyển bài trên các chế độ phát và mạng chậm, ổn định Volume Balance qua miniplayer/fallback, đồng thời bổ sung trạng thái chờ bền vững và thao tác nhanh cho đăng nhập TVHTML5.
Tối ưu tốc độ nạp & khởi động
- Cache trong Service Worker & Bridge: Cache
SAPISIDHASH(TTL 15s, tự hủy khi cookie đổi), cache token OAuth trên bộ nhớ, lưulastKnownSts, bỏ qua dựng lại ruledeclarativeNetRequestvà alarm keepalive dư thừa nhờdnrMeta, đồng thời chống gửi trùngYTSS_SETTINGS_UPDATE/ngôn ngữ ởbridge.jsvà bỏ qua thay đổichrome.storage.sessionkhông liên quan. - Khởi động bất đồng bộ không chặn phát sớm: Xếp hàng
postToBridgecho tới khiYTSS_BRIDGE_READYsẵn sàng, giới hạn Async Gate chặn/youtubei/v1/player(1200ms) và/videoplayback(900ms) cho riêngTV_RELAYđể các chế độ khác nâng cấp luồng âm thanh bất đồng bộ ngay khi phát, tăng ngưỡng chờ<video>khi cold-boot lên 45s cho mạng chậm và giữpending774tới khi thẻ<video>xuất hiện. - Giảm tải YTM Harvester: Loại bỏ định dạng muxed cũ trong
src/ytm_harvester_cs.jsđể chỉ giữITAG 774và 1 luồng video bitrate thấp nhất, đồng thời tăng thời gian giữ tài liệu offscreen lên 180s.
Chuyển bài, giữ nhịp tua & đồng bộ A/V
- Giảm khựng đầu bài và lệch A/V: Ngăn
UmpMseController774.onSeekhủy nhầm lượt tảiseq=1ban đầu, hạ ngưỡng căn chỉnh âm thanh sau nạp đệm xuống> 0.04s, kích hoạt<audio>phát trước khi mở khóa<video>, chỉ khóa_initialSyncDonesau khi AudioSink ổn định (>= 180mstrong_alignClockOnPlayback), giữ sớm video không tiếng qua_startupHoldTimernếu audio đầu bài tải chậm và hạ ngưỡng chỉnh trôi ổn định xuống0.15s. - Chặn vòng lặp sự kiện & chế độ phát: Theo dõi
endedVideoIdtronghookPlayerđể tránh trigger[PlayerReplay]fetch mới nhầm khi autoplay sang bài kế tiếp, thêm guardtvRelayHandlingCurrenttriệt tiêu lặp[PlayerVideoDataChange]ởTV_RELAY, và không choonStateChange(2)tự pause<audio>trong lúc đang chờ đệm nội bộ (_pausedForAudioBuffer). - Đồng bộ khi tua trên mạng chậm: Giữ
<video>đồng bộ cùng tiến trình tải phân đoạn audio khi tua trên mạng tốc độ thấp.
Volume Balance & ổn định fallback
- Chuẩn hóa âm lượng & hoàn nguyên trình phát gốc: Cập nhật hệ số chuẩn hóa
-14 LUFS(getYoutubeLoudnessNorm/updateNormalizedGain) ổn định qua chuyển bài, bật/tắt miniplayer và mở rộng lại trang xem; trả đúng thông tin audio/âm lượng trình phát gốc (applyNativeStatusUpdate,getNativeAudioInfo) cho video không cóITAG 774/251.
Trải nghiệm chờ đăng nhập TVHTML5
- Giữ trạng thái chờ & thao tác nhanh: Lưu
pendingAuth_TVHTML5trongchrome.storage.sessionđể popup mở lại hoặc Service Worker khởi động lại vẫn giữ trạng tháiWaiting...và tiếp tục polling, kèm ô bấm sao chép mã, nút sao chép & mở thẳng trang kích hoạt và nút cấp mã mới ngay trong dòng hướng dẫn chờ trên cả 6 ngôn ngữ.
Full Changelog: v0.2.7...v0.3.0