Skip to content

Instantly share code, notes, and snippets.

@bokaif
Last active November 30, 2023 19:10
Show Gist options
  • Save bokaif/500e4114d66df27e45213b9fcaa9c13e to your computer and use it in GitHub Desktop.
Save bokaif/500e4114d66df27e45213b9fcaa9c13e to your computer and use it in GitHub Desktop.
UserScript to remove restrictions from Udvash-Unmesh videos
// ==UserScript==
// @name Udvash-Unmesh Restrictions Remover
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Removes restrictions from Udvash-Unmesh
// @author dumbestbeing
// @match https://online.udvash-unmesh.com/MasterCourse/*
// @match https://online.udvash-unmesh.com/Routine/*
// @grant none
// @run-at document-idle
// ==/UserScript==
(function() {
'use strict';
const url = window.location.href;
if (url.includes("MasterCourse/MasterLectureDetails")) {
const params = new URLSearchParams(window.location.search);
if (params.get('contentType') !== 'video') return;
}
const createButton = () => {
const button = document.createElement('button');
button.textContent = 'Remove Restrictions 🔓';
button.style.position = 'fixed';
button.style.bottom = '25px';
button.style.left = '50%';
button.style.transform = 'translateX(-50%)';
button.style.padding = '10px 20px';
button.style.backgroundColor = '#283045';
button.style.color = 'white';
button.style.border = 'none';
button.style.borderRadius = '25px';
button.style.cursor = 'pointer';
button.style.fontFamily = 'Arial, sans-serif';
button.style.fontSize = '16px';
button.style.zIndex = '9999';
button.addEventListener('mouseover', () => {
button.style.backgroundColor = '#34405e';
});
button.addEventListener('mouseout', () => {
button.style.backgroundColor = '#283045';
});
button.addEventListener('click', () => {
const iframe = document.getElementById('yt-player');
if (iframe && iframe.src) {
const baseUrl = iframe.src.split('?')[0];
window.open(baseUrl, '_blank');
} else {
console.error('Iframe not found or src is empty');
alert('only works on pages with videos');
button.style.display = 'none';
}
});
document.body.appendChild(button);
};
createButton();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment