Skip to content

Commit

Permalink
Merge pull request #1260 from NotAProton/tii
Browse files Browse the repository at this point in the history
  • Loading branch information
NotAProton committed Dec 3, 2023
2 parents f4c8bdb + 72bf907 commit 8b324d5
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 1 deletion.
15 changes: 15 additions & 0 deletions src/bypasses/blogtech.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import BypassDefinition from './BypassDefinition.js';

export default class BlogTechh extends BypassDefinition {
constructor() {
super();
}

execute() {
this.helpers.awaitElement("button#getlink", button => {
button.click()
})
}
}

export const matches = ['blogtechh.com', 'oko.sh'];
26 changes: 26 additions & 0 deletions src/bypasses/tii.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import BypassDefinition from './BypassDefinition.js';

export default class TiiLa extends BypassDefinition {
constructor() {
super();
this.ensure_dom = true;
}

execute() {
const urlObj = new URL(window.location.href)
this.helpers.crowdQuery('tii.la', urlObj.pathname.slice(1)).then((dest) => {
this.helpers.crowdNavigate(dest)
});
/*keep checking for the button*/
setInterval(() => {
const button = document.querySelector("a.btn.btn-success.btn-lg.get-link");
if (button && button.href) {
this.helpers.crowdContribute('tii.la', urlObj.pathname.slice(1), button.href)
this.helpers.safelyNavigate(button.href)
}
}, 500);

}
}

export const matches = ['tii.la'];
10 changes: 9 additions & 1 deletion src/helpers/dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export function crowdQuery(domain, path) {
return new Promise((resolve, reject) => {
const timeout = setTimeout(() => {
reject(new Error('Timeout: crowd response not received'));
}, 5000); //5 sec timeout
}, 10000); //10 sec timeout

document.addEventListener('ff53054c0e13_crowdResponse', function (event) {
clearTimeout(timeout);
Expand Down Expand Up @@ -443,6 +443,13 @@ export async function bypassRequests(execution_method) {
return Promise.resolve(result);
};
}
/**
* Navigates to the specified URL. To be used for crowd sourced bypasses.
* @param {string} target - The target URL to navigate to.
*/
export function crowdNavigate(target) {
unsafelyNavigate(target, null, true);
}

export default {
insertInfoBox,
Expand All @@ -451,6 +458,7 @@ export default {
ffclipboard,
crowdQuery,
crowdContribute,
crowdNavigate,
followAndContribute,
unsafelyNavigate,
parseTarget,
Expand Down

0 comments on commit 8b324d5

Please sign in to comment.