Skip to content

Commit

Permalink
Fix magnet link not recognized as existing if hash is not in lowercase
Browse files Browse the repository at this point in the history
  • Loading branch information
qu1ck committed Apr 12, 2024
1 parent 34ef484 commit d23bf04
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/trutil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ export function decodeMagnetLink(magnet: string) {
});

let hash = params.find((p) => p[0] === "xt")?.[1] ?? "";
if (hash.startsWith("urn:btih:")) hash = hash.substring(9);
if (hash.startsWith("urn:btih:")) hash = hash.substring(9).toLowerCase();
else hash = "";

const trackers = params
Expand Down

0 comments on commit d23bf04

Please sign in to comment.