mirror of
https://github.com/hydralauncher/hydra.git
synced 2026-01-28 05:11:02 +00:00
feat: removing sentry
This commit is contained in:
@@ -1,15 +1,16 @@
|
||||
import { Repack } from "@main/entity";
|
||||
import { decodeNonUtf8Response, savePage } from "./helpers";
|
||||
import { logger } from "../logger";
|
||||
import parseTorrent, {
|
||||
toMagnetURI,
|
||||
Instance as TorrentInstance,
|
||||
} from "parse-torrent";
|
||||
import { JSDOM } from "jsdom";
|
||||
|
||||
import { format, parse, sub } from "date-fns";
|
||||
import { ru } from "date-fns/locale";
|
||||
|
||||
import createWorker from "@main/workers/torrent-parser.worker?nodeWorker";
|
||||
import { toMagnetURI } from "parse-torrent";
|
||||
|
||||
const worker = createWorker({});
|
||||
|
||||
import { onlinefixFormatter } from "@main/helpers";
|
||||
import makeFetchCookie from "fetch-cookie";
|
||||
import { QueryDeepPartialEntity } from "typeorm/query-builder/QueryPartialEntity";
|
||||
@@ -139,27 +140,23 @@ export const getNewRepacksFromOnlineFix = async (
|
||||
?.getAttribute("href");
|
||||
|
||||
const torrentFile = Buffer.from(
|
||||
await http(`${torrentPrePage}/${torrentLink}`).then((res) =>
|
||||
await http(`${torrentPrePage}${torrentLink}`).then((res) =>
|
||||
res.arrayBuffer()
|
||||
)
|
||||
);
|
||||
|
||||
const torrent = parseTorrent(torrentFile) as TorrentInstance;
|
||||
const magnetLink = toMagnetURI({
|
||||
infoHash: torrent.infoHash,
|
||||
worker.once("message", (torrent) => {
|
||||
repacks.push({
|
||||
fileSize: formatBytes(torrent.length ?? 0),
|
||||
magnet: toMagnetURI(torrent),
|
||||
page: 1,
|
||||
repacker: "onlinefix",
|
||||
title: gameName,
|
||||
uploadDate: uploadDate,
|
||||
});
|
||||
});
|
||||
|
||||
const torrentSizeInBytes = torrent.length;
|
||||
if (!torrentSizeInBytes) return;
|
||||
|
||||
repacks.push({
|
||||
fileSize: formatBytes(torrentSizeInBytes),
|
||||
magnet: magnetLink,
|
||||
page: 1,
|
||||
repacker: "onlinefix",
|
||||
title: gameName,
|
||||
uploadDate: uploadDate,
|
||||
});
|
||||
worker.postMessage(torrentFile);
|
||||
})
|
||||
);
|
||||
} catch (err: unknown) {
|
||||
|
||||
Reference in New Issue
Block a user