mirror of
https://github.com/MasterAcnolo/Freedom-Loader.git
synced 2026-09-27 20:11:15 +02:00
refactor: changed /info router from POST to GET
This commit is contained in:
committed by
MasterAcnolo
parent
c67a1511a5
commit
df0952c231
@@ -30,15 +30,15 @@ function formatSize(bytes) {
|
||||
*/
|
||||
async function fetchVideoInfo(url) {
|
||||
try {
|
||||
const res = await fetch("/info", {
|
||||
method: "POST",
|
||||
headers: { "Content-Type": "application/x-www-form-urlencoded" },
|
||||
body: new URLSearchParams({ url }),
|
||||
const res = await fetch(`/info?url=${encodeURIComponent(url)}`, {
|
||||
method: "GET",
|
||||
headers: {"Accept": "application/json"}
|
||||
});
|
||||
|
||||
if (!res.ok) return { error: `An Error occured when fetching info` };
|
||||
|
||||
const data = await res.json();
|
||||
|
||||
if (!res.ok) return {error: `An Error occured when fetching info`};
|
||||
|
||||
if (!data) return { error: "Data is Missing" };
|
||||
|
||||
return data;
|
||||
|
||||
Reference in New Issue
Block a user