Last active
December 29, 2024 10:29
-
-
Save Neppu-Nep/6573503acbf7cbd9add04a5d8c9b4569 to your computer and use it in GitHub Desktop.
Youtube membership embed temp fix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==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