Last active
May 19, 2023 15:58
-
-
Save Gaspadlo/6f41a892c6fb2b995d72f2b2b93fab56 to your computer and use it in GitHub Desktop.
F***You_Youtube_1080p.js
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
const error = () => { console.warn('Something went to the sh*tter when setting video quality... FIX ME!'); }; | |
setTimeout(() => { | |
document.querySelector('.ytp-settings-button')?.click?.(); | |
const popup = document.querySelector('.ytp-popup.ytp-settings-menu'); | |
if (!popup) { | |
return error(); | |
} | |
setTimeout(() => { | |
const qualityButton = Array.from(popup.querySelectorAll('.ytp-menuitem')) | |
.filter(node => node.innerText?.includes?.('Auto (360p)')) | |
if (!qualityButton?.[0]?.click) { return error(); } | |
qualityButton?.[0]?.click?.(); | |
setTimeout(() => { | |
const popup = document.querySelector('.ytp-panel.ytp-quality-menu'); | |
const q1080p = Array.from(popup.querySelectorAll('.ytp-menuitem')) | |
.filter(node => node.innerText?.includes?.('1080')) | |
if (!q1080p?.[0]?.click) { return error(); } | |
q1080p?.[0]?.click?.(); | |
}, 10); | |
}, 10); | |
}, 10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment