HerzaJ commited on
Commit
ac49a00
·
verified ·
1 Parent(s): c70caa4

Update plugins/sora2.js

Browse files
Files changed (1) hide show
  1. plugins/sora2.js +54 -9
plugins/sora2.js CHANGED
@@ -151,19 +151,57 @@ async function createTempEmail() {
151
 
152
  async function getHcaptchaToken() {
153
  console.log('Getting hCaptcha token...');
154
- const { data } = await axios.get(
155
- 'https://anabot.my.id/api/tools/bypass?url=https%3A%2F%2Fapi.hcaptcha.com&siteKey=6f70c0f2-3ef6-4972-9fb6-c0b4bade3af8&type=hcaptcha-invisible&apikey=freeApikey',
 
 
 
 
 
156
  {
157
- timeout: 30000
 
 
 
 
 
 
 
 
158
  }
159
- );
160
 
161
- if (!data.success) {
162
- throw new Error('Failed to get hCaptcha token');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  }
164
 
165
- console.log('hCaptcha token obtained');
166
- return data.data.result.token;
167
  }
168
 
169
  async function sendVerificationEmail(email) {
@@ -171,7 +209,14 @@ async function sendVerificationEmail(email) {
171
 
172
  await randomDelay(500, 1000);
173
 
174
- const hcaptchaToken = await getHcaptchaToken();
 
 
 
 
 
 
 
175
  const encodedEmail = encodeURIComponent(email);
176
 
177
  await randomDelay(300, 700);
 
151
 
152
  async function getHcaptchaToken() {
153
  console.log('Getting hCaptcha token...');
154
+
155
+ const apis = [
156
+ {
157
+ name: 'Anabot',
158
+ url: 'https://anabot.my.id/api/tools/bypass?url=https%3A%2F%2Fbylo.ai%2Ffeatures%2Fsora-2&siteKey=6f70c0f2-3ef6-4972-9fb6-c0b4bade3af8&type=hcaptcha-invisible&apikey=freeApikey',
159
+ extract: (data) => data.data.result.token
160
+ },
161
  {
162
+ name: 'NopeCHA',
163
+ url: 'https://api.nopecha.com/token',
164
+ method: 'POST',
165
+ data: {
166
+ type: 'hcaptcha',
167
+ sitekey: '6f70c0f2-3ef6-4972-9fb6-c0b4bade3af8',
168
+ url: 'https://bylo.ai/features/sora-2'
169
+ },
170
+ extract: (data) => data.token
171
  }
172
+ ];
173
 
174
+ for (const api of apis) {
175
+ try {
176
+ console.log(`Trying ${api.name}...`);
177
+
178
+ const config = {
179
+ url: api.url,
180
+ method: api.method || 'GET',
181
+ timeout: 15000
182
+ };
183
+
184
+ if (api.data) {
185
+ config.data = api.data;
186
+ config.headers = { 'Content-Type': 'application/json' };
187
+ }
188
+
189
+ const { data } = await axios(config);
190
+
191
+ if (data.success !== false) {
192
+ const token = api.extract(data);
193
+ if (token) {
194
+ console.log(`hCaptcha token obtained from ${api.name}`);
195
+ return token;
196
+ }
197
+ }
198
+ } catch (error) {
199
+ console.log(`${api.name} failed:`, error.message);
200
+ continue;
201
+ }
202
  }
203
 
204
+ throw new Error('All hCaptcha bypass services failed');
 
205
  }
206
 
207
  async function sendVerificationEmail(email) {
 
209
 
210
  await randomDelay(500, 1000);
211
 
212
+ let hcaptchaToken = '';
213
+ try {
214
+ hcaptchaToken = await getHcaptchaToken();
215
+ } catch (error) {
216
+ console.log('hCaptcha bypass failed, trying without token...');
217
+ hcaptchaToken = '';
218
+ }
219
+
220
  const encodedEmail = encodeURIComponent(email);
221
 
222
  await randomDelay(300, 700);