Skip to content

Instantly share code, notes, and snippets.

@Auax
Last active July 5, 2023 12:38
Show Gist options
  • Save Auax/2aa8b64ba5aad0c8b2089238d29b0cec to your computer and use it in GitHub Desktop.
Save Auax/2aa8b64ba5aad0c8b2089238d29b0cec to your computer and use it in GitHub Desktop.
Userscript to automatically bypass imposed blocks to thepiratebay.org website by redirecting you to a CroxyProxy url. Use tampermonkey or greasemonkey to add this userscript!
// ==UserScript==
// @name ThePirateBay-Block-Redirect
// @namespace http://tampermonkey.net/
// @version 0.1
// @description If thepiratebay is blocked in your country, launch a croxyproxy instance and bypass this!
// @author Auax
// @match https://thepiratebay.org/
// @icon https://www.google.com/s2/favicons?sz=64&domain=thepiratebay.org
// @grant GM_xmlhttpRequest
// ==/UserScript==
(function () {
'use strict';
if (!window.onload) {
// Define the URL you want to load
// Make a request to load the website
GM_xmlhttpRequest({
method: 'POST',
url: 'https://www.croxyproxy.com/requests?fso=',
headers: {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/114.0',
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,*/*;q=0.8',
'Accept-Language': 'en-US,en;q=0.5',
'Content-Type': 'application/x-www-form-urlencoded',
'Upgrade-Insecure-Requests': '1',
'Sec-Fetch-Dest': 'document',
'Sec-Fetch-Mode': 'navigate',
'Sec-Fetch-Site': 'same-origin',
'Sec-GPC': '1'
},
referrer: 'https://www.croxyproxy.com/servers',
data: 'url=thepiratebay.org&proxyServerId=154&demo=0&frontOrigin=https%3A%2F%2Fwww.croxyproxy.com',
onload: function (response) {
// Handle the response here
console.log(response);
const reURL = response.finalUrl;
console.log(reURL);
if (reURL.trim().length !== 0) {
window.location.href = reURL;
}
},
onerror: function(error) {
// Handle any errors here
console.error(error);
}
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment