Skip to content

Instantly share code, notes, and snippets.

@nima-rahbar
Created January 30, 2021 13:08
Show Gist options
  • Save nima-rahbar/29f10f083d0977eaa024565c46f69f5f to your computer and use it in GitHub Desktop.
Save nima-rahbar/29f10f083d0977eaa024565c46f69f5f to your computer and use it in GitHub Desktop.
Linkvertise Bypass
// ==UserScript==
// @name Linkvertise Bypass
// @namespace https://github.com/nima-rahbar/
// @version 1.0
// @description Bypass links that cannot be bypassed by Universal Bypass
// @author Nima Rahbar
// @match *://*.linkvertise.com/*
// @match *://*.linkvertise.net/*
// @match *://*.link-to.net/*
// @icon https://nimarahbar.com/wp-content/uploads/2017/07/favicon.png
// @grant GM.xmlHttpRequest
// @downloadURL https://raw.githubusercontent.com/nima-rahbar/Linkvertise-Bypass/main/linkvertise-bypass.js
// @updateURL https://raw.githubusercontent.com/nima-rahbar/Linkvertise-Bypass/main/linkvertise-bypass.js
// ==/UserScript==
var url = window.location.href.toString();
if (url.indexOf("?r=") != -1) {
window.location = atob(decodeURIComponent(url.substr(url.indexOf("?r=") + 3)));
} else {
// iframe check
if (window.parent.location != window.location) { return }
GM.xmlHttpRequest({
method: "GET",
headers: {
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1"
},
url: "https://publisher.linkvertise.com/api/v1/redirect/link" + window.location.pathname + "/captcha",
onload: function () { }
});
GM.xmlHttpRequest({
method: "GET",
headers: {
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1"
},
url: "https://publisher.linkvertise.com/api/v1/redirect/link" + window.location.pathname + "/countdown_impression?trafficOrigin=network",
onload: function () { }
});
GM.xmlHttpRequest({
method: "GET",
headers: {
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1"
},
url: "https://publisher.linkvertise.com/api/v1/redirect/link" + window.location.pathname + "/todo_impression?mobile=true&trafficOrigin=network",
onload: function () { }
});
GM.xmlHttpRequest({
method: "GET",
headers: {
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1"
},
url: "https://publisher.linkvertise.com/api/v1/redirect/link" + window.location.pathname + "/click?trafficOrigin=network",
onload: function () { }
});
let o = {
timestamp: new Date().getTime(),
random: "6548307"
};
var bypass_url = "https://publisher.linkvertise.com/api/v1/redirect/link/static" + window.location.pathname;
GM.xmlHttpRequest({
method: "GET",
headers: {
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1"
},
url: bypass_url,
onload: function (response) {
var json = JSON.parse(response.responseText);
o.link_id = json.data.link.id
bypass_url = "https://publisher.linkvertise.com/api/v1/redirect/link" + window.location.pathname + "/target?serial=" + encodeURIComponent(btoa(JSON.stringify(o)));
GM.xmlHttpRequest({
method: "GET",
headers: {
"User-Agent": "Mozilla/5.0 (iPhone; CPU iPhone OS 13_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1 Mobile/15E148 Safari/604.1"
},
url: bypass_url,
onload: function (response) {
var json = JSON.parse(response.responseText);
window.location = json.data.target;
}
});
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment