Skip to content

Instantly share code, notes, and snippets.

@Neppu-Nep
Last active December 29, 2024 10:29
Show Gist options
  • Save Neppu-Nep/6573503acbf7cbd9add04a5d8c9b4569 to your computer and use it in GitHub Desktop.
Save Neppu-Nep/6573503acbf7cbd9add04a5d8c9b4569 to your computer and use it in GitHub Desktop.
Youtube membership embed temp fix
// ==UserScript==
// @name Youtube Membership Embed Temp Fix
// @version 2024-12-29
// @description Temp fix for membership embeds
// @author Nep
// @match https://www.youtube.com/embed/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=youtube.com
// @grant unsafeWindow
// @run-at document-start
// ==/UserScript==
function fixMembership() {
if (!unsafeWindow.ytcfg) {
setTimeout(fixMembership, 50);
return;
}
let player_vars = unsafeWindow.ytcfg.data_.PLAYER_VARS;
let statusVar = JSON.parse(player_vars.embedded_player_response);
statusVar.previewPlayabilityStatus.status = "OK";
unsafeWindow.ytcfg.data_.PLAYER_VARS.embedded_player_response = JSON.stringify(statusVar);
}
(function() {
'use strict';
fixMembership();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment