Skip to content

Instantly share code, notes, and snippets.

@antoinedelia
Last active June 22, 2023 20:46
Show Gist options
  • Save antoinedelia/8d710433a2bcb9ee654127bba4f83af8 to your computer and use it in GitHub Desktop.
Save antoinedelia/8d710433a2bcb9ee654127bba4f83af8 to your computer and use it in GitHub Desktop.
UserScript to force 1080p60 (Source) video quality on Twitch
// ==UserScript==
// @name Force 1080p60 (Source) video quality on Twitch
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match *://*.twitch.tv/*
// @icon data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==
// @grant none
// @author Antoine Delia
// ==/UserScript==
var desiredQuality = "1080p60 (Source)"
(function() {
'use strict';
var nothing = setInterval(function() {
var settingsButton = document.querySelectorAll('[data-a-target="player-settings-button"]')[0];
if (settingsButton == null) {
return
}
settingsButton.click();
var divs = document.getElementsByTagName("div");
var searchTextQuality = "Quality";
var qualityFound;
for (var i = 0; i < divs.length; i++) {
if (divs[i].textContent == searchTextQuality) {
qualityFound = divs[i];
qualityFound.click();
var searchTextSource = desiredQuality;
var sourceFound;
for (var j = 0; j < divs.length; j++) {
if (divs[i].textContent == searchTextSource) {
sourceFound = divs[i];
sourceFound.click();
break;
}
}
break;
}
}
settingsButton.click();
}, 10000);
})();

UserScript to force 1080p Quality on Twitch

You need to install this in the TamperMonkey extension.

This might break if your default language for Twitch is not English.

You can also change the desired quality by updating the desiredQuality variable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment