Skip to content

Instantly share code, notes, and snippets.

@suderman
Last active April 20, 2022 04:41
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save suderman/e01b73080f29fef9d241 to your computer and use it in GitHub Desktop.
Save suderman/e01b73080f29fef9d241 to your computer and use it in GitHub Desktop.
Plex Fluid userscript
// Change these settings
var username = 'myname',
password = 'mypass',
pin = [0,0,0,0];
// Auto-login
var login = setInterval(function(){
if ($('form#user-account-form').length) {
clearInterval(login);
$('input#username').val(username);
$('input#password').val(password);
$('form#user-account-form').submit();
}
}, 1000);
var login2 = setInterval(function(){
if ($('form#new_user').length) {
clearInterval(login2);
$('input#user_login').val(username);
$('input#user_password').val(password);
$('form#new_user').submit();
}
}, 1000);
// Auto-select first user
var select = setInterval(function(){
if ($('a.user-select-container').length) {
clearInterval(select);
$('a.user-select-container:first').click();
}
}, 1000);
// Auto-unlock with PIN
var unlock = setInterval(function(){
if ($('form#pin-form').length) {
clearInterval(unlock);
$('#pin-form input:nth-of-type(1)').val(pin[0]);
$('#pin-form input:nth-of-type(2)').val(pin[1]);
$('#pin-form input:nth-of-type(3)').val(pin[2]);
$('#pin-form input:nth-of-type(4)').val(pin[3]);
$('#pin-form').submit();
}
}, 1000);
// Auto-close alert bar
var notify = setInterval(function() {
if ($('.alert-bar.notify').length) {
clearInterval(notify);
$('.alert-bar.notify button.close-btn').click();
}
}, 1000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment