Automatically bypass the link protector and redirect to the actual link
Size
4.2 KB
Version
1.0.1
Created
Feb 13, 2026
Updated
about 1 month ago
1// ==UserScript==
2// @name Pi.bily.cc Link Protector Bypass
3// @description Automatically bypass the link protector and redirect to the actual link
4// @version 1.0.1
5// @match https://*.pi.bily.cc/*
6// @icon https://pi.bily.cc/img/icon.png
7// @grant GM.openInTab
8// ==/UserScript==
9(function() {
10 'use strict';
11
12 console.log('Pi.bily.cc Link Protector Bypass - Starting...');
13
14 // Function to decode base64 multiple times
15 function decodeBase64Multiple(encoded) {
16 try {
17 let decoded = encoded;
18 // Try decoding up to 5 times (some sites encode multiple times)
19 for (let i = 0; i < 5; i++) {
20 try {
21 const temp = atob(decoded);
22 // Check if it looks like a URL
23 if (temp.startsWith('http://') || temp.startsWith('https://')) {
24 console.log('Found URL after', i + 1, 'decode(s):', temp);
25 return temp;
26 }
27 decoded = temp;
28 } catch (e) {
29 // If decode fails, return what we have
30 break;
31 }
32 }
33 console.log('Final decoded value:', decoded);
34 return decoded;
35 } catch (e) {
36 console.error('Decode error:', e);
37 return null;
38 }
39 }
40
41 // Function to extract and decode the protected link
42 function bypassLinkProtector() {
43 // Get the hash from URL (everything after #)
44 const hash = window.location.hash.substring(1);
45
46 if (!hash) {
47 console.log('No hash found in URL');
48 return;
49 }
50
51 console.log('Found hash:', hash);
52
53 // Decode the hash
54 const decodedUrl = decodeBase64Multiple(hash);
55
56 if (decodedUrl && (decodedUrl.startsWith('http://') || decodedUrl.startsWith('https://'))) {
57 console.log('Bypassing to:', decodedUrl);
58
59 // Redirect to the actual URL
60 window.location.href = decodedUrl;
61 } else {
62 console.log('Could not extract valid URL from hash. Decoded value:', decodedUrl);
63
64 // If we couldn't decode it, try to wait for the page's own mechanism
65 // and intercept any redirects
66 interceptRedirects();
67 }
68 }
69
70 // Function to intercept redirects
71 function interceptRedirects() {
72 console.log('Setting up redirect interception...');
73
74 // Monitor for window.location changes
75 const originalLocationSetter = Object.getOwnPropertyDescriptor(window, 'location').set;
76 Object.defineProperty(window, 'location', {
77 set: function(value) {
78 console.log('Intercepted redirect to:', value);
79 originalLocationSetter.call(window, value);
80 }
81 });
82
83 // Monitor for clicks on the button
84 const button = document.getElementById('contador');
85 if (button) {
86 console.log('Found contador button, monitoring clicks...');
87
88 // Override the button's click handler
89 button.addEventListener('click', function(e) {
90 console.log('Button clicked');
91 }, true);
92 }
93
94 // Watch for any new links or redirects
95 const observer = new MutationObserver(function(mutations) {
96 mutations.forEach(function(mutation) {
97 mutation.addedNodes.forEach(function(node) {
98 if (node.tagName === 'A' && node.href) {
99 console.log('New link detected:', node.href);
100 if (node.href.startsWith('http') && !node.href.includes('pi.bily.cc')) {
101 console.log('Redirecting to:', node.href);
102 window.location.href = node.href;
103 }
104 }
105 });
106 });
107 });
108
109 observer.observe(document.body, {
110 childList: true,
111 subtree: true
112 });
113 }
114
115 // Run when page loads
116 if (document.readyState === 'loading') {
117 document.addEventListener('DOMContentLoaded', bypassLinkProtector);
118 } else {
119 bypassLinkProtector();
120 }
121
122})();