Skip to content

Commit

Permalink
Fix bstlar bypass
Browse files Browse the repository at this point in the history
  • Loading branch information
harryitz committed Jul 20, 2024
1 parent 21f08f7 commit 89fb43c
Showing 1 changed file with 43 additions and 12 deletions.
55 changes: 43 additions & 12 deletions src/bypasses/bstlar.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,52 @@
import BypassDefinition from './BypassDefinition.js'
import BypassDefinition from './BypassDefinition.js';

export default class Bstlar extends BypassDefinition {
constructor() {
super()
// custom bypass required bases can be set here
super();
this.ensure_dom = true;
}

execute() {
this.helpers.ensureDomLoaded(() => {
const boostellar_link = encodeURIComponent(location.pathname.slice(1))
fetch(`https://bstlar.com/api/link?url=${boostellar_link}`).then(res => res.json().then((res) => {
if (res?.link?.destination_url) {
this.helpers.safelyNavigate(res.link.destination_url)
}
}))
})
this.helpers.bypassRequests(async data => {
if (data.currentTarget?.responseText?.includes('tasks')) {
const response = JSON.parse(data.currentTarget.responseText);
const userAgent = navigator.userAgent;
const XSRF_TOKEN = this.getCookie('XSRF-TOKEN');
const boostellar_session = this.getCookie('boostellar_session')
const PfufeQwMeP6og9Poi7DmjbGJCcYhyXKQhlPnQ4Ud = this.getCookie('PfufeQwMeP6og9Poi7DmjbGJCcYhyXKQhlPnQ4Ud')
const cf_clearance = this.getCookie('cf_clearance')
const task_request = await fetch('https://bstlar.com/api/link-completed', {
method: 'POST',
headers: {
accept: 'application/json, text/plain, */*',
authorization: 'null',
cookie: `XSRF-TOKEN=${XSRF_TOKEN}; boostellar_session=${boostellar_session}; PfufeQwMeP6og9Poi7DmjbGJCcYhyXKQhlPnQ4Ud=${PfufeQwMeP6og9Poi7DmjbGJCcYhyXKQhlPnQ4Ud}; cf_clearance=${cf_clearance}`,
origin: 'https://bstlar.com',
pragma: 'no-cache',
priority: 'u=1, i',
referer: 'https://bstlar.com/hV/krampus',
'user-agent': userAgent,
'x-xsrf-token': XSRF_TOKEN,
'Content-Type': 'application/json'
},
body: JSON.stringify({
link_id: response['link']['id']
})
})
if (task_request.status !== 200) return;
const task_response = await task_request.text();
this.helpers.safelyNavigate(task_response)
}
});
}

getCookie(name) {
let value = '; ' + document.cookie;
let parts = value.split('; ' + name + '=');
if (parts.length === 2) return parts.pop().split(';').shift();
}
}

export const matches = ['bstlar.com']
export const matches = ['bstlar.com'];


0 comments on commit 89fb43c

Please sign in to comment.