Skip to content

Commit

Permalink
chore: removing qs
Browse files Browse the repository at this point in the history
  • Loading branch information
thegrannychaseroperation committed Apr 20, 2024
1 parent addc2cf commit 23433b6
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 22 deletions.
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 7 additions & 9 deletions src/main/services/repack-tracker/online-fix.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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/", {
Expand All @@ -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();
}
Expand Down
2 changes: 0 additions & 2 deletions src/main/services/repack-tracker/xatab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
38 changes: 28 additions & 10 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8894,13 +8894,6 @@ [email protected]:
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"
Expand Down Expand Up @@ -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==
Expand Down Expand Up @@ -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==
Expand Down Expand Up @@ -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==
Expand Down

0 comments on commit 23433b6

Please sign in to comment.