Facebook
From duar, 2 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 51
  1. const fetch = require("node-fetch");
  2. const SocksProxyAgent = require("socks-proxy-agent");
  3. const fs = require("fs");
  4.  
  5. const functionLogin = (email, auth_token, port) =>
  6.   new Promise((resolve, reject) => {
  7.     fetch("https://appapi.handypick.io/user/auto-login", {
  8.       agent: new SocksProxyAgent(`socks5://127.0.0.1:${port}`),
  9.       method: "POST",
  10.       body: JSON.stringify({
  11.         email,
  12.         auth_token,
  13.       }),
  14.       headers: {
  15.         accept: "application/json, text/plain, */*",
  16.         "Content-Type": "application/json;charset=utf-8",
  17.         "Content-Length": 226,
  18.         Host: "appapi.handypick.io",
  19.         Connection: "Keep-Alive",
  20.         "Accept-Encoding": "gzip",
  21.         "User-Agent": "okhttp/3.14.3",
  22.       },
  23.     })
  24.       .then((res) => res.json())
  25.       .then((result) => {
  26.         resolve(result);
  27.       })
  28.       .catch((err) => reject(err));
  29.   });
  30.  
  31. const checkTask = (token, user_id, email, port) =>
  32.   new Promise((resolve, reject) => {
  33.     fetch("https://appapi.handypick.io/game/list-unfinished-limit", {
  34.       agent: new SocksProxyAgent(`socks5://127.0.0.1:${port}`),
  35.       method: "POST",
  36.       body: JSON.stringify({
  37.         user_id,
  38.         email,
  39.       }),
  40.       headers: {
  41.         Authorization: `Bearer ${token}`,
  42.         accept: "application/json, text/plain, */*",
  43.         "Content-Type": "application/json;charset=utf-8",
  44.         "Content-Length": 226,
  45.         Host: "appapi.handypick.io",
  46.         Connection: "Keep-Alive",
  47.         "Accept-Encoding": "gzip",
  48.         "User-Agent": "okhttp/3.14.3",
  49.       },
  50.     })
  51.       .then((res) => res.json())
  52.       .then((result) => {
  53.         resolve(result);
  54.       })
  55.       .catch((err) => reject(err));
  56.   });
  57.  
  58. const checkPrediction = (token, id, port) =>
  59.   new Promise((resolve, reject) => {
  60.     fetch("https://appapi.handypick.io/game/game-status", {
  61.       agent: new SocksProxyAgent(`socks5://127.0.0.1:${port}`),
  62.       method: "POST",
  63.       body: JSON.stringify({ id }),
  64.       headers: {
  65.         Authorization: `Bearer ${token}`,
  66.         accept: "application/json, text/plain, */*",
  67.         "Content-Type": "application/json;charset=utf-8",
  68.         "Content-Length": 226,
  69.         Host: "appapi.handypick.io",
  70.         Connection: "Keep-Alive",
  71.         "Accept-Encoding": "gzip",
  72.         "User-Agent": "okhttp/3.14.3",
  73.       },
  74.     })
  75.       .then((res) => res.json())
  76.       .then((result) => {
  77.         resolve(result);
  78.       })
  79.       .catch((err) => reject(err));
  80.   });
  81.  
  82. const iklanGais = (token, email, port) =>
  83.   new Promise((resolve, reject) => {
  84.     fetch("https://appapi.handypick.io/settings/get", {
  85.       agent: new SocksProxyAgent(`socks5://127.0.0.1:${port}`),
  86.       method: "POST",
  87.       body: JSON.stringify({
  88.         email: email,
  89.         setting_key: "AD_VIDEO_EXPO_RATIO",
  90.       }),
  91.       headers: {
  92.         Authorization: `Bearer ${token}`,
  93.         accept: "application/json, text/plain, */*",
  94.         "Content-Type": "application/json;charset=utf-8",
  95.         "Content-Length": 226,
  96.         Host: "appapi.handypick.io",
  97.         Connection: "Keep-Alive",
  98.         "Accept-Encoding": "gzip",
  99.         "User-Agent": "okhttp/3.14.3",
  100.       },
  101.     })
  102.       .then((res) => res.json())
  103.       .then((result) => {
  104.         resolve(result);
  105.       })
  106.       .catch((err) => reject(err));
  107.   });
  108.  
  109. const submitGames = (token, user_id, email, game_id, valued, port) =>
  110.   new Promise((resolve, reject) => {
  111.     fetch("https://appapi.handypick.io/game/join-game-msg", {
  112.       agent: new SocksProxyAgent(`socks5://127.0.0.1:${port}`),
  113.       method: "POST",
  114.       body: JSON.stringify({
  115.         user_id,
  116.         email,
  117.         game_id,
  118.         game_type: 0,
  119.         value: JSON.stringify(valued),
  120.         currency: "USD",
  121.       }),
  122.       headers: {
  123.         Authorization: `Bearer ${token}`,
  124.         accept: "application/json, text/plain, */*",
  125.         "Content-Type": "application/json;charset=utf-8",
  126.         "Content-Length": 226,
  127.         Host: "appapi.handypick.io",
  128.         Connection: "Keep-Alive",
  129.         "Accept-Encoding": "gzip",
  130.         "User-Agent": "okhttp/3.14.3",
  131.       },
  132.     })
  133.       .then((res) => res.json())
  134.       .then((result) => {
  135.         resolve(result);
  136.       })
  137.       .catch((err) => reject(err));
  138.   });
  139.  
  140. (async () => {
  141.   const fileport = fs.readFileSync("./port.txt", "utf-8");
  142.   const port = fileport.split("\n");
  143.   const fileakun = fs.readFileSync("./result.txt", "utf-8");
  144.   const akun = fileakun.split("\n");
  145.  
  146.   for (let i = 0; i < akun.length; i++) {
  147.     try {
  148.       const email = akun[i].split("|")[0];
  149.       const token = akun[i].split("|")[1];
  150.       const login = await functionLogin(email, token, port[i]);
  151.       const user_id = login.user_id;
  152.       if (login.result != undefined) {
  153.         const ip_address = login.result.ip_address;
  154.         console.log(`${i + 1} | Sukses Login | ${email} - ${ip_address}`);
  155.         const cekTask = await checkTask(token, user_id, email, port[i]);
  156.         for (let ii = 0; ii < cekTask.results.length; ii++) {
  157.           let predictionJson = [];
  158.           const games_id = cekTask.results[ii].id;
  159.           if (
  160.             cekTask.results[ii].before_game == 1 &&
  161.             cekTask.results[ii].handy_limit === -1 &&
  162.             cekTask.results[ii].join_date == null
  163.           ) {
  164.             console.log(`${i} | ${email} - Ada task Prediksi`);
  165.             const prediction = await checkPrediction(token, games_id, port[i]);
  166.             const predictionLength = prediction.results.length;
  167.             for (let iii = 0; iii < predictionLength; iii++) {
  168.               const key = prediction.results[iii].indexOf(
  169.                 Math.max(...prediction.results[iii])
  170.               );
  171.               predictionJson.push([key]);
  172.             }
  173.             const iklanduluGais = await iklanGais(token, email, port[i]);
  174.             const submit = await submitGames(
  175.               token,
  176.               user_id,
  177.               email,
  178.               games_id,
  179.               predictionJson,
  180.               port[i]
  181.             );
  182.             if (submit.results == 1) {
  183.               console.log(`${i} | ${email} - Sukses Prediksi\n`);
  184.             } else {
  185.               console.log(`${i} | ${email} - ${submit.message}\n`);
  186.             }
  187.           }
  188.         }
  189.       } else {
  190.         console.log("Gagal");
  191.       }
  192.     } catch (e) {
  193.       console.log(e);
  194.     }
  195.   }
  196. })();
  197.