text
stringlengths
0
173k
// @connect paper.ostrichesica.com
// @connect balatin.de
// @connect api.bypass.vip
// @connect d17kz3i6hbr7d3.cloudfront.net
// @run-at document-body
// @icon https://www.google.com/s2/favicons?sz=64&domain=https://linkvertise.com
// @grant GM_xmlhttpRequest
// @grant GM_openInTab
// @grant window.onurlchange
// ==/UserScript==
/*
* SETTINGS
* feel free to edit if you know what you're doing :)
*/
const cooldownAfterLoad = 10; //In milliseconds
const openInNewTab = false; //If set to true, make sure to allow popups for the page
let local = true; //Whether to use local bypassing or external fetching of linkvertise links
/*
* MAIN SCRIPT
*/
const excludedDomains = ["link-mutation.linkvertise.com", "cdn.linkvertise.com", "publisher.linkvertise.com", "blog.linkvertise.com"];
const excludedPaths = ["/search", "/assets", "/profile"];
const useStage6 = true;
let bypassActive = false;
if (window.onurlchange === null) {
window.addEventListener('urlchange', (info) => {
startBypass();
});
} else {
startBypass();
}
function startBypass() {
let loc = window.location;
if(bypassActive || excludedDomains.includes(loc.hostname.toLowerCase()) || loc.pathname == "/") {
return;
}
for(let index = 0; index < excludedPaths.length; index++) {
if(loc.pathname.toLowerCase().startsWith(excludedPaths[index])) {
return;
}
}
(async () => {
if(document.contentType == "text/html") {
bypass(loc);
}
})();
}
async function bypass(loc) {
if(loc.hostname == "linkvertise.com" && loc.pathname.startsWith("/") && loc.pathname.split("/").length >= 3) {
bypassActive = true;
if(local) {
$.notify("Bypassing link... Please wait...", {className: "info", autoHideDelay: 10000});
let pathId = loc.pathname.split("/")[1];
let pathName = loc.pathname.split("/")[2];
let dynamic = loc.pathname.includes("/dynamic");
let rId = dynamic && window.location.search.includes("&r=") ? window.location.search.split("&r=")[1].split("&")[0] : dynamic && window.location.search.includes("?r=") ? window.location.search.split("?r=")[1].split("&")[0] : "";
// Stage 1 - Fetch link id
GM_xmlhttpRequest({
method: 'GET',
url: "https://publisher.linkvertise.com/api/v1/redirect/link/" + (dynamic ? "dynamic/" + pathId + "/" + rId : "static/" + pathId + "/" + pathName),
onload: function(resp) {
let response = JSON.parse(resp.responseText);
pathName = response["data"]["link"]["url"];
let target_type = response["data"]["link"]["target_type"];
// Stage 2 - Generate serial
GM_xmlhttpRequest({
method: 'GET',
url: "https://balatin.de/api/serial?p=" + pathName + "&pid=" + pathId + "&id=" + response["data"]["link"]["id"],
onload: function(resp) {
let serialToken = JSON.parse(resp.responseText);
// Stage 3 - Generate cheq token
GM_xmlhttpRequest({
method: 'GET',
url: "https://paper.ostrichesica.com/ct?id=14473&url=" + encodeURIComponent(loc.href),
onload: function(resp) {
let cheqToken = resp.responseText.split("\"jsonp\":\"")[1].split("\"")[0];
// Stage 4 - Traffic validation
GM_xmlhttpRequest({
method: 'POST',
url: "https://publisher.linkvertise.com/api/v1/redirect/link/" + pathId + "/" + pathName + "/traffic-validation",
data: JSON.stringify({"type": "cq","token": cheqToken}),
headers: {
"Content-Type": 'application/json',
},
onload: function(resp) {
response = JSON.parse(resp.responseText);
let requestToken = response["data"]["tokens"]["TARGET"];
// Stage 5 - Get download target
serialToken["token"] = requestToken;
GM_xmlhttpRequest({
method: 'POST',
url: "https://publisher.linkvertise.com/api/v1/redirect/link/" + pathId + "/" + pathName + ((target_type == "PASTE") ? "/paste" : "/target"),