-
Notifications
You must be signed in to change notification settings - Fork 290
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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']; | ||
|
||
|