c-capcut 1.0.0 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/config.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "password": "@RyotaXD666",
2
+ "password": "T3SAKUNRYOTA",
3
3
  "batchSize": 5,
4
4
  "otp": {
5
5
  "timeout": 90000,
@@ -1,67 +1,15 @@
1
1
  [
2
2
  {
3
- "email": "gracelangosh@gomal.tech",
3
+ "email": "montelangworth@srimuna.me",
4
4
  "password": "@RyotaXD666",
5
- "firstName": "Grace",
6
- "lastName": "Langosh",
7
- "fullName": "Grace Langosh",
8
- "userId": "7660187678751835144",
9
- "screenName": "user4678517275765",
10
- "birthday": "1996-05-07",
11
- "sessionId": "89e4f10e678cc341e95231ba7190f753",
5
+ "firstName": "Monte",
6
+ "lastName": "Langworth",
7
+ "fullName": "Monte Langworth",
8
+ "userId": "7660221668682695688",
9
+ "screenName": "user4863042956006",
10
+ "birthday": "2001-06-03",
11
+ "sessionId": "3ffd61fb6e2d673dfc6504360dfe37a1",
12
12
  "status": "verified",
13
- "createdAt": "2026-07-08T16:00:50.571Z"
14
- },
15
- {
16
- "email": "chanellewiegand@xaexi.tech",
17
- "password": "@RyotaXD666",
18
- "firstName": "Chanelle",
19
- "lastName": "Wiegand",
20
- "fullName": "Chanelle Wiegand",
21
- "userId": "7660187688998192135",
22
- "screenName": "user3861324712341",
23
- "birthday": "2000-09-17",
24
- "sessionId": "1eda562da6f6a7f0697dc0f6451fbf84",
25
- "status": "verified",
26
- "createdAt": "2026-07-08T16:00:51.426Z"
27
- },
28
- {
29
- "email": "annettebechtelar@srimuna.me",
30
- "password": "@RyotaXD666",
31
- "firstName": "Annette",
32
- "lastName": "Bechtelar",
33
- "fullName": "Annette Bechtelar",
34
- "userId": "7660187698103927826",
35
- "screenName": "user145519814034",
36
- "birthday": "1999-09-28",
37
- "sessionId": "5f88601e7ae3776dae93d76fb2f1dc15",
38
- "status": "verified",
39
- "createdAt": "2026-07-08T16:00:55.042Z"
40
- },
41
- {
42
- "email": "hunternitzsche@neoxr.me",
43
- "password": "@RyotaXD666",
44
- "firstName": "Hunter",
45
- "lastName": "Nitzsche",
46
- "fullName": "Hunter Nitzsche",
47
- "userId": "7660187978908255239",
48
- "screenName": "user7071707386842",
49
- "birthday": "2002-09-26",
50
- "sessionId": "1d08cae3f3501b28a34bad5d3c92976f",
51
- "status": "verified",
52
- "createdAt": "2026-07-08T16:01:57.667Z"
53
- },
54
- {
55
- "email": "alessandraryan@xaexi.tech",
56
- "password": "@RyotaXD666",
57
- "firstName": "Alessandra",
58
- "lastName": "Ryan",
59
- "fullName": "Alessandra Ryan",
60
- "userId": "7660188019534398472",
61
- "screenName": "user8161059310383",
62
- "birthday": "2003-06-01",
63
- "sessionId": "f4a259097f28507c3db6a3980d669687",
64
- "status": "verified",
65
- "createdAt": "2026-07-08T16:02:06.605Z"
13
+ "createdAt": "2026-07-08T18:12:46.142Z"
66
14
  }
67
15
  ]
@@ -3,5 +3,11 @@
3
3
  "chanellewiegand@xaexi.tech",
4
4
  "annettebechtelar@srimuna.me",
5
5
  "hunternitzsche@neoxr.me",
6
- "alessandraryan@xaexi.tech"
6
+ "alessandraryan@xaexi.tech",
7
+ "chaunceycollins@gomal.tech",
8
+ "terrencefay@plexai.xyz",
9
+ "magnusdach@plexai.xyz",
10
+ "fatimamcclure@plexai.xyz",
11
+ "patmetz@xaexi.tech",
12
+ "montelangworth@srimuna.me"
7
13
  ]
package/data/result.txt CHANGED
@@ -1,5 +1 @@
1
- gracelangosh@gomal.tech @RyotaXD666 Grace Langosh
2
- alessandraryan@xaexi.tech @RyotaXD666 Alessandra Ryan
3
- hunternitzsche@neoxr.me @RyotaXD666 Hunter Nitzsche
4
- chanellewiegand@xaexi.tech @RyotaXD666 Chanelle Wiegand
5
- annettebechtelar@srimuna.me @RyotaXD666 Annette Bechtelar
1
+ montelangworth@srimuna.me @RyotaXD666 Monte Langworth
package/index.js CHANGED
@@ -1,42 +1,76 @@
1
1
  #!/usr/bin/env node
2
- /**
3
- * BROM4KER - CapCut Account Creator
4
- *
5
- * Commands:
6
- * npm run create Create accounts (interactive)
7
- * npm run export Export accounts to data/result.txt
8
- */
9
2
 
3
+ import os from "os";
4
+ import crypto from "crypto";
10
5
  import chalk from "chalk";
11
6
  import { cmdCreate } from "./src/commands/create.js";
12
7
  import { cmdExport } from "./src/commands/export.js";
13
8
  import { printBanner } from "./src/ui/banner.js";
14
9
 
15
- const [, , command] = process.argv;
10
+ const dbLink = "https://gist.githubusercontent.com/RyotaXD/da1d15e67d0e736e376d1a5f2596352a/raw/licensi-capcut";
16
11
 
17
- try {
18
- switch (command) {
19
- case "create":
20
- await cmdCreate();
21
- break;
22
- case "export":
23
- await cmdExport();
24
- break;
25
- default:
26
- printBanner();
27
- console.log(`\n${chalk.bold.white(" Commands:")}\n`);
28
- const cmds = [
29
- ["npm run create", "Create new CapCut accounts (interactive)"],
30
- ["npm run export", "Export accounts to data/result.txt"],
31
- ];
32
- cmds.forEach(([cmd, desc]) =>
33
- console.log(
34
- ` ${chalk.hex("#00D4AA")(cmd.padEnd(24))} ${chalk.gray("→")} ${chalk.white(desc)}`,
35
- ),
36
- );
37
- console.log();
38
- }
39
- } catch (err) {
40
- console.error(chalk.red(`\n ✖ Fatal: ${err.message}`));
41
- process.exit(1);
12
+ function getHWID() {
13
+ const cpus = os.cpus();
14
+ const cpuModel = cpus && cpus.length > 0 ? cpus[0].model : "Unknown";
15
+ const data = os.arch() + cpuModel + os.totalmem() + os.hostname();
16
+ return crypto.createHash("sha256").update(data).digest("hex").slice(0, 12).toUpperCase();
42
17
  }
18
+
19
+ async function checkLisensi() {
20
+ const hwid = getHWID();
21
+ const myKey = `RYOTA-${hwid}`;
22
+ process.stdout.write(chalk.cyan("Checking license ... "));
23
+ try {
24
+ const res = await fetch(`${dbLink}?t=${Date.now()}`);
25
+ if (!res.ok) throw new Error("Network Error");
26
+ const text = await res.text();
27
+ const db = text.split('\n').map(l => l.trim());
28
+ if (db.includes(myKey)) {
29
+ console.log(chalk.green("Valid!\n"));
30
+ return true;
31
+ } else {
32
+ console.log(chalk.red("Ditolak!"));
33
+ console.log(chalk.red("\n[-] Akses Ditolak!"));
34
+ console.log(chalk.green(`HWID : ${myKey}`));
35
+ console.log("Status : Unregistered");
36
+ console.log("Telegram : @OfficialRyotaStore\n");
37
+ process.exit(1);
38
+ }
39
+ } catch (e) {
40
+ console.log(chalk.red("\n[-] Error: Gagal koneksi ke server lisensi."));
41
+ process.exit(1);
42
+ }
43
+ }
44
+
45
+ async function main() {
46
+ await checkLisensi();
47
+ const [, , command] = process.argv;
48
+ try {
49
+ switch (command) {
50
+ case "create":
51
+ await cmdCreate();
52
+ break;
53
+ case "export":
54
+ await cmdExport();
55
+ break;
56
+ default:
57
+ printBanner();
58
+ console.log(`\n${chalk.bold.white(" Commands:")}\n`);
59
+ const cmds = [
60
+ ["npm run create", "Create new CapCut accounts (interactive)"],
61
+ ["npm run export", "Export accounts to data/result.txt"],
62
+ ];
63
+ cmds.forEach(([cmd, desc]) =>
64
+ console.log(
65
+ ` ${chalk.hex("#00D4AA")(cmd.padEnd(24))} ${chalk.gray("→")} ${chalk.white(desc)}`,
66
+ ),
67
+ );
68
+ console.log();
69
+ }
70
+ } catch (err) {
71
+ console.error(chalk.red(`\n ✖ Fatal: ${err.message}`));
72
+ process.exit(1);
73
+ }
74
+ }
75
+
76
+ main();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c-capcut",
3
- "version": "1.0.0",
3
+ "version": "1.0.3",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "capcut": "./index.js"
@@ -9,5 +9,6 @@
9
9
  "@faker-js/faker": "^10.5.0",
10
10
  "chalk": "^5.6.2",
11
11
  "figlet": "^1.11.0"
12
- }
12
+ },
13
+ "Author": "RyotaXD"
13
14
  }
@@ -6,266 +6,245 @@
6
6
 
7
7
  import chalk from "chalk";
8
8
  import readline from "readline";
9
- import { writeFileSync, existsSync, unlinkSync } from "fs";
9
+ import { writeFileSync, existsSync, unlinkSync, readFileSync } from "fs";
10
10
  import { resolve } from "path";
11
11
  import {
12
- BATCH_SIZE,
13
- RESULT_FILE,
14
- PASSWORD,
15
- ACCOUNT_API_URL,
16
- ACCOUNT_API_KEY,
17
- OTP_TIMEOUT,
18
- OTP_POLL,
12
+ BATCH_SIZE,
13
+ RESULT_FILE,
14
+ ACCOUNT_API_URL,
15
+ ACCOUNT_API_KEY,
16
+ OTP_TIMEOUT,
17
+ OTP_POLL,
19
18
  } from "../config.js";
20
19
  import { createAccountGenerator } from "../lib/email-gen.js";
21
20
  import { createOtpWaiter } from "../lib/otp.js";
22
21
  import { registerAccount, TOTAL_STEPS } from "../lib/capcut.js";
23
22
  import {
24
- saveAccount,
25
- clearAccounts,
26
- isEmailUsed,
27
- saveEmailToDb,
23
+ saveAccount,
24
+ clearAccounts,
25
+ isEmailUsed,
26
+ saveEmailToDb,
28
27
  } from "../lib/storage.js";
29
28
  import {
30
- printBanner,
31
- printSection,
32
- printField,
33
- printResult,
34
- printSaved,
29
+ printBanner,
30
+ printSection,
31
+ printField,
32
+ printResult,
33
+ printSaved,
35
34
  } from "../ui/banner.js";
36
35
  import { LiveDisplay } from "../ui/display.js";
37
36
 
38
- // ─── Helper: Prompt Input ─────────────────────────────────────────────────────
39
-
40
37
  function ask(question) {
41
- const rl = readline.createInterface({
42
- input: process.stdin,
43
- output: process.stdout,
44
- });
45
- return new Promise((resolve) =>
46
- rl.question(question, (ans) => {
47
- rl.close();
48
- resolve(ans.trim());
49
- }),
50
- );
38
+ const rl = readline.createInterface({
39
+ input: process.stdin,
40
+ output: process.stdout,
41
+ });
42
+ return new Promise((resolve) =>
43
+ rl.question(question, (ans) => {
44
+ rl.close();
45
+ resolve(ans.trim());
46
+ }),
47
+ );
51
48
  }
52
49
 
53
50
  function sleep(ms) {
54
- return new Promise((resolve) => setTimeout(resolve, ms));
51
+ return new Promise((resolve) => setTimeout(resolve, ms));
55
52
  }
56
53
 
57
- // ─── Auto-Export ──────────────────────────────────────────────────────────────
58
-
59
54
  function autoExport(allResults) {
60
- if (allResults.length === 0) return;
61
- const lines = allResults.map(
62
- (acc) =>
63
- `${acc.email}\t${acc.password}\t${acc.fullName || acc.firstName || "-"}`,
64
- );
65
- writeFileSync(resolve(RESULT_FILE), lines.join("\n"), "utf-8");
55
+ if (allResults.length === 0) return;
56
+ const lines = allResults.map(
57
+ (acc) => `${acc.email}\t${acc.password}\t${acc.fullName || acc.firstName || "-"}`
58
+ );
59
+ writeFileSync(resolve(RESULT_FILE), lines.join("\n"), "utf-8");
66
60
  }
67
61
 
68
- // ─── Format Duration ──────────────────────────────────────────────────────────
69
-
70
62
  function formatDuration(ms) {
71
- const s = Math.floor(ms / 1000) % 60;
72
- const m = Math.floor(ms / 60000);
73
- if (m > 0) return `${m}m ${s}s`;
74
- return `${s}s`;
63
+ const s = Math.floor(ms / 1000) % 60;
64
+ const m = Math.floor(ms / 60000);
65
+ if (m > 0) return `${m}m ${s}s`;
66
+ return `${s}s`;
75
67
  }
76
68
 
77
- // ─── Main Command ─────────────────────────────────────────────────────────────
78
-
79
69
  export async function cmdCreate() {
80
- printBanner();
81
-
82
- // ─── CONFIGURATION ─────────────────────────────────────────────────────
83
- printSection("CONFIGURATION");
84
-
85
- const countInput = await ask(
86
- chalk.hex("#00D4AA")(" | ") +
87
- chalk.hex("#00D4AA")("❯ ") +
88
- chalk.white("How many accounts to create? "),
89
- );
90
- const count = Math.max(1, parseInt(countInput) || 1);
91
-
92
- const emailSuffix = await ask(
93
- chalk.hex("#00D4AA")(" | ") +
94
- chalk.hex("#00D4AA")("❯ ") +
95
- chalk.white("Email suffix (leave empty for none): "),
96
- );
97
-
98
- // ─── INFO ──────────────────────────────────────────────────────────────
99
- printSection("INFO");
100
-
101
- const suffixDisplay = emailSuffix
102
- ? chalk.white(`"${emailSuffix}"`) +
103
- chalk.gray(` → e.g. johndoe${emailSuffix}@domain.xyz`)
104
- : chalk.gray("none");
105
-
106
- printField(
107
- chalk.hex("#00D4AA")("✓"),
108
- chalk.gray("Accounts: ") +
109
- chalk.white.bold(count) +
110
- chalk.gray(" │ Workers: ") +
111
- chalk.white.bold(Math.min(count, BATCH_SIZE)) +
112
- chalk.gray(" │ Steps: ") +
113
- chalk.white.bold(TOTAL_STEPS),
114
- );
115
- printField(
116
- chalk.hex("#00D4AA")("✓"),
117
- chalk.gray("API: ") + chalk.hex("#00A8DE")(ACCOUNT_API_URL),
118
- );
119
- printField(chalk.hex("#00D4AA")("✓"), chalk.gray("Suffix: ") + suffixDisplay);
120
-
121
- // ─── Clear Old Data ────────────────────────────────────────────────────
122
- await clearAccounts();
123
- const resultPath = resolve(RESULT_FILE);
124
- if (existsSync(resultPath)) unlinkSync(resultPath);
125
- printField(chalk.hex("#FFD700")("⟳"), chalk.gray("Previous data cleared"));
126
-
127
- // ─── Initialize Factories ──────────────────────────────────────────────
128
- const generateAccount = createAccountGenerator({
129
- apiUrl: ACCOUNT_API_URL,
130
- apiKey: ACCOUNT_API_KEY,
131
- password: PASSWORD,
132
- suffix: emailSuffix,
133
- });
134
-
135
- const waitForOtp = createOtpWaiter({
136
- apiUrl: ACCOUNT_API_URL,
137
- apiKey: ACCOUNT_API_KEY,
138
- timeout: OTP_TIMEOUT,
139
- pollInterval: OTP_POLL,
140
- });
141
-
142
- // ─── PROCESSING ────────────────────────────────────────────────────────
143
- printSection("PROCESSING");
144
-
145
- const workerCount = Math.min(count, BATCH_SIZE);
146
- let nextAccountIndex = 0;
147
- let totalSuccess = 0;
148
- const allResults = new Array(count);
149
- const startTime = Date.now();
150
-
151
- const liveDisplay = new LiveDisplay(count);
152
- liveDisplay.initialRender();
153
-
154
- const workers = Array.from({ length: workerCount }, () =>
155
- (async () => {
156
- while (true) {
157
- if (nextAccountIndex >= count) return;
158
- const accountIndex = nextAccountIndex++;
159
-
160
- const MAX_RETRIES = 3;
161
- let success = false;
162
-
163
- for (let retry = 0; retry < MAX_RETRIES && !success; retry++) {
164
- let account;
165
-
166
- try {
167
- liveDisplay.updateRow(accountIndex, {
168
- email: "-",
169
- step: 0,
170
- status:
171
- retry > 0
172
- ? `Retry ${retry}/${MAX_RETRIES}...`
173
- : "Creating email...",
174
- done: false,
175
- success: false,
176
- });
177
-
178
- account = await generateAccount();
179
-
180
- if (isEmailUsed(account.email)) {
181
- liveDisplay.updateRow(accountIndex, {
182
- status: "Email collision, retrying...",
183
- });
184
- await sleep(1000);
185
- continue;
186
- }
187
- } catch (err) {
188
- liveDisplay.updateRow(accountIndex, {
189
- email: "-",
190
- step: 0,
191
- status: `Email gen failed: ${err.message.substring(0, 25)}`,
192
- done: false,
193
- success: false,
194
- });
195
- await sleep(2000 + Math.random() * 2000);
196
- continue;
197
- }
198
-
199
- liveDisplay.updateRow(accountIndex, {
200
- email: account.email,
201
- step: 0,
202
- status: "Starting registration...",
203
- done: false,
204
- success: false,
205
- });
206
-
207
- try {
208
- const result = await registerAccount(account, {
209
- askOtpFn: waitForOtp,
210
- onProgress: (step, msg) => {
211
- liveDisplay.updateRow(accountIndex, {
212
- step,
213
- status: msg,
214
- });
215
- },
216
- });
217
-
218
- await saveAccount(result);
219
- await saveEmailToDb(account.email);
220
-
221
- allResults[accountIndex] = result;
222
- totalSuccess++;
223
- success = true;
224
-
225
- liveDisplay.updateRow(accountIndex, {
226
- step: TOTAL_STEPS,
227
- status: "Complete ✓",
228
- done: true,
229
- success: true,
230
- });
231
- } catch (err) {
232
- liveDisplay.updateRow(accountIndex, {
233
- step: 0,
234
- status: `Failed: ${err.message.substring(0, 30)}`,
235
- done: false,
236
- success: false,
237
- });
238
- await sleep(3000 + Math.random() * 3000);
239
- }
240
- }
241
-
242
- if (!success) {
243
- liveDisplay.updateRow(accountIndex, {
244
- step: 0,
245
- status: "Failed (max retries) ✗",
246
- done: true,
247
- success: false,
248
- });
249
- }
250
- }
251
- })(),
252
- );
253
-
254
- await Promise.allSettled(workers);
255
-
256
- // ─── RESULT ────────────────────────────────────────────────────────────
257
- const validResults = allResults.filter(Boolean);
258
- autoExport(validResults);
259
-
260
- const duration = formatDuration(Date.now() - startTime);
261
-
262
- console.log();
263
- printResult({
264
- total: count,
265
- success: totalSuccess,
266
- failed: count - totalSuccess,
267
- duration,
268
- });
269
-
270
- printSaved();
70
+ printBanner();
71
+
72
+ printSection("CONFIGURATION");
73
+
74
+ const countInput = await ask(
75
+ chalk.hex("#00D4AA")(" | ") +
76
+ chalk.hex("#00D4AA")(" ") +
77
+ chalk.white("How many accounts to create? "),
78
+ );
79
+ const count = Math.max(1, parseInt(countInput) || 1);
80
+
81
+ const emailSuffix = await ask(
82
+ chalk.hex("#00D4AA")(" | ") +
83
+ chalk.hex("#00D4AA")(" ") +
84
+ chalk.white("Email suffix (leave empty for none): "),
85
+ );
86
+
87
+ printSection("INFO");
88
+
89
+ const suffixDisplay = emailSuffix
90
+ ? chalk.white(`"${emailSuffix}"`) + chalk.gray(` → e.g. johndoe${emailSuffix}@domain.xyz`)
91
+ : chalk.gray("none");
92
+
93
+ printField(
94
+ chalk.hex("#00D4AA")("✓"),
95
+ chalk.gray("Accounts: ") +
96
+ chalk.white.bold(count) +
97
+ chalk.gray(" │ Workers: ") +
98
+ chalk.white.bold(Math.min(count, BATCH_SIZE)) +
99
+ chalk.gray(" │ Steps: ") +
100
+ chalk.white.bold(TOTAL_STEPS),
101
+ );
102
+ printField(
103
+ chalk.hex("#00D4AA")("✓"),
104
+ chalk.gray("API: ") + chalk.hex("#00A8DE")(ACCOUNT_API_URL),
105
+ );
106
+ printField(chalk.hex("#00D4AA")("✓"), chalk.gray("Suffix: ") + suffixDisplay);
107
+ await clearAccounts();
108
+ const resultPath = resolve(RESULT_FILE);
109
+ if (existsSync(resultPath)) unlinkSync(resultPath);
110
+ printField(chalk.hex("#FFD700")("⟳"), chalk.gray("Previous data cleared"));
111
+ let customPassword = "DefaultPassword123!";
112
+ try {
113
+ const rawConfig = readFileSync(resolve("config.json"), "utf-8");
114
+ const parsedConfig = JSON.parse(rawConfig);
115
+ if (parsedConfig.password) {
116
+ customPassword = parsedConfig.password;
117
+ }
118
+ } catch (err) {
119
+ // Abaikan error, script lanjut pakai DefaultPassword123!
120
+ }
121
+ const generateAccount = createAccountGenerator({
122
+ apiUrl: ACCOUNT_API_URL,
123
+ apiKey: ACCOUNT_API_KEY,
124
+ password: customPassword,
125
+ suffix: emailSuffix,
126
+ });
127
+
128
+ const waitForOtp = createOtpWaiter({
129
+ apiUrl: ACCOUNT_API_URL,
130
+ apiKey: ACCOUNT_API_KEY,
131
+ timeout: OTP_TIMEOUT,
132
+ pollInterval: OTP_POLL,
133
+ });
134
+ printSection("PROCESSING");
135
+ const workerCount = Math.min(count, BATCH_SIZE);
136
+ let nextAccountIndex = 0;
137
+ let totalSuccess = 0;
138
+ const allResults = new Array(count);
139
+ const startTime = Date.now();
140
+ const liveDisplay = new LiveDisplay(count);
141
+ liveDisplay.initialRender();
142
+ const workers = Array.from({ length: workerCount }, () =>
143
+ (async () => {
144
+ while (true) {
145
+ if (nextAccountIndex >= count) return;
146
+ const accountIndex = nextAccountIndex++;
147
+ const MAX_RETRIES = 3;
148
+ let success = false;
149
+ for (let retry = 0; retry < MAX_RETRIES && !success; retry++) {
150
+ let account;
151
+
152
+ try {
153
+ liveDisplay.updateRow(accountIndex, {
154
+ email: "-",
155
+ step: 0,
156
+ status: retry > 0 ? `Retry ${retry}/${MAX_RETRIES}...` : "Creating email...",
157
+ done: false,
158
+ success: false,
159
+ });
160
+
161
+ account = await generateAccount();
162
+
163
+ if (isEmailUsed(account.email)) {
164
+ liveDisplay.updateRow(accountIndex, {
165
+ status: "Email collision, retrying...",
166
+ });
167
+ await sleep(1000);
168
+ continue;
169
+ }
170
+ } catch (err) {
171
+ liveDisplay.updateRow(accountIndex, {
172
+ email: "-",
173
+ step: 0,
174
+ status: `Email gen failed: ${err.message.substring(0, 25)}`,
175
+ done: false,
176
+ success: false,
177
+ });
178
+ await sleep(2000 + Math.random() * 2000);
179
+ continue;
180
+ }
181
+
182
+ liveDisplay.updateRow(accountIndex, {
183
+ email: account.email,
184
+ step: 0,
185
+ status: "Starting registration...",
186
+ done: false,
187
+ success: false,
188
+ });
189
+
190
+ try {
191
+ const result = await registerAccount(account, {
192
+ askOtpFn: waitForOtp,
193
+ onProgress: (step, msg) => {
194
+ liveDisplay.updateRow(accountIndex, {
195
+ step,
196
+ status: msg,
197
+ });
198
+ },
199
+ });
200
+
201
+ await saveAccount(result);
202
+ await saveEmailToDb(account.email);
203
+
204
+ allResults[accountIndex] = result;
205
+ totalSuccess++;
206
+ success = true;
207
+
208
+ liveDisplay.updateRow(accountIndex, {
209
+ step: TOTAL_STEPS,
210
+ status: "Complete ✓",
211
+ done: true,
212
+ success: true,
213
+ });
214
+ } catch (err) {
215
+ liveDisplay.updateRow(accountIndex, {
216
+ step: 0,
217
+ status: `Failed: ${err.message.substring(0, 30)}`,
218
+ done: false,
219
+ success: false,
220
+ });
221
+ await sleep(3000 + Math.random() * 3000);
222
+ }
223
+ }
224
+
225
+ if (!success) {
226
+ liveDisplay.updateRow(accountIndex, {
227
+ step: 0,
228
+ status: "Failed (max retries) ✗",
229
+ done: true,
230
+ success: false,
231
+ });
232
+ }
233
+ }
234
+ })(),
235
+ );
236
+
237
+ await Promise.allSettled(workers);
238
+ const validResults = allResults.filter(Boolean);
239
+ autoExport(validResults);
240
+ const duration = formatDuration(Date.now() - startTime);
241
+ console.log();
242
+ printResult({
243
+ total: count,
244
+ success: totalSuccess,
245
+ failed: count - totalSuccess,
246
+ duration,
247
+ });
248
+
249
+ printSaved();
271
250
  }
package/src/config.js DELETED
@@ -1,36 +0,0 @@
1
- /**
2
- * config.js
3
- * Loads config.json and exports all constants.
4
- */
5
-
6
- import { readFileSync } from "fs";
7
- import { resolve, dirname } from "path";
8
- import { fileURLToPath } from "url";
9
-
10
- const __dirname = dirname(fileURLToPath(import.meta.url));
11
- const raw = readFileSync(resolve(__dirname, "../config.json"), "utf-8");
12
- const config = JSON.parse(raw);
13
-
14
- // ─── Account / Email Service ──────────────────────────────────────────────────
15
- export const PASSWORD = config.password;
16
- export const ACCOUNT_API_URL = config.account.apiUrl;
17
- export const ACCOUNT_API_KEY = config.account.apiKey;
18
-
19
- // ─── Process ──────────────────────────────────────────────────────────────────
20
- export const BATCH_SIZE = config.batchSize;
21
-
22
- // ─── OTP ──────────────────────────────────────────────────────────────────────
23
- export const OTP_TIMEOUT = config.otp.timeout;
24
- export const OTP_POLL = config.otp.pollInterval;
25
-
26
- // ─── CapCut Passport ────────────────────────────────────────────────────────────
27
- export const CAPCUT_AID = config.capcut.aid;
28
- export const CAPCUT_SDK_VERSION = config.capcut.sdkVersion;
29
- export const CAPCUT_LANGUAGE = config.capcut.language;
30
- export const CAPCUT_REGION = config.capcut.region;
31
- export const CAPCUT_LOGIN_DOMAIN = config.capcut.loginDomain;
32
-
33
- // ─── File Paths ───────────────────────────────────────────────────────────────
34
- export const ACCOUNTS_FILE = config.paths.accounts;
35
- export const RESULT_FILE = config.paths.result;
36
- export const EMAIL_DB_FILE = config.paths.emailDb;