Skip to content

Commit

Permalink
enfucking hance
Browse files Browse the repository at this point in the history
  • Loading branch information
Flam9 committed Dec 8, 2022
1 parent 49c2996 commit d52ab37
Show file tree
Hide file tree
Showing 5 changed files with 584 additions and 556 deletions.
21 changes: 7 additions & 14 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"ts-loader": "^9.2.2",
"ts-node": "^10.0.0",
"typescript": "~4.5.4",
"utp-native": "^2.5.3",
"webtorrent": "^1.9.6"
},
"dependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ app.on("ready", async () => {
try {
const results = await downloadTorrent({
magnetLink:
"magnet:?xt=urn:btih:c9e15763f722f23e98a29decdfae341b98d53056&dn=Cosmos+Laundromat&tr=udp%3A%2F%2Fexplodie.org%3A6969&tr=udp%3A%2F%2Ftracker.coppersurfer.tk%3A6969&tr=udp%3A%2F%2Ftracker.empire-js.us%3A1337&tr=udp%3A%2F%2Ftracker.leechers-paradise.org%3A6969&tr=udp%3A%2F%2Ftracker.opentrackr.org%3A1337&tr=wss%3A%2F%2Ftracker.btorrent.xyz&tr=wss%3A%2F%2Ftracker.fastcast.nz&tr=wss%3A%2F%2Ftracker.openwebtorrent.com&ws=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2F&xs=https%3A%2F%2Fwebtorrent.io%2Ftorrents%2Fcosmos-laundromat.torrent",
"magnet:?xt=urn:btih:6fb2be0f6448fbad2a620c7d934f9d90674bcc16&dn=Roger%20Waters%20-%20The%20Lockdown%20Sessions%20(2022)%20Mp3%20320kbps%20%5bPMEDIA%5d%20%e2%ad%90%ef%b8%8f&tr=http%3a%2f%2ftracker2.wasabii.com.tw%3a6969%2fannounce%2cudp%3a%2f%2ftracker.sktorrent.net%3a6969%2fannounce%2chttp%3a%2f%2fwww.wareztorrent.com%3a80%2fannounce%2cudp%3a%2f%2fbt.xxx-tracker.com%3a2710%2fannounce%2cudp%3a%2f%2ftracker.eddie4.nl%3a6969%2fannounce%2cudp%3a%2f%2ftracker.grepler.com%3a6969%2fannounce%2cudp%3a%2f%2ftracker.mg64.net%3a2710%2fannounce%2cudp%3a%2f%2fwambo.club%3a1337%2fannounce%2cudp%3a%2f%2ftracker.dutchtracking.com%3a6969%2fannounce%2cudp%3a%2f%2ftc.animereactor.ru%3a8082%2fannounce%2cudp%3a%2f%2ftracker.justseed.it%3a1337%2fannounce%2cudp%3a%2f%2ftracker.leechers-paradise.org%3a6969%2fannounce%2cudp%3a%2f%2ftracker.opentrackr.org%3a1337%2fannounce%2chttps%3a%2f%2fopen.kickasstracker.com%3a443%2fannounce%2cudp%3a%2f%2ftracker.coppersurfer.tk%3a6969%2fannounce%2cudp%3a%2f%2fopen.stealth.si%3a80%2fannounce%2chttp%3a%2f%2f87.253.152.137%2fannounce%2chttp%3a%2f%2f91.216.110.47%2fannounce%2chttp%3a%2f%2f91.217.91.21%3a3218%2fannounce%2chttp%3a%2f%2f91.218.230.81%3a6969%2fannounce%2chttp%3a%2f%2f93.92.64.5%2fannounce%2chttp%3a%2f%2fatrack.pow7.com%2fannounce%2chttp%3a%2f%2fbt.henbt.com%3a2710%2fannounce%2chttp%3a%2f%2fbt.pusacg.org%3a8080%2fannounce%2chttps%3a%2f%2ftracker.bt-hash.com%3a443%2fannounce%2cudp%3a%2f%2ftracker.leechers-paradise.org%3a6969%2cudp%3a%2f%2fzephir.monocul.us%3a6969%2fannounce%2chttps%3a%2f%2ftracker.dutchtracking.com%3a80%2fannounce%2chttps%3a%2f%2fgrifon.info%3a80%2fannounce%2cdp%3a%2f%2ftracker.kicks-ass.net%3a80%2fannounce%2cudp%3a%2f%2fp4p.arenabg.com%3a1337%2fannounce%2cudp%3a%2f%2ftracker.aletorrenty.pl%3a2710%2fannounce%2cudp%3a%2f%2ftracker.sktorrent.net%3a6969%2fannounce%2cudp%3a%2f%2ftracker.internetwarriors.net%3a1337%2fannounce%2chttps%3a%2f%2ftracker.parrotsec.org%3a443%2fannounce%2chttps%3a%2f%2ftracker.moxing.party%3a6969%2fannounce%2chttps%3a%2f%2ftracker.ipv6tracker.ru%3a80%2fannounce%2chttps%3a%2f%2ftracker.fastdownload.xyz%3a443%2fannounce%2cudp%3a%2f%2fopen.stealth.si%3a80%2fannounce%2chttps%3a%2f%2fgwp2-v19.rinet.ru%3a80%2fannounce%2chttps%3a%2f%2ftr.kxmp.cf%3a80%2fannounce%2chttps%3a%2f%2fexplodie.org%3a6969%2fannounce",
path: app.getPath("downloads"),
});
console.log("results", results);
Expand Down
8 changes: 6 additions & 2 deletions src/workers/torrent_main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
import { Worker } from "worker_threads";
const MessageType = {
DOWNLOAD_NO_PEERS: "DOWNLOAD_NO_PEERS",
DOWNLOAD_WARNING: "DOWNLOAD_WARNING",
DOWNLOAD_METADATA: "DOWNLOAD_METADATA",
DOWNLOAD_INFOHASH: "DOWNLOAD_INFOHASH",
UPLOAD_PROGRESS: "UPLOAD_PROGRESS",
DOWNLOAD_PROGRESS: "DOWNLOAD_PROGRESS",
DOWNLOAD_FINISHED: "DOWNLOAD_FINISHED",
Expand All @@ -21,7 +25,7 @@ export const downloadTorrent = ({
const worker = new Worker(
// eslint-disable-next-line
// @ts-ignore
new URL("./torrent_worker.mjs", import.meta.url),
new URL("./torrent_worker.js", import.meta.url),
{
workerData: { magnetLink, path },
}
Expand All @@ -36,7 +40,7 @@ export const downloadTorrent = ({
worker.on(
"message",
(message: { type: keyof typeof MessageType; data: any }) => {
// console.log("message", message);
console.log("message", message);

switch (message.type) {
case MessageType.DOWNLOAD_FINISHED:
Expand Down
Loading

0 comments on commit d52ab37

Please sign in to comment.