From 8d66143c90c4b86e8ec8dfed67753bef2abf2114 Mon Sep 17 00:00:00 2001 From: Astounds Date: Sun, 3 May 2026 12:32:55 -0500 Subject: fix: update innertube clients and fix HLS/DASH quality switching - Update innertube client versions to match yt-dlp (android 21.02.35, ios 21.02.3, web 2.20260114.08.00, android_vr 1.65.10) - Remove obsolete clients (android-test-suite, ios_vr) - Replace tv_embedded with TVHTML5_SIMPLY (cn 75) - Add new clients: web_embedded, mweb, tv - Fix HLS freeze on quality switch: use nextLevel instead of currentLevel, handle bufferStalledError, stream proxy segments instead of buffering in memory - Populate DASH quality selector with actual sources (no Auto) - Render quality-select empty in template, let JS populate per mode --- youtube/static/js/watch.dash.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'youtube/static/js/watch.dash.js') diff --git a/youtube/static/js/watch.dash.js b/youtube/static/js/watch.dash.js index cb02421..5bbc7a2 100644 --- a/youtube/static/js/watch.dash.js +++ b/youtube/static/js/watch.dash.js @@ -31,9 +31,34 @@ if (data.using_pair_sources) { avMerge = new AVMerge(video, srcPair, 0); } -// Quality selector +// Quality selector — populate with available sources const qs = document.getElementById('quality-select'); if (qs) { + // Clear the HLS-oriented "Auto" default; DASH has discrete sources + qs.innerHTML = ''; + + // Add pair_sources (video+audio, used by AVMerge) + if (data['pair_sources'] && data['pair_sources'].length) { + data['pair_sources'].forEach(function(src, i) { + let opt = document.createElement('option'); + opt.value = JSON.stringify({type: 'pair', index: i}); + opt.textContent = src.quality_string; + if (i === data['pair_idx']) opt.selected = true; + qs.appendChild(opt); + }); + } + + // Add uni_sources (integrated video+audio, single file) + if (data['uni_sources'] && data['uni_sources'].length) { + data['uni_sources'].forEach(function(src, i) { + let opt = document.createElement('option'); + opt.value = JSON.stringify({type: 'uni', index: i}); + opt.textContent = src.quality_string; + if (!data['pair_sources'].length && i === data['uni_idx']) opt.selected = true; + qs.appendChild(opt); + }); + } + qs.addEventListener('change', function(e) { changeQuality(JSON.parse(this.value)) }); -- cgit v1.2.3