mirror of
https://github.com/Inside4ndroid/TMDB-Embed-API.git
synced 2026-10-22 17:45: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) {
|
async function getVidsrcSources(sourceId) {
|
||||||
try {
|
try {
|
||||||
const response = await fetch(`${vidsrcBase}/ajax/embed/episode/${sourceId}/sources`);
|
const response = await fetch(`${vidsrcBase}/ajax/embed/episode/${sourceId}/sources`);
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
return 'No Sources Found';
|
return 'No Sources Found';
|
||||||
} else {
|
}
|
||||||
|
|
||||||
|
const contentType = response.headers.get("content-type");
|
||||||
|
if (contentType && contentType.includes("application/json")) {
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
return data;
|
return data;
|
||||||
|
} else {
|
||||||
|
const text = await response.text();
|
||||||
|
console.error("Unexpected content type or response:", text);
|
||||||
|
return 'Unexpected content type or response';
|
||||||
}
|
}
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user