debug test

This commit is contained in:
Inside4ndroid
2024-07-25 23:23:38 +01:00
parent c01740e82a
commit 52f1478269
+12 -1
View File
@@ -109,8 +109,19 @@ async function episode(data_id) {
}
export async function getmovie(id) {
let resp = await (await fetch(`https://vidsrc.to/embed/movie/${id}`)).text();
let data_id = (/data-id="(.*?)"/g).exec(resp)[1];
// Validate the response content
console.log(resp);
const match = (/data-id="(.*?)"/g).exec(resp);
if (!match) {
throw new Error('Failed to extract data-id from response');
}
let data_id = match[1];
return episode(data_id);
}