mirror of
https://github.com/Inside4ndroid/TMDB-Embed-API.git
synced 2026-10-22 09:35:11 +00:00
aaaa
This commit is contained in:
+9
-1
@@ -81,11 +81,19 @@ export async function getVidsrcSourcesId(tmdbId, seasonNumber, episodeNumber) {
|
||||
async function getVidsrcSources(sourceId) {
|
||||
try {
|
||||
const response = await fetch(`${vidsrcBase}/ajax/embed/episode/${sourceId}/sources`);
|
||||
|
||||
if (!response.ok) {
|
||||
return 'No Sources Found';
|
||||
} else {
|
||||
}
|
||||
|
||||
const contentType = response.headers.get("content-type");
|
||||
if (contentType && contentType.includes("application/json")) {
|
||||
const data = await response.json();
|
||||
return data;
|
||||
} else {
|
||||
const text = await response.text();
|
||||
console.error("Unexpected content type or response:", text);
|
||||
return 'Unexpected content type or response';
|
||||
}
|
||||
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user