From 038c07c1b836a9b3c2662ed6ed8a505f00ddb639 Mon Sep 17 00:00:00 2001 From: wukko Date: Thu, 22 Jun 2023 20:24:01 +0600 Subject: [PATCH] attempt to fix the weird issue with authorization --- src/config.json | 2 +- src/localization/languages/en.json | 2 +- src/modules/stream/manage.js | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/config.json b/src/config.json index 91915bcf..d4505721 100644 --- a/src/config.json +++ b/src/config.json @@ -28,7 +28,7 @@ "litecoin": "ltc1qvp0xhrk2m7pa6p6z844qcslfyxv4p3vf95rhna" }, "links": { - "boosty": "https://boosty.to/wukko" + "boosty": "https://boosty.to/wukko/donate" } }, "links": { diff --git a/src/localization/languages/en.json b/src/localization/languages/en.json index 73677098..a6d15b73 100644 --- a/src/localization/languages/en.json +++ b/src/localization/languages/en.json @@ -29,7 +29,7 @@ "ErrorCouldntFetch": "i couldn't find anything about this link. check if it works and try again! some content may be region restricted, so keep that in mind.", "ErrorLengthLimit": "i can't process videos longer than {s} minutes, so pick something shorter instead!", "ErrorBadFetch": "something went wrong when i tried getting info about your link. are you sure it works? check if it does, and try again.", - "ErrorNoInternet": "there's no internet or {appName} api is down. check your connection and try again.", + "ErrorNoInternet": "there's no internet or {appName} api is temporarily unavailable. check your connection and try again.", "ErrorCantConnectToServiceAPI": "i couldn't connect to the service api. maybe it's down, or {appName} got blocked. try again, but if error persists, {ContactLink}.", "ErrorEmptyDownload": "i don't see anything i could download by your link. try a different one!", "ErrorLiveVideo": "this is a live video, i am yet to learn how to look into future. wait for the stream to finish and try again!", diff --git a/src/modules/stream/manage.js b/src/modules/stream/manage.js index ed2d2902..2a6011c8 100644 --- a/src/modules/stream/manage.js +++ b/src/modules/stream/manage.js @@ -44,9 +44,9 @@ export function createStream(obj) { export function verifyStream(ip, id, hmac, exp) { try { - if (id.length === 21) { - let streamInfo = streamCache.get(id); - if (!streamInfo) return { error: 'this stream token does not exist', status: 400 }; + if (id.toString().length === 21) { + let streamInfo = streamCache.get(id.toString()); + if (!streamInfo) return { error: "requested stream does not exist", status: 400 }; let ghmac = sha256(`${id},${ip},${streamInfo.service},${exp}`, streamSalt); if (String(hmac) === ghmac && String(exp) === String(streamInfo.exp) && ghmac === String(streamInfo.hmac) @@ -54,7 +54,7 @@ export function verifyStream(ip, id, hmac, exp) { return streamInfo; } } - return { error: "i couldn't verify whether you have access to this stream. try again or refresh the page!", status: 401 }; + return { error: "i couldn't verify whether you have access to this download. try again or refresh the page!", status: 401 }; } catch (e) { return { status: 500, body: { status: "error", text: "Internal Server Error" } }; }