sbltnfi-preset-replace.user.js
Replaces or redirct all sb.ltn.fi links to be pre-loaded with filters Idea from Blabdude's Script but no code was taken
sbltnfi-preset-replace.user.js
Replaces or redirct all sb.ltn.fi links to be pre-loaded with filters Idea from Blabdude's Script but no code was taken
// ==UserScript== | |
// @name sb.ltn.fi preset redirect + replace | |
// @namespace https://github.com/x1yl | |
// @version 1.0.4 | |
// @description Completely rewrote sb.ltn.fi preset redirect + replace by blabdude. Change filters to your liking below. | |
// @author Xtyl | |
// @updateURL https://gist.githubusercontent.com/x1yl/12156c5487fbd5fe5141f0c142143e0c/raw/sbltnfi-preset-replace.user.js | |
// @downloadURL https://gist.githubusercontent.com/x1yl/12156c5487fbd5fe5141f0c142143e0c/raw/sbltnfi-preset-replace.user.js | |
// @match https://sb.ltn.fi/video/* | |
// @match https://sb.ltn.fi/uuid/* | |
// @match https://sb.ltn.fi/username/* | |
// @match https://sb.ltn.fi/userid/* | |
// @icon https://sb.ltn.fi/static/browser/logo.png | |
// @run-at document-start | |
// @grant none | |
// ==/UserScript== | |
// custom filters for SBB | |
const sort = "starttime"; | |
const views = 1; | |
const votes = 0; | |
// variables used to see if its a video or user | |
var currentUrl = location.href; | |
var videowords = ["sort", "views_min", "votes_min"]; | |
var userwords = ["views_min", "votes_min"]; | |
var video = ["video", "uuid", "uuid"]; | |
var user = ["username", "userid"]; | |
// if its a video add on video preset | |
for (var i = 0; i < videowords.length; i++) { | |
if ( | |
currentUrl.includes(videowords[i]) == false && | |
currentUrl.includes(video[i]) == true | |
) { | |
location.replace( | |
"?votes_min=" + votes + "&views_min=" + views + "&sort=" + sort + "" | |
); | |
break; | |
} | |
} | |
// if its a user add on user preset | |
for (i = 0; i < userwords.length; i++) { | |
if ( | |
currentUrl.includes(userwords[i]) == false && | |
currentUrl.includes(user[i]) == true | |
) { | |
location.replace("?votes_min=" + votes + "&views_min=" + views + ""); | |
break; | |
} | |
} |