Skip to content

Commit

Permalink
YouTube: Audio Only | Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cyfung1031 committed Feb 1, 2024
1 parent c9ac617 commit a3c374a
Showing 1 changed file with 56 additions and 1 deletion.
57 changes: 56 additions & 1 deletion 484611-youtube-audio-only.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// @name YouTube: Audio Only
// @description No Video Streaming
// @namespace UserScript
// @version 1.2.2
// @version 1.2.3
// @author CY Fung
// @match https://www.youtube.com/*
// @match https://www.youtube.com/embed/*
Expand Down Expand Up @@ -1398,6 +1398,61 @@

}

let kz = false;
document.addEventListener('yt-action', function (evt) {

if (kz) return;
let playerKevlar = null;
try {
playerKevlar = window.yt.config_.WEB_PLAYER_CONTEXT_CONFIGS.WEB_PLAYER_CONTEXT_CONFIG_ID_KEVLAR_WATCH;
} catch (e) { }
if (!playerKevlar) return;
kz = true;
// console.log(322, playerKevlar)
playerKevlar.allowWoffleManagement = false;
playerKevlar.cinematicSettingsAvailable = false;
playerKevlar.showMiniplayerButton = false;
playerKevlar.showMiniplayerUiWhenMinimized = false;
playerKevlar.transparentBackground = false;

playerKevlar.enableCsiLogging = false;
playerKevlar.externalFullscreen = false;


if (typeof playerKevlar.serializedExperimentFlags === 'string') {

playerKevlar.serializedExperimentFlags = '';

// playerKevlar.serializedExperimentFlags = playerKevlar.serializedExperimentFlags.replace(/[-\w]+=(\[\]|[.-\d]+|[_a-z]+|)(&|$)/g,'').replace(/&$/,'')



}


if (typeof playerKevlar.serializedExperimentIds === 'string') {

playerKevlar.serializedExperimentIds = '';

// playerKevlar.serializedExperimentIds = playerKevlar.serializedExperimentIds.replace(/\d+\s*(,\s*|$)/g,'')

}

/*
const EXPERIMENT_FLAGS = window.yt.config_.EXPERIMENT_FLAGS
for(const k in EXPERIMENT_FLAGS){
if(EXPERIMENT_FLAGS[k]===true){
EXPERIMENT_FLAGS[k] = false;
}
}
console.log(3277, EXPERIMENT_FLAGS)
*/




}, { capture: true, passive: true, once: true });


let prepared = false;
Expand Down

0 comments on commit a3c374a

Please sign in to comment.