pull/4/head
aria 3 months ago
parent e559886a55
commit 2bbc72fdc0
Signed by: a
GPG Key ID: E851AE999FFCBC37
  1. 5
      docs/SITES.md
  2. 11
      extractors/adlinkfly.js
  3. 46
      extractors/zagl.js
  4. 80
      lib.js
  5. 5
      run.js
  6. 2
      server.js
  7. 4
      static/load.css
  8. 1
      tests.js
  9. 2
      views/home.ejs

@ -21,12 +21,13 @@ Redirects not directly linking to our site may be NSFW and are not endorsements
|**`lnk.parts`**|Puppeteer + Stealth|Yes|[https://lnkload.com/2z8aF](https://lnkload.com/2z8aF)|`link.tl`, `lnkload.com`||
|**`lnk2.cc`**|Puppeteer + Ad & Tracker Blocker + Stealth|Yes|[https://lnk2.cc/wd1J1](https://lnk2.cc/wd1J1)||
|**`mboost.me`**|Axios|No|[https://mboost.me/a/47n](https://mboost.me/a/47n) redirects to `https://www.nukevscity.com/hehehehaw5`|||
|**`myl.li`**|Puppeteer + Ad & Tracker Blocker + Stealth|Yes|[https://myl.li/NOEgI6aOp3bF](https://myl.li/NOEgI6aOp3bF)|`mylink.vc`|||
|**`myl.li`**|Puppeteer + Ad & Tracker Blocker + Stealth|Yes|[https://myl.li/NOEgI6aOp3bF](https://myl.li/NOEgI6aOp3bF)|`mylink.vc`||
|**`oke.io`**|Puppeteer + Stealth|No|[https://oke.io/D3wL](https://oke.io/D3wL) redirects to a broken Mega.nz link.|||
|**`ouo.io`**|Puppeteer + Stealth|Sometimes, only to bypass Cloudflare|[https://ouo.io/2dktqo](https://ouo.io/2dktqo)|`ouo.press`||
|**`sh.st`**|Axios|No|[http://ceesty.com/es47QR](http://ceesty.com/es47QR)|`ceesty.com`, `cestyy.com`, `clkme.me`, `clkmein.com`, `cllkme.com`, `corneey.com`, `destyy.com`, `festyy.com`, `gestyy.com`, `jnw0.me`, `xiw34.com`, `wiid.me`|The list to the right may not be 100% correct or complete.|
|**`show.co`**|Axios|No|[https://show.co/HQrPtta](https://show.co/HQrPtta) redirects to `https://universal-bypass.org/`.||
|**`social-unlock.com`**|Axios|No|[https://social-unlock.com/417pK](https://social-unlock.com/417pK)||
|**`social-unlock.com`**|Axios|No|[https://social-unlock.com/417pK](https://social-unlock.com/417pK)|||
|**`za.gl`**|Puppeteer + Adblocker + Stealth|No|[https://za.gl/JPk6](https://za.gl/JPk6)|`za.uy`, `zee.gl`||
## Generic Sites
|Generic Type|Method|Example Links|Needs CAPTCHA solver?|Example domains|

@ -13,17 +13,10 @@ module.exports = {
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
if (lib.config().fastforward == true && opt?.ignoreFF !== "true") {
if (lib.config().fastforward == true && opt.ignoreFF !== "true" && opt.ignoreFF !== true) {
let r = await lib.fastforward.get(url, true);
if (r !== null) {
f = {
dateSolved: "unknown",
originalUrl: url,
destination: r,
fromCache: false,
fromFastforward: true
};
return f;
return {destination: r, fastforward: true};
}
}

@ -0,0 +1,46 @@
const pup = require("puppeteer-extra");
const stl = require("puppeteer-extra-plugin-stealth");
const adb = require("puppeteer-extra-plugin-adblocker")
const lib = require("../lib");
module.exports = {
hostnames: ["za.uy", "za.gl", "zee.gl"],
requiresCaptcha: false,
get: async function(url) {
let b;
try {
let stlh = stl();
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
pup.use(adb());
if (lib.config().debug == true) console.log("[zagl] Launching browser...");
b = await pup.launch();
let p = await b.newPage();
await p.goto(url);
if (lib.config().debug == true) console.log(`[zagl] Launched. Listening for "/links/go"...`);
p = await fireWhenFound(p);
return p;
} catch(err) {
if (b !== undefined) await b.close();
throw err;
}
}
}
async function fireWhenFound(p) {
return new Promise(function(resolve, reject) {
p.on("response", async function(res) {
let a = new URL((await res.url()));
if (a.pathname == "/links/go" && (await (await(res.request()).method())) == "POST") {
let a = (await res.json());
if (lib.config().debug == true) console.log("[za.gl] Got URL that met requirements, parsing...");
if (a.url) resolve(a.url);
else reject("Redirect not found.");
} else {
if (lib.config().debug == true && a.hostname.includes("za.")) console.log(`[zagl] Ignoring request ${(await (await(res.request()).method()))} "${(await res.url())}" from listener.`);
}
});
});
}

@ -42,19 +42,21 @@ module.exports = {
if (config.db.active == true) {
if (opt.ignoreCache !== "true" && opt.ignoreCache !== true) {
if (config.debug == true) console.log("[db] Checking DB for desination...");
if (links == undefined) await waitUntilDbConnected();
let f = await links.findOne({"originalUrl": url});
if (f == null) f = await links.findOne({"original-url": url});
if (f == null) f = await links.findOne({"original-url": url}); // older version compatibility
if (f !== null) {
if (config.debug == true) console.log("[db] Sending DB response...");
delete f._id;
if (f["date-solved"]) {
if (config.debug == true) console.log("[db] Updating old solution format from DB...");
f = {
dateSolved: f["date-solved"],
originalUrl: f["original-url"],
destination: f["destination"],
}
await links.findOneAndReplace({"original-url": url}, f);
await links.findOneAndReplace({"original-url": url}, f);
}
if (config.debug == true) console.log("[db] Sending DB response...");
f["fromCache"] = true;
f["fromFastforward"] = false;
return f;
@ -72,6 +74,7 @@ module.exports = {
fromCache: false,
fromFastforward: true
};
console.log(f)
return f;
}
}
@ -79,15 +82,39 @@ module.exports = {
f = await extractor.get(url, opt);
if (config.debug == true) console.log(`[extract] Finished "${url}", ${JSON.stringify(opt)} [Solution: ${(f.destination || f.destinations || f)}]`);
if (typeof f == "string") {
if (!this.isUrl(f) || f == url) {
if (typeof f == "string" || typeof f == "object" && !f.destinations) {
if (!this.isUrl((f.destination || f)) || (f.destination || f) == url) {
if (config.debug == true) console.log("[extract] URL was invalid.", (f.destination||f), url);
throw "Invalid URL from backend.";
}
let d = {
"destination": f,
"originalUrl": url,
"dateSolved": (new Date() * 1)
destination: (f.destination || f),
originalUrl: url,
dateSolved: (new Date() * 1)
};
if (f.fastforward == true) {
if (config.debug == true) console.log(`[extract] Detected FastForward response, correcting and sending...`);
if (config.db.active == true) {
if (opt.allowCache !== "false" && opt.allowCache !== false) {
if (config.debug == true) console.log("[db] Checking if data on this link already exists on the DB...");
let f = await links.findOne({"originalUrl": url});
if (f == null) f = await links.findOne({"original-url": url}); // older version compatibility
if (f == null) {
if (config.debug == true) console.log(`[db] Nothing found. Adding FastForward solution to DB...`)
await links.insertOne(d);
if (config.debug == true) console.log(`[db] Added.`);
} else {
if (config.debug == true) console.log(`[db] Data already exists. Continuing correcting and sending...`);
}
}
}
d["destination"] = d.destination;
d["dateSolved"] = "unknown";
d["fromCache"] = false;
d["fromFastforward"] = true;
return d;
}
if (config.fastforward == true && opt?.allowFF !== "false" && opt.allowFF !== false) {
@ -113,7 +140,7 @@ module.exports = {
d["fromFastforward"] = false;
return d;
} else if (typeof f == "object") {
} else if (typeof f == "object" && f.destinations) {
// meant for sites like carrd when i add them
} else {
throw "Invalid response from backend.";
@ -167,18 +194,21 @@ module.exports = {
let b = `domain=${new URL(url).hostname}&path=${new URL(url).pathname.substring(1)}${new URL(url).search}`;
if (config.debug == true) console.log(`[fastforward] Made body content: `, b);
if (config.debug == true) console.log("[fastforward] Checking FastForward crowd bypass...");
let d = await axios({
method: "POST",
url: "https://crowd.fastforward.team/crowd/query_v1",
data: b
data: b,
validateStatus: function() {return true} // Prevent status errors
});
if (config.debug == true) console.log("[fastforward] Recieved response", d.status, d.data);
if (d.status == 204) return null;
else if (d.status == 200) return d.data;
else throw "Invalid response status.";
else {
console.log(`[silent error] FastForward error:\nInvalid response code: ${d.status}\n${d.data}`);
return null;
}
} else {
if (config.debug == true) console.log("[fastforward] Tried to get FastForward URL, not acceptable URL.");
return null;
@ -197,13 +227,17 @@ module.exports = {
let d = await axios({
method: "POST",
url: "https://crowd.fastforward.team/crowd/contribute_v1",
data: b
data: b,
validateStatus: function() {return true} // Prevent status errors
});
if (config.debug == true) console.log("[fastforward] Recieved response", d.status, d.data);
if (d.status == 201) return true;
else throw "Invalid response status.";
else {
console.log(`[silent error] FastForward error:\nInvalid response code: ${d.status}\n${d.data}`);
return null;
}
}
} catch(err) {
throw err;
@ -234,8 +268,26 @@ function isCrowdBypass(host) {
case "gplinks.co":
case "exe.io":
case "exey.io":
case "za.gl":
case "zee.gl":
case "za.uy":
return true;
default:
return false;
}
}
async function waitUntilDbConnected() {
return new Promise(function(resolve, reject) {
try {
let a = setInterval(function() {
if (links !== undefined) {
clearInterval(a);
resolve(true);
}
}, 100);
} catch(err) {
reject(err);
}
});
}

@ -5,6 +5,8 @@ if (process.argv[2]) {
if (process.argv[3]) o.ignoreCache = (toBool(process.argv[3]) || false);
if (process.argv[4]) o.allowCache = (toBool(process.argv[4]) || false);
if (process.argv[3]) o.ignoreFF = (toBool(process.argv[3]) || false);
if (process.argv[4]) o.allowFF = (toBool(process.argv[4]) || false);
if (lib.config().debug == true) console.log(`[runner] URL: `, process.argv[2]);
if (lib.config().debug == true) console.log(`[runner] Options: `, o);
@ -12,6 +14,7 @@ if (process.argv[2]) {
(async function() {
try {
console.log(process.argv[2]);
let solution = await lib.get(process.argv[2], o);
if (lib.config().debug == true) console.log("[runner] Got result, sending into console below:");
console.log((solution.destination || solution.destinations));
@ -22,7 +25,7 @@ if (process.argv[2]) {
}
})();
} else {
console.log(`bifm - console runner\nUsage: node ./run.js "<url>" [ignoreCache: y/(n)] [allowCache: (y)/n]`);
console.log(`bifm - console runner\nUsage: node ./run.js "<url>" [ignoreCache: y/(n)] [allowCache: (y)/n] [ignoreFF: y/(n)] [allowFF: (y)/n]`);
process.exit();
}

@ -31,7 +31,7 @@ app.get("/api/bypass", async function(req, res) {
let resp = await lib.get(url, req.query);
if (lib.config().debug == true) console.log(`[http] Sending response from ./lib.js`);
if (lib.config().debug == true) console.log(`[http] Sending response from ./lib.js`, resp);
res.send({success: true, ...resp});
} catch(err) {
if (lib.config().debug == true) console.log("[http] Recieved error. Displayed below:");

@ -2,12 +2,12 @@
display: inline-block;
position: relative;
width: 80px;
height: 80px;
height: 30px;
}
.lds-ellipsis div {
position: absolute;
top: 33px;
top: 7px;
width: 13px;
height: 13px;
border-radius: 50%;

@ -21,6 +21,7 @@ const examples = [
{ extractor: "sh.st", link: "http://ceesty.com/es47QR" },
{ link: "https://show.co/HQrPtta", expected: "https://universal-bypass.org" },
{ link: "https://social-unlock.com/417pK" },
{ link: "https://za.gl/JPk6" },
{ extractor: "adf.ly", link: "http://usheethe.com/T3F5" },
{ extractor: "adlinkfly", link: "https://pdiskshortener.com/6I2CR2" },
{ extractor: "WPSafelink", link: "https://demo-safelink.themeson.com/template1/?f7fbb8af", expected: "https://themeson.com/safelink/" }

@ -58,7 +58,7 @@
<div class="lds-ellipsis"><div></div><div></div><div></div><div></div></div>
</div>
<div class="result"></div>
</div><br>
</div>
<div class="info">
<p>This instance <i><% if (config.captcha.active) { %> does <% } else { %> does not <% } %></i>support CAPTCHAs.</p>
<p>This instance <i><% if (config.db.active) { %> does <% } else { %> does not <% } %> have</i> a cache.</i></p>

Loading…
Cancel
Save