fix: normalise redirect url when extracting infohash

This commit is contained in:
Viren070
2025-10-25 15:02:16 +01:00
parent 82db31367a
commit c8cce4176a
+3 -1
View File
@@ -138,7 +138,9 @@ export class TorrentClient {
const redirectUrl = response.headers.get('Location');
if (!redirectUrl) throw new Error('Redirect location not found');
const hash = validateInfoHash(extractInfoHashFromMagnet(redirectUrl));
const hash = validateInfoHash(
extractInfoHashFromMagnet(redirectUrl.toLowerCase())
);
if (!hash) {
if (redirectCount >= 3) {
throw new Error(`Too many redirects: ${redirectUrl}`);