Last active
February 7, 2025 17:05
-
-
Save whomstssecretplayground/48affbdb526fa3fe74323086a493991d to your computer and use it in GitHub Desktop.
Bunkr File Verifyer
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
| // ==UserScript== | |
| // @name Bunkr File Verifyer | |
| // @version 1.1.3 | |
| // @namespace https://github.com/whomstssecretplayground | |
| // @description try to take over the world! | |
| // @author whomstssecretplayground | |
| // @match https://bunkr.*/a/* | |
| // @match https://bunkr.ac/a/* | |
| // @match https://bunkr.ah/a/* | |
| // @match https://bunkr.ax/a/* | |
| // @match https://bunkr.black/a/* | |
| // @match https://bunkr.cat/a/* | |
| // @match https://bunkr.ci/a/* | |
| // @match https://bunkr.cr/a/* | |
| // @match https://bunkr.fi/a/* | |
| // @match https://bunkr.la/a/* | |
| // @match https://bunkr.media/a/* | |
| // @match https://bunkr.ph/a/* | |
| // @match https://bunkr.pk/a/* | |
| // @match https://bunkr.ps/a/* | |
| // @match https://bunkr.red/a/* | |
| // @match https://bunkr.si/a/* | |
| // @match https://bunkr.site/a/* | |
| // @match https://bunkr.sk/a/* | |
| // @match https://bunkr.su/a/* | |
| // @match https://bunkr.ws/a/* | |
| // @match https://bunkrr.*/a/* | |
| // @match https://bunkrr.ru/a/* | |
| // @match https://bunkrr.su/a/* | |
| // @match https://bunkrrr.org/a/* | |
| // @icon https://www.google.com/s2/favicons?sz=64&domain=bunkr.red | |
| // @grant window.focus | |
| // @downloadURL https://gist.githubusercontent.com/whomstssecretplayground/48affbdb526fa3fe74323086a493991d/raw/bunkr_file_verifyer.js | |
| // @updateURL https://gist.githubusercontent.com/whomstssecretplayground/48affbdb526fa3fe74323086a493991d/raw/bunkr_file_verifyer.js | |
| // @run-at document-idle | |
| // ==/UserScript== | |
| // Filter Bunkr Files by feasibility | |
| function getFileSizeMagnitude(mag){ | |
| return mag == "B" ? 0 : mag == "KB" ? 1 : mag == "MB" ? 2 : mag == "GB" ? 3 : mag == "TB" ? 4 : mag == "PB" ? 5 : -1; | |
| } | |
| function compareNum(a, b){ | |
| if (a<b){ | |
| return -1; | |
| } | |
| if (a>b){ | |
| return 1; | |
| } | |
| return 0; | |
| } | |
| function filterBySize(a, b){ | |
| /* | |
| A function that defines the sort order. | |
| The return value should be a number whose sign indicates the relative order of the two elements: negative if a is less than b, positive if a is greater than b, and zero if they are equal. | |
| NaN is treated as 0. | |
| The function is called with the following arguments: | |
| a - The first element for comparison. Will never be undefined. | |
| b - The second element for comparison. Will never be undefined. | |
| If omitted, the array elements are converted to strings, then sorted according to each character's Unicode code point value. | |
| */ | |
| // console.log(a.getElementsByClassName("mt-0 dark:text-white-900")[0].innerHTML); | |
| // var split_size_1 = a.getElementsByClassName("mt-0 dark:text-white-900")[0].innerHTML.split(" "); | |
| // var split_size_2 = b.getElementsByClassName("mt-0 dark:text-white-900")[0].innerHTML.split(" "); | |
| var split_size_1 = a.getElementsByClassName("text-xs theSize mb-1")[0].innerHTML.split(" "); | |
| var split_size_2 = b.getElementsByClassName("text-xs theSize mb-1")[0].innerHTML.split(" "); | |
| //console.log("Comparing: ".concat(split_size_1, " and ", split_size_2)); | |
| if (getFileSizeMagnitude(split_size_1[1]) != getFileSizeMagnitude(split_size_2[1])){ | |
| return compareNum(getFileSizeMagnitude(split_size_1[1]), getFileSizeMagnitude(split_size_2[1])); | |
| } | |
| return compareNum(Number(split_size_1[0]), Number(split_size_2[0])); | |
| } | |
| function urlIsBunkr(){ | |
| // console.log(window.location.href); | |
| return window.location.host.includes("bunkr"); | |
| } | |
| function verfiyContent(elem){ | |
| // var size = elem.getElementsByClassName("mt-0 dark:text-white-900")[0].innerHTML.split(" ")[0]; | |
| var size = elem.getElementsByClassName("text-xs theSize mb-1")[0].innerHTML.split(" ")[0]; | |
| // var mag = getFileSizeMagnitude(elem.getElementsByClassName("mt-0 dark:text-white-900")[0].innerHTML.split(" ")[1]); | |
| var mag = getFileSizeMagnitude(elem.getElementsByClassName("text-xs theSize mb-1")[0].innerHTML.split(" ")[1]); | |
| // console.log(arr[i].getElementsByClassName("mt-0 dark:text-white-900")[0].innerHTML.split(" ")); | |
| if (!((mag >= 3) || (mag == 2 && size >= 300.0))){ | |
| close(); | |
| return; | |
| } | |
| } | |
| function setup(){ | |
| if (!urlIsBunkr()){ | |
| console.log("No bunkr url, exiting...") | |
| return; | |
| } | |
| console.log("Welcome to the Bunkr!"); | |
| try { | |
| var grid_images = document.querySelectorAll(".grid-images")[0]; | |
| var elems = Array.from(grid_images.children); | |
| if (elems.length == 0){ | |
| close(); | |
| return; | |
| } | |
| //console.log(elems); | |
| elems.sort(filterBySize); | |
| //console.log(grid_images.children[0]); | |
| //console.log(elems[0]); | |
| elems.reverse(); | |
| //console.log(elems[0]); | |
| //grid_images.replaceChildren(elems); | |
| verfiyContent(elems[0]); | |
| } catch (error) { | |
| close(); | |
| } | |
| } | |
| // console.log("Coom!"); | |
| setTimeout(setup, 50); | |
| // console.log("Done!"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment