add testing, more debug logs in all extractors and lib.js, add mboost.me to docs with example

pull/4/head
aria 3 months ago
parent 2a279d91f2
commit dbd35e4610
Signed by: a
GPG Key ID: E851AE999FFCBC37
  1. 4
      README.md
  2. 17
      docs/SITES.md
  3. 9
      extractors/123link.js
  4. 14
      extractors/1bitspace.js
  5. 2
      extractors/1link.js
  6. 13
      extractors/adlinkfly.js
  7. 11
      extractors/bcvc.js
  8. 10
      extractors/boost.js
  9. 3
      extractors/boostme.js
  10. 6
      extractors/cpmlink.js
  11. 9
      extractors/cshort.js
  12. 17
      extractors/exeio.js
  13. 9
      extractors/generic.js
  14. 3
      extractors/ity.js
  15. 4
      extractors/karung.js
  16. 17
      extractors/linktl.js
  17. 30
      extractors/linkvertise.js
  18. 12
      extractors/lnk2.js
  19. 4
      extractors/mboost.js
  20. 27
      extractors/mylink.js
  21. 13
      extractors/oke.js
  22. 16
      extractors/ouo.js
  23. 5
      extractors/show.js
  24. 10
      extractors/shst.js
  25. 11
      extractors/socialUnlock.js
  26. 5
      lib.js
  27. 7
      main.js
  28. 61
      tests.js

@ -17,13 +17,13 @@ If you would rather use the Unlicense version, use [this commit and behind](http
- Improve frontend site.
- Detect when the site itself is down via the frontend, like previous version.
- Heroku (and similar services) support (with guide, if difficult).
- Add tests.
- Add passworded-link support.
- Add multi-link support.
### Sites being planned
There's a general need on our part to support all sites that previously were supported, but these are also some we would like to get done.
- exe.io [[sample link](https://exe.io/ZaKsUgDc)]
- linkatii [[sample link](https://dz-linkk.com/N2xFP)]
- url2go.in [[sample link](https://url2go.in/Exeg2)]
- carrd.co

@ -2,27 +2,30 @@
Sites supported by BIFM currently. Example links redirect to `https://git.gay/a/bifm` unless otherwise stated.
Redirects not directly linking to our site may be NSFW and are not endorsements of the content.
|Domain|Method|Needs CAPTCHA solver?|Example Links|Additional Domains|Additional Notes|
|---|---|---|---|---|---|
|**`1bit.space`**|Puppeteer + Adblocker + Stealth|Yes|[https://1bit.space/FVJcWHr](https://1bit.space/FVJcWHr) redirects to ``https://universal-bypass.org/``.||
|**`1link.club`**|Axios|No|||
|**`1link.club`**|Axios|No|[http://1link.club/77679](http://1link.club/77679)|||
|**`123link.pw`**|Puppeteer + Adblocker + Stealth|Yes||`123link.biz`, `123link.co`, `123link.vip`||
|**`bc.vc`**|Puppeteer + Stealth|No|[https://bc.vc/vQesLIh](https://bc.vc/vQesLIh) redirects to ``https://universal-bypass.org/``.||
|**`bc.vc`**|Puppeteer + Stealth|No|[https://bc.vc/vQesLIh](https://bc.vc/vQesLIh) redirects to `https://universal-bypass.org/`.||
|**`boost.ink`**|Axios|No|[https://boost.ink/c5bba](https://boost.ink/c5bba)|`bst.gg`, `bst.wtf`, `booo.st`||
|**`boostme.link`**|Axios|No|[https://boostme.link/iX9Krf](https://boostme.link/iX9Krf)||
|**`cpmlink.net`**|Axios|Yes|[https://cpmlink.net/i7FyAQ](https://cpmlink.net/i7FyAQ)||
|**`cshort.org`**|Axios|No|[https://cshort.org/8i8dwPx0](https://cshort.org/8i8dwPx0)|
|**`exe.io`**|Puppeteer + Stealth|Yes|[https://exe.io/ZaKsUgDc](https://exe.io/ZaKsUgDc)|`exey.io`||
|**`ity.im`**|Axios|No|[http://ity.im/1QZh2](http://ity.im/1QZh2)||
|**`karung.in`**|Axios|No|[http://karung.in/Gyucc](http://karung.in/Gyucc) redirects to a broken Google Drive link.|||
|**`linkvertise.net`**|Puppeteer + Adblocker|Yes|[https://linkvertise.com/431184/roblox-scripts-website](https://linkvertise.com/431184/roblox-scripts-website) redirects to `https://tobirbxscripts.blogspot.com/`|`linkvertise.com`, `up-to-down.net`, `link-to.net`, `direct-link.net`, `linkvertise.download`, `file-link.net`, `link-center.net`, `link-target.net`|Not 100% compatible yet, need paste Linkvertise links as well.|
|**`ity.im`**|Axios|No|[http://ity.im/1QZh2](http://ity.im/1QZh2)|||
|**`karung.in`**|Axios|No|[http://karung.in/Gyucc](http://karung.in/Gyucc) redirects to `https://drive.google.com/uc?id=0B263gKU-C09_WW5rbURLeXN5QXc&export=download`.||Passworded links are currently not supported.|
|**`linkvertise.net`**|Puppeteer + Ad & Tracker Blocker + Stealth|Yes|[https://linkvertise.com/431184/roblox-scripts-website](https://linkvertise.com/431184/roblox-scripts-website) redirects to `https://tobirbxscripts.blogspot.com/`|`linkvertise.com`, `up-to-down.net`, `link-to.net`, `direct-link.net`, `linkvertise.download`, `file-link.net`, `link-center.net`, `link-target.net`|Not 100% compatible yet, need paste Linkvertise links as well.|
|**`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`|||
|**`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.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/``.||
|**`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)||
## Generic Sites

@ -16,7 +16,9 @@ module.exports = {
let b;
try {
pup.use(adb());
pup.use(stl());
let stlh = stl();
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
if (lib.config().captcha.active == false) {
throw "Captcha service is required for this link, but this instance doesn't support it."
@ -29,11 +31,14 @@ module.exports = {
}
}));
if (lib.config()["debug"] == true) console.log("[123link] Launching browser...");
b = await pup.launch({headless: true});
let p = await b.newPage();
await p.goto(url);
if (lib.config()["debug"] == true) console.log("[123link] Solving CAPTCHA...");
await p.solveRecaptchas();
if (lib.config()["debug"] == true) console.log("[123link] Solved CAPTCHA. Now submitting form...");
await p.evaluate(function() {
if (typeof document.querySelector("form").submit == "function") document.querySelector("form").submit();
@ -43,9 +48,11 @@ module.exports = {
await p.waitForNavigation();
let u;
if (lib.config()["debug"] == true) console.log("[123link] Retrieving link...");
await p.waitForSelector(".btn-success:not([disabled]):not([href='javascript: void(0)'])");
u = await p.evaluate(function() {return document.querySelector(".btn-success:not([disabled]):not([href='javascript: void(0)'])").href;});
if (lib.config()["debug"] == true) console.log("[123link] Closing browser...");
await b.close();
return u;
} catch(err) {

@ -13,7 +13,10 @@ module.exports = {
let b;
try {
pup.use(adb());
pup.use(stl());
let stlh = stl();
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
if (lib.config().captcha.active == false) {
throw "Captcha service is required for this link, but this instance doesn't support it."
@ -26,27 +29,36 @@ module.exports = {
}
}));
if (lib.config()["debug"] == true) console.log("[1bitspace] Launching browser...");
b = await pup.launch({headless: true});
let p = await b.newPage();
await p.goto(url);
// first page
if (lib.config()["debug"] == true) console.log("[1bitspace] Solving captchas...");
await p.solveRecaptchas();
if (lib.config()["debug"] == true) console.log("[1bitspace] Solved.");
await p.click(".button-element-verification");
if (lib.config()["debug"] == true) console.log("[1bitspace] Loading second page...");
// second page
if (lib.config()["debug"] == true) console.log("[1bitspace] Counting down...");
await p.waitForSelector(".button-element-redirect:not([disabled])");
await p.click(".button-element-redirect:not([disabled])");
if (lib.config()["debug"] == true) console.log("[1bitspace] Loading third page...");
await p.waitForNavigation();
// third page
if (lib.config()["debug"] == true) console.log("[1bitspace] Counting down (2)...");
await p.waitForSelector("#continue-button:not([disabled])");
await p.click("#continue-button:not([disabled])");
if (lib.config()["debug"] == true) console.log("[1bitspace] Loading last page...");
await p.waitForNavigation();
let u = await p.url();
if (lib.config()["debug"] == true) console.log("[1bitspace] Closing browser...");
await b.close();
return u;

@ -7,6 +7,7 @@ module.exports = {
"requires-captcha": false,
get: async function(url) {
try {
if (lib.config()["debug"] == true) console.log("[1link] Requesting page...");
let resp = await axios({
method: "GET",
url: url,
@ -16,6 +17,7 @@ module.exports = {
}
});
if (lib.config().debug == true) console.log("[1link] Got page. Parsing page...");
let $ = cheerio.load(resp.data);
if (lib.isUrl($("#download")[0]?.attribs?.href)) return $("#download")[0]?.attribs?.href;

@ -9,7 +9,9 @@ module.exports = {
get: async function(url) {
let b;
try {
pup.use(stl());
let stlh = stl();
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
if (lib.config().captcha.active == false) {
throw "Captcha service is required for this link, but this instance doesn't support it."
@ -22,6 +24,7 @@ module.exports = {
}
}));
if (lib.config().debug == true) console.log("[adflylink] Launching browser...");
b = await pup.launch({headless: true});
let p = await b.newPage();
await p.goto(url);
@ -40,13 +43,19 @@ async function cont(p, url) {
else return false;
});
if (isCaptcha) await p.solveRecaptchas();
if (isCaptcha) {
if (lib.config().debug == true) console.log("[adflylink] Solving CAPTCHA...");
await p.solveRecaptchas();
if (lib.config().debug == true) console.log("[adflylink] Solved CAPTCHA. Continuing page...");
}
if ((await p.$("#countdown"))) {
if (lib.config().debug == true) console.log("[adflylink] Retreiving link...");
await p.waitForSelector(".btn-success.btn-lg:not(.disabled)");
let r = await p.evaluate(function() {return document.querySelector(".btn-success").href});
return r;
} else {
if (lib.config().debug == true) console.log("[adflylink] Auto-submitting form...");
await p.evaluate(function() {
document.querySelector("form").submit();
});

@ -1,5 +1,6 @@
const pup = require("puppeteer-extra");
const stl = require("puppeteer-extra-plugin-stealth");
const lib = require("../lib");
module.exports = {
hostnames: [
@ -7,22 +8,28 @@ module.exports = {
"bcvc.live",
"ouo.today"
],
"requires-captcha": true,
"requires-captcha": false,
get: async function (url) {
let b;
try {
// setup plugins
pup.use(stl());
let stlh = stl();
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
if (lib.config().debug == true) console.log("[bcvc] Launching browser...");
b = await pup.launch({headless: true});
let p = await b.newPage();
await p.goto(url);
if (lib.config().debug == true) console.log("[bcvc] Launched. Counting down...");
await p.waitForSelector("#getLink", {visible: true});
await p.click("#getLink");
await p.waitForNavigation();
let u = await p.url();
if (lib.config().debug == true) console.log("[bcvc] Done. Decoding URL...");
u = new URL(u);
u = u.searchParams.get("cr");
u = Buffer.from(u, "base64").toString("ascii");

@ -1,11 +1,13 @@
const axios = require("axios");
const cheerio = require("cheerio");
const lib = require("../lib");
module.exports = {
hostnames: ["bst.gg", "bst.wtf", "booo.st", "boost.ink"],
"requires-captcha": false,
get: async function(url) {
try {
if (lib.config().debug == true) console.log("[boost] Requesting page...");
let resp = await axios({
method: "GET",
url: url,
@ -22,12 +24,15 @@ module.exports = {
let attr;
let scr;
if (lib.config().debug == true) console.log("[boost] Got page. Scanning scripts...");
for (let a in $("script")) {
if (typeof $("script")[a] == "object") {
if ($("script")[a].attribs && $("script")[a].attribs.src && $("script")[a].attribs.src.includes("unlock")) {
scr = $("script")[a].attribs;
let b = (await axios(`https://boost.ink${$("script")[a].attribs.src}`)).data;
if (lib.config().debug == true) console.log("[boost] Found unlock.js script. Requesting...");
let b = (await axios(`https://boost.ink${scr["src"]}`)).data;
if (lib.config().debug == true) console.log("[boost] Got script. Searching for attribute needed to decode...");
attr = b.split(`dest=`)[1].split(`currentScript.getAttribute("`)[1].split(`"`)[0];
}
}
@ -35,6 +40,7 @@ module.exports = {
if (attr == undefined) throw "Boost.ink has updated their unlock script. Please update this script to accomodate for this.";
if (lib.config().debug == true) console.log("[boost] Done. Decoding original page...");
return Buffer.from(scr[attr], "base64").toString("ascii");
} catch(err) {
throw err;

@ -1,11 +1,13 @@
const axios = require("axios");
const cheerio = require("cheerio");
const lib = require("../lib");
module.exports = {
hostnames: ["boostme.link"],
"requires-captcha": false,
get: async function(url) {
try {
if (lib.config().debug == true) console.log("[boostme] Requesting page...");
let resp = await axios({
method: "GET",
url: url,
@ -16,6 +18,7 @@ module.exports = {
});
let $ = cheerio.load(resp.data);
if (lib.config().debug == true) console.log("[boostme] Got page. Decoding page...");
return Buffer.from($(".main #home").attr("data-url"), "base64").toString("ascii");
} catch(err) {

@ -12,6 +12,7 @@ module.exports = {
throw "Captcha service is required for this link, but this instance doesn't support it."
}
if (lib.config().debug == true) console.log("[cpmlink] Requesting page...");
let resp = await axios({
method: "GET",
url: url,
@ -24,6 +25,7 @@ module.exports = {
}
});
if (lib.config().debug == true) console.log("[cpmlink] Got page. Parsing page...");
let $ = cheerio.load(resp.data);
let k = $("#skip [name=key]").val();
let t = $("#skip [name=time]").val();
@ -33,12 +35,15 @@ module.exports = {
let s = $("#captcha").attr("data-sitekey");
let c = lib.cookieString(scp(resp.headers["set-cookie"]));
if (lib.config().debug == true) console.log("[cpmlink] Parsed. Solving CAPTCHA...");
let cap = await lib.solve(s, "recaptcha", {
referer: url
});
if (lib.config().debug == true) console.log("[cpmlink] Solved CAPTCHA.");
let body = `key=${k}&time=${t}&ref=${r}&s_width=${w}&s_height=${h}&g-recaptcha-response=${cap}`;
if (lib.config().debug == true) console.log("[cpmlink] Requesting solve page...");
resp = await axios({
method: "POST",
data: body,
@ -62,6 +67,7 @@ module.exports = {
"Upgrade-Insecure-Requests": "1"
}
});
if (lib.config().debug == true) console.log("[cpmlink] Parsing solve page...");
$ = cheerio.load(resp.data);
return $("#continue a").attr("href");
} catch(err) {

@ -7,6 +7,7 @@ module.exports = {
"requires-captcha": false,
get: async function (url) {
try {
if (lib.config().debug == true) console.log("[cshort] Requesting page...");
let resp = await axios({
method: "GET",
url: url,
@ -21,18 +22,22 @@ module.exports = {
}
});
if (lib.config().debug == true) console.log("[cshort] Getting next page URL (1/2)...");
let r = resp.data.split(`function redirect() {`)[1].split(`}`)[0].split(`\n`);
let h;
let c = `${lib.cookieString(scp(resp.headers["set-cookie"]))}; aid=${encodeURIComponent(JSON.stringify([new URL(url).pathname.substring(1)]))}`;
if (lib.config().debug == true) console.log("[cshort] Getting next page URL (2/2)");
for (let a in r) {
if (!r[a].startsWith(" //") && r[a] !== "") h = r[a].split(`?u=`)[1].split(`',`)[0];
}
if (h == undefined) throw "No redirects found.";
if (lib.config().debug == true) console.log("[cshort] Counting down...");
await new Promise(resolve => setTimeout(resolve, 10000)); // can't bypass the wait, unfortunately
if (lib.config().debug == true) console.log("[cshort] Requesting next page URL...");
resp = await axios({
method: "GET",
url: `${url}?u=${h}`,
@ -56,7 +61,7 @@ module.exports = {
"Sec-Fetch-User": "?1",
"Upgrade-Insecure-Requests": "1"
}
})
});
if (resp.request.socket._httpMessage._redirectable._currentUrl !== url) {
return resp.request.socket._httpMessage._redirectable._currentUrl;

@ -7,18 +7,23 @@ module.exports = {
get: async function(url) {
let b;
try {
pup.use(stl());
let stlh = stl();
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
if (lib.config().captcha.active == false) {
throw "Captcha service is required for this link, but this instance doesn't support it."
}
if (lib.config().debug == true) console.log("[exeio] Launching browser...");
b = await pup.launch({headless: true});
let p = await b.newPage();
await p.goto(url);
await p.goto(url);
if (lib.config().debug == true) console.log("[exeio] Launched. Skipping first page...");
await p.waitForNavigation();
if (lib.config().debug == true) console.log("[exeio] Skipped. Starting continous function...");
p = await cont(p, url);
await b.close();
return p;
@ -31,25 +36,31 @@ module.exports = {
async function cont(p, url) {
try {
if ((await p.$(".box-main > #before-captcha"))) {
if (lib.config().debug == true) console.log("[exeio] Skipping non-CAPTCHA page...");
await p.evaluate(function() {
document.querySelector("form").submit();
});
await p.waitForNavigation();
return (await cont(p, url));
} else if ((await p.$("#invisibleCaptchaShortlink"))) {
if (lib.config().debug == true) console.log("[exeio] Retrieving sitekey...");
let sk = await p.evaluate(function() {
return document.querySelector("iframe[title='recaptcha challenge expires in two minutes']").src.split("k=")[1].split("&")[0]
});
console.log(sk);
if (lib.config().debug == true) console.log("[exeio] Retrieved. Solving CAPTCHA...");
let c = await lib.solve(sk, "recaptcha", {referer: (await p.url())});
if (lib.config().debug == true) console.log("[exeio] Solved CAPTCHA. Enterring solution and submitting form...");
await p.evaluate(`document.querySelector("[name='g-recaptcha-response']").value = "${c}";`);
await p.evaluate(function() {
document.querySelector("form").submit();
});
if (lib.config().debug == true) console.log("[exeio] Submitted. Waiting...");
await p.waitForNavigation();
return (await cont(p, url));
} else if ((await p.$(".procced > .btn.get-link.text-white"))) {
if (lib.config().debug == true) console.log("[exeio] Counting down...");
await p.waitForSelector(".procced > .btn.get-link.text-white:not(.disabled)");
let r = await p.evaluate(function() {
return document.querySelector(".procced > .btn.get-link.text-white").href

@ -12,6 +12,7 @@ module.exports = {
if (u.host == "href.li" || u.host == "www.href.li") return u.href.split("?").slice(1).join("?");
// redirect via url params
if (lib.config()["debug"] == true) console.log("[generic] checking url params");
if (u.searchParams.get("url")) {
if (lib.isUrl(u.searchParams.get("url"))) {
return u.searchParams.get("url");
@ -50,6 +51,8 @@ module.exports = {
}
}
if (lib.config()["debug"] == true) console.log("[generic] Requesting page...");
let resp = await axios({
method: "GET",
url: url,
@ -64,6 +67,7 @@ module.exports = {
// adf.ly detection
// i don't remember the origin of this script unfortunately so uh can't credit this
if (lib.config()["debug"] == true) console.log("[generic] Got page. Checking for indicators that this is an adf.ly link...");
if (resp.data.includes(`var ysmm = `)) {
let a, m, I = "",
X = "",
@ -104,6 +108,7 @@ module.exports = {
}
// generic redirect
if (lib.config()["debug"] == true) console.log("[generic] Checking for http redirects...");
if (resp.data.includes(`content="0;URL=`)) {
return resp.data.split(`content="0;URL=`)[1].split(`"`)[0];
}
@ -111,6 +116,7 @@ module.exports = {
let $ = cheerio.load(resp.data);
// wpsafe-link protectors
if (lib.config()["debug"] == true) console.log("[generic] Checking for wpsafelink indicators...");
if ($("#wpsafe-link").length !== 0) {
if ($("#wpsafe-link a").attr("href") && $("#wpsafe-link a").attr("href").includes("safelink_redirect")) {
let o = new URL($("#wpsafe-link a").attr("href"));
@ -124,11 +130,14 @@ module.exports = {
// adlinkfly sites
// if there is a better way of detecting these, let me know pls
if (lib.config()["debug"] == true) console.log("[generic] Checking if link is adlinkfly link...");
if ($("title")?.text()?.includes("AdLinkFly")) {
if (lib.config()["debug"] == true) console.log("")
const afl = require("./adlinkfly");
return (await afl.get(url));
}
if (lib.config()["debug"] == true) console.log("[generic] Checking for http redirects...");
if (resp.request.socket._httpMessage._redirectable._currentUrl !== url) {
return resp.request.socket._httpMessage._redirectable._currentUrl;
}

@ -1,11 +1,13 @@
const axios = require("axios");
const cheerio = require("cheerio");
const lib = require("../lib");
module.exports = {
hostnames: ["ity.im"],
"requires-captcha": false,
get: async function(url) {
try {
if (lib.config().debug == true) console.log("[ityim] Requesting page...");
let resp = await axios({
method: "GET",
url: url,
@ -15,6 +17,7 @@ module.exports = {
}
});
if (lib.config().debug == true) console.log("[ityim] Got page. Parsing page...");
let $ = cheerio.load(resp.data);
return $(".col-xs-6.col-md-4.vertical_center:not(#logo_div) a").attr("href");

@ -1,11 +1,13 @@
const axios = require("axios");
const cheerio = require("cheerio");
const lib = require("../lib");
module.exports = {
hostnames: ["karung.in"],
"requires-captcha": false,
get: async function(url) {
try {
if (lib.config()["debug"] == true) console.log("[karung] Requesting page...");
let resp = await axios({
method: "GET",
url: url,
@ -14,9 +16,11 @@ module.exports = {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8"
}
});
if (lib.config()["debug"] == true) console.log("[karung] Got page. Parsing page...");
let $ = cheerio.load(resp.data);
let r = $("#makingdifferenttimer")[0]?.attribs?.href;
if (lib.config()["debug"] == true) console.log("[karung] Parsed. Decoding data...");
r = new URL(r);
r = r.searchParams.get("r");
r = Buffer.from(r, "base64").toString("ascii");

@ -1,4 +1,5 @@
const pup = require("puppeteer-extra");
const stl = require("puppeteer-extra-plugin-stealth");
const cap = require("puppeteer-extra-plugin-recaptcha");
const lib = require("../lib");
@ -16,6 +17,10 @@ module.exports = {
throw "Captcha service is required for this link, but this instance doesn't support it."
}
let stlh = stl();
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
pup.use(cap({
provider: {
id: lib.config().captcha.service,
@ -23,11 +28,12 @@ module.exports = {
}
}));
if (lib.config().debug == true) console.log("[linktl] Launching browser...");
b = await pup.launch({headless: true});
let p = await b.newPage();
await p.goto(url);
if (lib.config().debug == true) console.log("[linktl] Launched. Starting continous function...");
p = (await cont(p, b));
return p;
} catch(err) {
@ -39,17 +45,22 @@ module.exports = {
async function cont(p, b) {
if ((await p.$(".g-recaptcha"))) {
if (lib.config().debug == true) console.log("[linktl] Opening CAPTCHA...");
await p.click("#csubmit");
await p.waitForTimeout(5000);
await p.waitForTimeout(2000); // preventing bugs with captcha solver
if (lib.config().debug == true) console.log("[linktl] Opened. Navigating out of popups...");
await p.bringToFront();
if (lib.config().debug == true) console.log("[linktl] Done. Solving CAPTCHA...");
await p.solveRecaptchas();
if (lib.config().debug == true) console.log("[linktl] Solved CAPTCHA. Waiting for next page to load.");
await p.waitForNavigation();
return (await cont(p, b));
} else if ((await p.$("#get_link_btn"))) {
if (lib.config().debug == true) console.log("[linktl] Retrieving URL from page...");
let u = await p.evaluate(function() {
return document.body.innerHTML.split(`goToUrl ("`)[1].split(`");`)[0];
});
console.log(u)
if (lib.config().debug == true) console.log("[linktl] Got URL. Closing browser...");
await b.close();
return u;
} else {

@ -1,7 +1,8 @@
const pup = require("puppeteer-extra");
const adb = require("puppeteer-extra-plugin-adblocker");
const lib = require("../lib");
const cap = require("puppeteer-extra-plugin-recaptcha");
const stl = require("puppeteer-extra-plugin-stealth");
const lib = require("../lib");
module.exports = {
hostnames: [
@ -15,20 +16,28 @@ module.exports = {
"link-center.net",
"link-target.net"
],
"requires-captcha": true,
"requires-captcha": false,
get: async function (url) {
let b;
try {
// this may not work for pastes, will add support for them once i come across one
pup.use(adb());
pup.use(adb({
blockTrackers: true
}));
let stlh = stl();
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
if (lib.config().debug == true) console.log("[linkvertise] Launching browser...");
b = await pup.launch({headless: true});
let p = await b.newPage();
await p.setUserAgent("Mozilla/5.0 (Linux; Android 11) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.120 Mobile Safari/537.36");
await p.goto(url);
if (lib.config().debug == true) console.log("[linkvertise] Waiting to see if CAPTCHA shows up...");
await p.waitForTimeout(3000); // this is just for waiting to see if a captcha shows up
if ((await p.$(".captcha-content"))) {
if (lib.config().debug == true) console.log(`[linkvertise] CAPTCHA was found, relaunching with CAPTCHA support.`);
@ -48,14 +57,17 @@ module.exports = {
b = await pup.launch({headless: true});
p = await b.newPage();
if (lib.config().debug == true) console.log("[linkvertise] Reopening page...");
await p.goto(url);
await p.waitForTimeout(3000);
if (lib.config().debug == true) console.log("[linkvertise] Solving CAPTCHA...");
await p.solveRecaptchas();
if (lib.config().debug == true) console.log(`[linkvertise] Solved captcha.`);
if (lib.config().debug == true) console.log(`[linkvertise] Solved CAPTCHA.`);
} else {
if (lib.config().debug == true) console.log(`[linkvertise] No captchas, continuing as normal.`)
if (lib.config().debug == true) console.log(`[linkvertise] No CAPTCHAs, continuing as normal.`)
}
if (lib.config().debug == true) console.log("[linkvertise] Counting down...");
await p.waitForSelector(".lv-dark-btn");
return (await follow(p, b));
} catch(err) {
@ -67,8 +79,11 @@ module.exports = {
async function follow(p, b) {
p.click("lv-button > .lv-button-component.new-button-style.lv-dark-btn.ng-star-inserted");
if (lib.config().debug == true) console.log("[linkvertise] Clicking button...");
try {
if (lib.config().debug == true) console.log("[linkvertise] Setting up listener for network events...");
let a = await fireWhenFound(p);
if (lib.config().debug == true) console.log("[linkvertise] Closing browser...");
await b.close();
return a;
} catch(err) {
@ -82,9 +97,12 @@ async function fireWhenFound(p) {
let a = new URL((await res.url()));
if (a.pathname.startsWith("/api/v1/") && (await (await(res.request()).method())) == "POST" && a.pathname.includes("/target")) {
let a = (await res.json());
if (lib.config().debug == true) console.log("[linkvertise] Got URL that met requirements, parsing...");
if (a.data.target) resolve(a.data.target);
else reject("Redirect not found.");
}
} else {
if (lib.config().debug == true && a.hostname.includes("linkvertise")) console.log(`[linkvertise] Ignoring request ${((await res.method()) || "(unknown mthod)")} "${(await res.url())}" from listener.`);
}
});
});
}

@ -1,7 +1,7 @@
const pup = require("puppeteer-extra");
const adb = require("puppeteer-extra-plugin-adblocker");
const cap = require("puppeteer-extra-plugin-recaptcha");
const stl = require("puppeteer-extra-plugin-stealth");
const cap = require("puppeteer-extra-plugin-recaptcha");
const lib = require("../lib");
module.exports = {
@ -12,8 +12,10 @@ module.exports = {
try {
// setting up plugins
let stlh = stl();
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
pup.use(adb({blockTrackers: true}));
pup.use(stl());
if (lib.config().captcha.active == false) {
throw "Captcha service is required for this link, but this instance doesn't support it."
@ -28,22 +30,28 @@ module.exports = {
// opening browser
if (lib.config().debug == true) console.log("[lnk2] Launching browser...");
b = await pup.launch({headless: true});
let p = await b.newPage();
await p.goto(url);
// solving captchas and navigating
if (lib.config().debug == true) console.log("[lnk2] Launched. Solving CAPTCHA...");
await p.solveRecaptchas();
if (lib.config().debug == true) console.log("[lnk2] Solved CAPTCHA. Submitting form...");
await p.evaluate(function() {
document.querySelector("form").submit();
});
if (lib.config().debug == true) console.log("[lnk2] Done. Submitting next form...");
await p.waitForNavigation();
await p.evaluate(function() {
document.querySelector("form").submit();
});
await p.waitForNavigation();
if (lib.config().debug == true) console.log("[lnk2] Done. Retrieving URL...");
let f = await p.url();
await b.close();

@ -7,6 +7,7 @@ module.exports = {
"requires-captcha": false,
get: async function(url) {
try {
if (lib.config().debug == true) console.log("[mboost] Requesting page...");
let resp = await axios({
method: "GET",
url: url,
@ -17,10 +18,13 @@ module.exports = {
});
let $ = cheerio.load(resp.data);
if (lib.config().debug == true) console.log("[mboost] Got page. Parsing page...");
if ($("#__NEXT_DATA__")) {
if (lib.config().debug == true) console.log(`[mboost] Parsed page. Parsing JSON "__NEXT_DATA__" information...`);
let d = $("#__NEXT_DATA__")[0]?.children[0]?.data;
d = JSON.parse(d);
if (lib.config().debug == true) console.log("[mboost] Parsed JSON. Retrieving URL...");
if (lib.isUrl(d.props?.initialProps?.pageProps?.data?.targeturl)) {
return d.props?.initialProps?.pageProps?.data?.targeturl;
}

@ -1,13 +1,14 @@
const pup = require("puppeteer-extra");
const adb = require("puppeteer-extra-plugin-adblocker");
const cap = require("puppeteer-extra-plugin-recaptcha");
const stl = require("puppeteer-extra-plugin-stealth");
const cap = require("puppeteer-extra-plugin-recaptcha");
const lib = require("../lib");
module.exports = {
hostnames: ["myl.li", "mylink.vc"],
"requires-captcha": true,
get: async function(url) {
let b;
try {
let u = new URL(url);
@ -15,8 +16,10 @@ module.exports = {
// setting up plugins
pup.use(adb({blockTrackers: true}));
pup.use(stl());
pup.use(adb({blockTrackers: true}));
let stlh = stl();
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
if (lib.config().captcha.active == false) {
throw "Captcha service is required for this link, but this instance doesn't support it."
@ -31,16 +34,21 @@ module.exports = {
// opening browser
let b = await pup.launch({headless: true});
if (lib.config().debug == true) console.log("[mylink] Launching browser...");
b = await pup.launch({headless: true});
let p = await b.newPage();
await p.goto(url);
if (lib.config().debug == true) console.log("[mylink] Launched. Resolving data...");
if (u.host == "myl.li") {
await p.waitForNavigation();
}
if (lib.config().debug == true) console.log("[mylink] Resolved. Solving CAPTCHA...");
await p.solveRecaptchas();
await p.click("#pub6 input[type=submit]");
if (lib.config().debug == true) console.log("[mylink] Solved CAPTCHA and submitted form. Waiting for redirect...");
await p.waitForNavigation();
p = await cont(p);
@ -50,14 +58,21 @@ module.exports = {
return a;
} catch (err) {
if (b !== undefined) await b.close();
throw err;
}
}
}
async function cont(p) {
async function cont(p, n) {
await p.evaluate('document.querySelectorAll(`br`).forEach(function(ele) {ele.remove()});');
if ((await p.$("#captcha"))) {
if (lib.config().debug == true) console.log("[mylink] Solving extra CAPTCHA...");
await p.solveRecaptchas();
if (lib.config().debug == true) console.log("[mylink] Solved. Continuing...");
}
await p.evaluate(function () {
if (
!document.querySelector("form h3") ||
@ -65,11 +80,13 @@ async function cont(p) {
) document.querySelector("form").submit();
});
if (lib.config().debug == true) console.log("[mylink] Autosubmitting form...");
await p.waitForNavigation();
if (new URL(await p.url()).host.includes("myl.") || new URL(await p.url()).host.includes("mylink.")) {
return (await cont(p));
} else {
if (lib.config().debug == true) console.log("[mylink] Solved for link.");
return p;
}
}

@ -1,5 +1,6 @@
const pup = require("puppeteer-extra");
const stl = require("puppeteer-extra-plugin-stealth");
const lib = require("../lib");
module.exports = {
"hostnames": ["oke.io"],
@ -7,24 +8,32 @@ module.exports = {
get: async function(url) {
let b;
try {
pup.use(stl());
let stlh = stl();
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
if (lib.config().debug == true) console.log("[okeio] Launching browser...");
b = await pup.launch({headless: true});
let p = await b.newPage();
await p.goto(url);
if (lib.config().debug == true) console.log("[okeio] Launched. Auto-submitting forum...");
await p.evaluate(function() {
document.querySelector("form").submit();
});
await p.waitForNavigation();
if (lib.config().debug == true) console.log("[okeio] Submitted. Counting down...");
await p.waitForSelector(".getlinkbtn:not([href='javascript: void(0)']");
if (lib.config().debug == true) console.log("[okeio] Done. Retrieving URL...");
let l = await p.evaluate(function() {return document.querySelector(".getlinkbtn").href});
if (lib.config().debug == true) console.log("[okeio] Closing browser...");
await b.close();
return l;
} catch(err) {
if (b !== undefined) await b.close();
throw err;
}
}
}

@ -10,24 +10,31 @@ module.exports = {
let b;
try {
let u = new URL(url);
if (u.searchParams.get("s")) return decodeURIComponent(u.searchParams.get("s"));
if (u.searchParams.get("s")) {
if (lib.config().debug == true) console.log("[ouo] Found API information, sending URL...");
return decodeURIComponent(u.searchParams.get("s"));
}
// setting up plugins
pup.use(stl());
let stlh = stl();
stlh.enabledEvasions.delete("iframe.contentWindow");
pup.use(stlh);
// opening browser
if (lib.config().debug == true) console.log("[ouo] Launching browser...");
b = await pup.launch({headless: true});
let p = await b.newPage();
await p.goto(u.href);
if (lib.config().debug == true) console.log("[ouo] Launched. Detecting if the site is protected via Cloudflare...");
let cf = await p.evaluate(function() {
if (document.title.includes("Attention")) return true;
else return false;
});
if (cf == true) {
if (lib.config().debug == true) console.log("[ouo] Relaunching browser with CAPTCHA support...");
await b.close();
if (lib.config().captcha.active == false) {
throw "Captcha service isn't normally required for this link, but it does under these circumstances, but this instance doesn't support it."
@ -44,13 +51,16 @@ module.exports = {
p = await b.newPage();
await p.goto(u.href);
if (lib.config().debug == true) console.log("[ouo] Solving CAPTCHA...");
await p.waitForSelector("#cf-hcaptcha-container");
await p.solveRecaptchas();
if (lib.config().debug == true) console.log("[ouo] Solved CAPTCHA. Waiting for page to refresh...");
await p.waitForNavigation();
}
// 2nd eval code sourced from https://github.com/FastForwardTeam/FastForward/blob/main/src/js/injection_script.js#L1095
if (lib.config().debug == true) console.log("[ouo] Auto-submitting form to skip CAPTCHA...");
await p.evaluate(function() {
if (location.pathname.includes("/go") || location.pathname.includes("/fbc")) {
document.querySelector("form").submit();

@ -7,6 +7,7 @@ module.exports = {
"requires-captcha": false,
get: async function(url) {
try {
if (lib.config().debug == true) console.log("[show] Requesting page...");
let resp = await axios({
method: "GET",
url: url,
@ -16,17 +17,21 @@ module.exports = {
}
});
if (lib.config().debug == true) console.log("[show] Got page. Parsing page...");
let $ = cheerio.load(resp.data);
if ($("#show-campaign-data")) {
if (lib.config().debug == true) console.log("[show] Parsed. Parsing JSON data...");
let d = $("#show-campaign-data")[0]?.children[0]?.data;
d = JSON.parse(d);
if (lib.isUrl(d.unlockable?.redirect?.url)) {
return d.unlockable.redirect.url;
} else {
if (lib.config().debug == true) console.log("[show] JSON data does not contain needed information.");
throw "Redirect not found."
}
} else {
if (lib.config().debug == true) console.log("[show] Page does not contain needed information.");
throw "Redirect not found.";
}
} catch(err) {

@ -1,4 +1,5 @@
const axios = require("axios");
const lib = require("../lib");
module.exports = {
hostnames: [
@ -19,18 +20,21 @@ module.exports = {
"requires-captcha": false,
get: async function (url) {
try {
if (lib.config().debug == true) console.log("[shst] Requesting page...");
let resp = await axios({
method: "GET",
url: url,
headers: {
"user-agent": ""
}
},
maxRedirects: 1
});
if (resp.request.socket._httpMessage._redirectable._currentUrl !== url) {
if (lib.config().debug == true) console.log("[shst] Got page. Parsing Axios data...");
if (resp.request?.socket?._httpMessage?._redirectable?._currentUrl !== url) {
return resp.request.socket._httpMessage._redirectable._currentUrl;
} else {
throw "Normal redirect no longer works."
throw "Redirect not found."
}
} catch(err) {
throw err;

@ -1,11 +1,15 @@
const axios = require("axios");
const lib = require("../lib");
module.exports = {
hostnames: ["social-unlock.com"],
"requires-captcha": false,
get: async function(url) {
try {
if (lib.config().debug == true) console.log("[social-unlock] Reformatting URL...");
url = url.split("/").slice(0, 3).join("/") + "/redirect/" + url.split("/").slice(3).join("/");
if (lib.config().debug == true) console.log("[social-unlock] Reformatted. Requesting page...");
let resp = await axios({
method: "GET",
url: url,
@ -19,7 +23,12 @@ module.exports = {
maxRedirects: 1
});
return resp.request.socket._httpMessage._redirectable._currentUrl;
if (lib.config().debug == true) console.log("[social-unlock] Got page. Parsing Axios data...");
if (resp.request?.socket?._httpMessage?._redirectable?._currentUrl !== url) {
return resp.request.socket._httpMessage._redirectable._currentUrl;
} else {
throw "Redirect not found."
}
} catch(err) {
throw err;
}

@ -25,9 +25,13 @@ module.exports = {
let ex = await ext.fromUrl(url);
let extractor = require(`${__dirname}/extractors/${ex}`);
if (this.config().debug == true) console.log(`[extract] Starting "${url}"`, opt)
if (opt.ignoreCache !== "true" && opt.ignoreCache !== true) {
if (this.config().debug == true) console.log("[db] Checking DB for desination...");
let f = await links.findOne({"original-url": url});
if (f !== null) {
if (this.config().debug == true) console.log("[db] Sending DB response...");
f._id = undefined;
f["from-cache"] = true;
f["from-fastforward"] = false;
@ -35,7 +39,6 @@ module.exports = {
}
}
if (this.config().debug == true) console.log(`[extract] Starting "${url}", ${JSON.stringify(opt)}`)
f = await extractor.get(url, opt);
if (this.config().debug == true) console.log(`[extract] Finished "${url}", ${JSON.stringify(opt)} [Solution: ${f}]`);

@ -12,6 +12,8 @@ app.listen(lib.config().http.port, function() {
app.get("/api/bypass", async function(req, res) {
let url = req.query.url;
if (lib.config().debug == true) console.log(`[http] Recieved request at path /api/bypass `);
try {
if (!lib.isUrl(url) && url.startsWith("aH")) url = Buffer.from(req.query.url, "base64").toString("ascii");
@ -23,10 +25,13 @@ app.get("/api/bypass", async function(req, res) {
});
return;
}
delete req.query.url;
if (lib.config().debug == true) console.log(`[http] Requesting ./lib.js to get "${url}"`, req.query);
let resp = await lib.get(url, req.query);
if (lib.config().debug == true) console.log(`[http] Sending response from ./lib.js`);
res.send({success: true, ...resp});
} catch(err) {
if (typeof err == "string") {

@ -0,0 +1,61 @@
const lib = require("./lib");
// add a new extractor? add it to the test list.
const examples = [
{ extractor: "bc.vc", link: "https://bc.vc/vQesLIh", expected: "https://universal-bypass.org/" },
{ extractor: "boost.ink", link: "https://boost.ink/c5bba"