Skip to content

v0.3.0

Latest

Choose a tag to compare

@alithw alithw released this 16 Nov 04:47

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 SAPISIDHASH headers (15s TTL, invalidated on cookie changes), caches OAuth client tokens in memory, persists lastKnownSts, skips redundant declarativeNetRequest rebuilds via dnrMeta and duplicate keepalive alarm creation, and deduplicates bridge.js settings/locale pushes while ignoring unrelated session storage churn.
  • Non-Blocking Cold Boot: Queues early postToBridge messages until YTSS_BRIDGE_READY, restricts blocking /youtubei/v1/player (1200ms) and /videoplayback (900ms) Async Gates to TV_RELAY so other modes attach asynchronously without delaying initial playback, raises waitForVideo() cold-boot timeout to 45s for slow connections, and preserves pending774 until <video> mounts.
  • Reduced Offscreen Harvester Overhead: Removes muxed formats in src/ytm_harvester_cs.js, keeping only ITAG 774 and 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.onSeek from aborting in-flight seq=1 downloads during early startup, lowers post-buffer audio alignment threshold to > 0.04s, starts <audio> before resuming buffered <video>, waits for AudioSink stabilization (>= 180ms in _alignClockOnPlayback) before locking initial sync, holds advancing silent video early via _startupHoldTimer when initial audio chunks lag, and sets steady-state drift correction to 0.15s.
  • Event & Mode Loop Prevention: Tracks endedVideoId in hookPlayer to prevent false [PlayerReplay] fresh fetches on autoplay track-end, guards TV_RELAY with tvRelayHandlingCurrent to stop repeated [PlayerVideoDataChange] cycles, and prevents onStateChange(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 LUFS loudness normalization (getYoutubeLoudnessNorm / updateNormalizedGain) across track changes, miniplayer toggles, and expand transitions, and restores native playback status/volume (applyNativeStatusUpdate, getNativeAudioInfo) for videos without ITAG 774 / 251.

TVHTML5 Device Login UX

  • Persistent Waiting State & Quick Controls: Persists pendingAuth_TVHTML5 in chrome.storage.session so 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ưu lastKnownSts, bỏ qua dựng lại rule declarativeNetRequest và alarm keepalive dư thừa nhờ dnrMeta, đồng thời chống gửi trùng YTSS_SETTINGS_UPDATE/ngôn ngữ ở bridge.js và bỏ qua thay đổi chrome.storage.session không liên quan.
  • Khởi động bất đồng bộ không chặn phát sớm: Xếp hàng postToBridge cho tới khi YTSS_BRIDGE_READY sẵn sàng, giới hạn Async Gate chặn /youtubei/v1/player (1200ms) và /videoplayback (900ms) cho riêng TV_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ữ pending774 tớ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 774 và 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.onSeek hủy nhầm lượt tải seq=1 ban đầ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 _initialSyncDone sau khi AudioSink ổn định (>= 180ms trong _alignClockOnPlayback), giữ sớm video không tiếng qua _startupHoldTimer nếu audio đầu bài tải chậm và hạ ngưỡng chỉnh trôi ổn định xuống 0.15s.
  • Chặn vòng lặp sự kiện & chế độ phát: Theo dõi endedVideoId trong hookPlayer để tránh trigger [PlayerReplay] fetch mới nhầm khi autoplay sang bài kế tiếp, thêm guard tvRelayHandlingCurrent triệt tiêu lặp [PlayerVideoDataChange] ở TV_RELAY, và không cho onStateChange(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_TVHTML5 trong chrome.storage.session để popup mở lại hoặc Service Worker khởi động lại vẫn giữ trạng thái Waiting... 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