From 23433b6e466a8fcb76d9156406e67f411aec2eaa Mon Sep 17 00:00:00 2001 From: Hydra Date: Sat, 20 Apr 2024 17:30:03 +0100 Subject: [PATCH] chore: removing qs --- package.json | 1 - .../services/repack-tracker/online-fix.ts | 16 ++++---- src/main/services/repack-tracker/xatab.ts | 2 - yarn.lock | 38 ++++++++++++++----- 4 files changed, 35 insertions(+), 22 deletions(-) diff --git a/package.json b/package.json index 6eb038ff5..848538982 100644 --- a/package.json +++ b/package.json @@ -89,7 +89,6 @@ "lottie-react": "^2.4.0", "parse-torrent": "9.1.5", "ps-list": "^8.1.1", - "qs": "^6.12.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-i18next": "^14.1.0", diff --git a/src/main/services/repack-tracker/online-fix.ts b/src/main/services/repack-tracker/online-fix.ts index 85583d64a..fdcd1513c 100644 --- a/src/main/services/repack-tracker/online-fix.ts +++ b/src/main/services/repack-tracker/online-fix.ts @@ -2,7 +2,6 @@ import { Repack } from "@main/entity"; import { savePage } from "./helpers"; import type { GameRepackInput } from "./helpers"; import { logger } from "../logger"; -import { stringify } from "qs"; import parseTorrent, { toMagnetURI, Instance as TorrentInstance, @@ -58,8 +57,12 @@ export const getNewRepacksFromOnlineFix = async ( if (!preLogin.field || !preLogin.value) return; - const tokenField = preLogin.field; - const tokenValue = preLogin.value; + const params = new URLSearchParams({ + login_name: process.env.ONLINEFIX_USERNAME, + login_password: process.env.ONLINEFIX_PASSWORD, + login: "submit", + [preLogin.field]: preLogin.value, + }); await http .post("https://online-fix.me/", { @@ -69,12 +72,7 @@ export const getNewRepacksFromOnlineFix = async ( Origin: "https://online-fix.me", "Content-Type": "application/x-www-form-urlencoded", }, - body: stringify({ - login_name: process.env.ONLINEFIX_USERNAME, - login_password: process.env.ONLINEFIX_PASSWORD, - login: "submit", - [tokenField]: tokenValue, - }), + body: params.toString(), }) .text(); } diff --git a/src/main/services/repack-tracker/xatab.ts b/src/main/services/repack-tracker/xatab.ts index 4ea968fb9..91a0a4c4c 100644 --- a/src/main/services/repack-tracker/xatab.ts +++ b/src/main/services/repack-tracker/xatab.ts @@ -42,8 +42,6 @@ const getXatabRepack = async (url: string) => { if (!$downloadButton) throw new Error("Download button not found"); const torrentBuffer = await getTorrentBuffer($downloadButton.href); - console.log(url); - console.log(torrentBuffer.byteLength); return { fileSize: formatXatabDownloadSize($size.textContent).toUpperCase(), diff --git a/yarn.lock b/yarn.lock index 5d34214ee..8b36bcdb7 100644 --- a/yarn.lock +++ b/yarn.lock @@ -8894,13 +8894,6 @@ qs@6.11.0: dependencies: side-channel "^1.0.4" -qs@^6.12.0: - version "6.12.1" - resolved "https://registry.yarnpkg.com/qs/-/qs-6.12.1.tgz#39422111ca7cbdb70425541cba20c7d7b216599a" - integrity sha512-zWmv4RSuB9r2mYQw3zxQuHWeU+42aKi1wWig/j4ele4ygELZ7PEO6MM7rim9oAQH2A5MWfsAVf/jPvTPgCbvUQ== - dependencies: - side-channel "^1.0.6" - querystringify@^2.1.1: version "2.2.0" resolved "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz" @@ -9896,7 +9889,16 @@ stream-transform@^2.1.3: dependencies: mixme "^0.5.1" -"string-width-cjs@npm:string-width@^4.2.0", "string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: +"string-width-cjs@npm:string-width@^4.2.0": + version "4.2.3" + resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" + integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== + dependencies: + emoji-regex "^8.0.0" + is-fullwidth-code-point "^3.0.0" + strip-ansi "^6.0.1" + +"string-width@^1.0.2 || 2 || 3 || 4", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3: version "4.2.3" resolved "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz" integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g== @@ -9974,7 +9976,14 @@ string_decoder@~1.1.1: dependencies: safe-buffer "~5.1.0" -"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1: +"strip-ansi-cjs@npm:strip-ansi@^6.0.1": + version "6.0.1" + resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-ansi@^6.0.0, strip-ansi@^6.0.1: version "6.0.1" resolved "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz" integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== @@ -11010,7 +11019,16 @@ word-wrap@^1.2.3: resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34" integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA== -"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@^7.0.0: +"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0": + version "7.0.0" + resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" + integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q== + dependencies: + ansi-styles "^4.0.0" + string-width "^4.1.0" + strip-ansi "^6.0.0" + +wrap-ansi@^7.0.0: version "7.0.0" resolved "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz" integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==