From 813a8296e2121dcb170487e893e998a73bd1e5c5 Mon Sep 17 00:00:00 2001 From: Karl Date: Sun, 19 Sep 2021 10:29:56 +0000 Subject: [PATCH] udpated --- lib/DNSArray.json | 3 ++- lib/checker.js | 8 +++++++- routes/addAccount.js | 6 ++++++ routes/getStreams.js | 7 ++++++- 4 files changed, 21 insertions(+), 3 deletions(-) diff --git a/lib/DNSArray.json b/lib/DNSArray.json index d070b08..4e5df71 100644 --- a/lib/DNSArray.json +++ b/lib/DNSArray.json @@ -1,4 +1,5 @@ [ "http://webservgroup.xyz/smarters4567891/api/home.php?action=dns", - "http://panelhost.xyz/cli3nts/Funky/Smarters/api/home.php?action=dns" + "http://panelhost.xyz/cli3nts/Funky/Smarters/api/home.php?action=dns", + "http://panelhost.xyz/cli3nts/smartersv3/funky/api/home.php?action=dns" ] \ No newline at end of file diff --git a/lib/checker.js b/lib/checker.js index 2674596..7fcaa6c 100644 --- a/lib/checker.js +++ b/lib/checker.js @@ -170,6 +170,7 @@ async function newSingleCheck(accountData) { for (let streamURL of streamURLS) { process.stdout.write('.') let url = await buildURL(streamURL, userAccount.username, userAccount.passwordDecryped) + console.log('trying ' + url) let t = await gotRequest(url) let body = t.body if (t.statusCode == 200 && body !== "") { @@ -223,11 +224,16 @@ async function newSingleCheck(accountData) { // } // // } +// newSingleCheck // main() // singleCheck('Karl2903') // newCheck() -// newSingleCheck('Karl1607', 'Ybkjqszr1z') +newSingleCheck({ + "username":'Karl0ss1709', + "password":'YEfbZskEH2Zu', + "stream": "Badger", + "userId":1}) module.exports = { newCheck, diff --git a/routes/addAccount.js b/routes/addAccount.js index b13e7c7..86f2367 100644 --- a/routes/addAccount.js +++ b/routes/addAccount.js @@ -10,6 +10,12 @@ const { newSingleCheck } = require('../lib/checker') /* POST postUser page. */ router.post('/', async function (req, res, next) { let postData = req.body + for (var key in postData) { + postData[key] = postData[key].trim(); + } + if (postData.username.includes('KarlOss')) { + postData.username = postData.username.replace("O", "0") + } postData.userId = getUserId(req.auth.user) let userName = req.auth.user let result = await storeAccountToDB(postData) diff --git a/routes/getStreams.js b/routes/getStreams.js index aa31287..3226050 100644 --- a/routes/getStreams.js +++ b/routes/getStreams.js @@ -56,7 +56,12 @@ async function getStreamsNew() { requestData = await gotRequest(url) let DNSList = requestData.body if (typeof DNSList === 'string' || DNSList instanceof String) { - DNSList = JSON.parse(DNSList) + try { + DNSList = JSON.parse(DNSList) + } catch (error) { + jointArray.unshift(...otherURLs) + return jointArray + } } DNSList = splitToArray(DNSList.su) DNSList.forEach(url => {