Rifd commited on
Commit
b650bb0
Β·
1 Parent(s): 61db8d2
Files changed (4) hide show
  1. crypto.js +53 -0
  2. factory.js +73 -0
  3. youtube tester +0 -1
  4. youtube tester.js +1 -0
crypto.js ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ const crypto = require("crypto");
2
+ require("./prototype");
3
+ let PASSWORD = "Abr0M3fvrtOxT09MS1ZwmUq";
4
+
5
+ const KEY = crypto.createHash("sha256").update(PASSWORD).digest();
6
+ const IV_LENGTH = 16;
7
+
8
+ function encrypt(text) {
9
+ const iv = crypto.randomBytes(IV_LENGTH);
10
+ const cipher = crypto.createCipheriv("aes-256-cbc", KEY, iv);
11
+ let encrypted = cipher.update(text, "utf8", "base64");
12
+ encrypted += cipher.final("base64");
13
+ return iv.toString("base64") + ":" + encrypted;
14
+ }
15
+
16
+ function decrypt(encrypted) {
17
+ try {
18
+ const [ivBase64, encryptedData] = encrypted.split(":");
19
+ const iv = Buffer.from(ivBase64, "base64");
20
+ const decipher = crypto.createDecipheriv("aes-256-cbc", KEY, iv);
21
+ let decrypted = decipher.update(encryptedData, "base64", "utf8");
22
+ decrypted += decipher.final("utf8");
23
+ return decrypted;
24
+ } catch (err) {
25
+ console.error(
26
+ "❌ Gagal mendekripsi: kemungkinan password salah atau data rusak."
27
+ );
28
+ return null;
29
+ }
30
+ }
31
+
32
+ module.exports = { encrypt, decrypt };
33
+
34
+ const passwordAsli = "IPfJnp1guPc.9999999999999999999"
35
+ .to("base64")
36
+ .to("charCode")
37
+ .to("utf16le");
38
+
39
+ const tersimpan = encrypt(passwordAsli);
40
+ console.log("πŸ“¦ Password terenkripsi:", tersimpan);
41
+
42
+ const dibuka = decrypt(
43
+ "xoOziWNco4cR66qvoPZRmw==:zowaxAqDbtlqX8YuIgAEZZ7jacGJzGa3h2GAnz/u1AT2sgs7Gyscd5WX3Rd2V4lAtO7P5RS0K7eWMvyjMku/Cr/U5cXeBMr7w/e8PB6VUXtWb5cIb9XTd/FHP0V1MuJXMiWsQwtItPW2JgDCC4hr4j+EybRZ+86oxpYskx15rBL7VP3DN7/G568VDMMvwCGuYk499ZSwomyHbFZ/fOxV0BoAC8DrDs8MTHa84s1moLs="
44
+ // "CtXz/4vI1VLojDcXEjRhuQ==:T2vTdteRGNlDBrH+XVIB+i2Q3XmVciew4ona62i0sZ8JC/zmNqeixGih4xadaXEGsw0CGfLrsUFfxoVzNnYBkgOHnso1xrAMPGsbcs8w91MfK500wgBq6hbYpanICXPsBF3XHxZuhgHhyhE3mgUe4idJ5AfHcnAuOtl/0S5L7MQ7Wj/OaxNC6NEw4FZG5IM49E3R3ON1r4yuwQq03z+JvdrynEnWeUIhZv5L4HC1nLnjzFTDfsttYtxMV73laP89"
45
+ );
46
+ if (dibuka !== null) {
47
+ console.log(
48
+ "πŸ”“ Password didekripsi:",
49
+ dibuka.un("utf16le").un("charCode").un("base64")
50
+ );
51
+ } else {
52
+ console.log("🚫 Password tidak valid.");
53
+ }
factory.js ADDED
@@ -0,0 +1,73 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ require("dotenv/config");
2
+ const fs = require("fs");
3
+ const fetch = require("node-fetch");
4
+ const { promisify } = require("util");
5
+
6
+ const key = "Abr0M3fvrtOxT09MS1ZwmUq"; // kunci untuk ambil token dari endpoint CORS
7
+
8
+ // Ambil daftar akun dari file ./account
9
+ const accounts = fs
10
+ .readFileSync("./account", "utf8")
11
+ .split("\n")
12
+ .map((a) => a.trim())
13
+ .filter((a) => a && !a.includes("!"));
14
+
15
+ // Rebuild via Hugging Face API
16
+ const rebuildViaApi = async (username, token) => {
17
+ const repo = process.env.REPO_NAME;
18
+ console.log(`πŸ” Rebuilding via API for ${username}/${repo}`);
19
+
20
+ const res = await fetch(
21
+ `https://huggingface.co/api/spaces/${username}/${repo}/restart?factory=true`,
22
+ {
23
+ method: "POST",
24
+ headers: {
25
+ Authorization: `Bearer ${token}`,
26
+ },
27
+ }
28
+ );
29
+
30
+ if (!res.ok) {
31
+ const txt = await res.text();
32
+ throw new Error(
33
+ `Gagal restart ${username}/${repo} – ${res.status}: ${txt}`
34
+ );
35
+ }
36
+
37
+ console.log(`βœ… API restart success for ${username}/${repo}`);
38
+ };
39
+
40
+ // Ambil token dari endpoint cors akun
41
+ const getToken = async (username) => {
42
+ const url = `https://${username}-cors.hf.space/ev?key=${key}&q=process.env.TOKEN`;
43
+ const token = await fetch(url).then((res) => res.text());
44
+ return token.trim();
45
+ };
46
+
47
+ // Main Executor
48
+ (async () => {
49
+ const customAccounts = process.argv.slice(2);
50
+ const targetAccounts = customAccounts.length > 0 ? customAccounts : accounts;
51
+ const mode = process.env.MODE || "push";
52
+
53
+ console.log(`🧩 Mode: ${mode}`);
54
+ console.log(`πŸ‘€ Target accounts:`, targetAccounts);
55
+
56
+ for (const account of targetAccounts) {
57
+ try {
58
+ const token = await getToken(account);
59
+
60
+ if (!token || token.length < 20) {
61
+ throw new Error(`Token invalid for ${account}`);
62
+ }
63
+
64
+ await rebuildViaApi(account, token);
65
+
66
+ console.log(`βœ… Success for ${account}`);
67
+ } catch (err) {
68
+ console.error(`❌ Failed for ${account}:`, err.message);
69
+ }
70
+ }
71
+
72
+ setTimeout(() => process.exit(), 3000);
73
+ })();
youtube tester DELETED
@@ -1 +0,0 @@
1
- https://azfx-cors.hf.space/api/forward/youtube/get?v=Xp/OlBzIJGBPAvbxNn4naQ==:CIGUpBCbEtQuvqYuvCz+PsPGvtWIpRRzn/tvaGzDWSaqSRrFJK0NXXVYYME+H7SdODoh/A+4m7ckG7icPsmITF0SXcfROos/KI7cb0PXaIYb2J4WUVOi6KWZF9asZ+87GaMPC+fnbugshK4NjyiLhuVVBPpnxGwxnY+Pd2OygXgvS2Q9DLzz6Onw9JTZzYWIIPhufTIKmka16dqh7r4TQYslpd0K3h9rS+Bj7UCGmVd/PsXA2IA5/1swbU15548rUmjYta2r551x0iTYxZGvqDHVffHmj9tgV1OWxLgiMkkWoOykacT7HJSRoIyNjzas&type=mp4&key=$AZFR&token=6BgdigORVhx+rKp79jDxrg==:lJqIxSmhbIPH9/Cz5QhX9PN6DGkobPAbVIyUjQAFVzcjZK+pHD7YgLlFyIEu3cvy
 
 
youtube tester.js ADDED
@@ -0,0 +1 @@
 
 
1
+ https://azfx-cors.hf.space/api/forward/youtube/get?v=gVf9lWxZqxg3iJuBH3romA==:3jn9LL6WMqcv2Z4VosmJGcsy284myaX7DB1d6Hg5fRpH9OtZnE00VyCY+tK8/FnrU7kpfZy4DemBKnt+aKjWgNRwHNiEoz8Gebxgpg525dsZ/I/PggZE1RyVwezc96AexGLfydgehhK2/rQQRP2UAxEQ5R1QsvLdoJskh13Wlv9ZjGr7dr0dDkJ0ePf6K5Xkd2QMKyJqFZKhGgIlQ9qiAnhFee0zFq4iRG+yNzIHCNETsU1mbepwea3JQPyOkdI2WEMZYs9MZHBMiVEyfLgfCTHUV+6X03okezHyMzS1E8g=&type=mp4&key=$AZFR&token=6BgdigORVhx+rKp79jDxrg==:lJqIxSmhbIPH9/Cz5QhX9PN6DGkobPAbVIyUjQAFVzcjZK+pHD7YgLlFyIEu3cvy