|
1 |
| -import BypassDefinition from './BypassDefinition.js' |
| 1 | +import BypassDefinition from './BypassDefinition.js'; |
2 | 2 |
|
3 | 3 | export default class Bstlar extends BypassDefinition {
|
4 | 4 | constructor() {
|
5 |
| - super() |
6 |
| - // custom bypass required bases can be set here |
| 5 | + super(); |
| 6 | + this.ensure_dom = true; |
7 | 7 | }
|
8 | 8 |
|
9 | 9 | execute() {
|
10 |
| - this.helpers.ensureDomLoaded(() => { |
11 |
| - const boostellar_link = encodeURIComponent(location.pathname.slice(1)) |
12 |
| - fetch(`https://bstlar.com/api/link?url=${boostellar_link}`).then(res => res.json().then((res) => { |
13 |
| - if (res?.link?.destination_url) { |
14 |
| - this.helpers.safelyNavigate(res.link.destination_url) |
15 |
| - } |
16 |
| - })) |
17 |
| - }) |
| 10 | + this.helpers.bypassRequests(async data => { |
| 11 | + if (data.currentTarget?.responseText?.includes('tasks')) { |
| 12 | + const response = JSON.parse(data.currentTarget.responseText); |
| 13 | + const userAgent = navigator.userAgent; |
| 14 | + const XSRF_TOKEN = this.getCookie('XSRF-TOKEN'); |
| 15 | + const boostellar_session = this.getCookie('boostellar_session') |
| 16 | + const PfufeQwMeP6og9Poi7DmjbGJCcYhyXKQhlPnQ4Ud = this.getCookie('PfufeQwMeP6og9Poi7DmjbGJCcYhyXKQhlPnQ4Ud') |
| 17 | + const cf_clearance = this.getCookie('cf_clearance') |
| 18 | + const task_request = await fetch('https://bstlar.com/api/link-completed', { |
| 19 | + method: 'POST', |
| 20 | + headers: { |
| 21 | + accept: 'application/json, text/plain, */*', |
| 22 | + authorization: 'null', |
| 23 | + cookie: `XSRF-TOKEN=${XSRF_TOKEN}; boostellar_session=${boostellar_session}; PfufeQwMeP6og9Poi7DmjbGJCcYhyXKQhlPnQ4Ud=${PfufeQwMeP6og9Poi7DmjbGJCcYhyXKQhlPnQ4Ud}; cf_clearance=${cf_clearance}`, |
| 24 | + origin: 'https://bstlar.com', |
| 25 | + pragma: 'no-cache', |
| 26 | + priority: 'u=1, i', |
| 27 | + referer: 'https://bstlar.com/hV/krampus', |
| 28 | + 'user-agent': userAgent, |
| 29 | + 'x-xsrf-token': XSRF_TOKEN, |
| 30 | + 'Content-Type': 'application/json' |
| 31 | + }, |
| 32 | + body: JSON.stringify({ |
| 33 | + link_id: response['link']['id'] |
| 34 | + }) |
| 35 | + }) |
| 36 | + if (task_request.status !== 200) return; |
| 37 | + const task_response = await task_request.text(); |
| 38 | + this.helpers.safelyNavigate(task_response) |
| 39 | + } |
| 40 | + }); |
| 41 | + } |
| 42 | + |
| 43 | + getCookie(name) { |
| 44 | + let value = '; ' + document.cookie; |
| 45 | + let parts = value.split('; ' + name + '='); |
| 46 | + if (parts.length === 2) return parts.pop().split(';').shift(); |
18 | 47 | }
|
19 | 48 | }
|
20 | 49 |
|
21 |
| -export const matches = ['bstlar.com'] |
| 50 | +export const matches = ['bstlar.com']; |
| 51 | + |
| 52 | + |
0 commit comments