extension(autoembed): added vidsrc.su & removed febapi

This commit is contained in:
Swakshan
2025-03-09 14:29:38 +05:30
parent c08f9d49e1
commit 1f9534c8b2

View File

@@ -7,7 +7,7 @@ const mangayomiSources = [{
"typeSource": "multi",
"isManga": false,
"itemType": 1,
"version": "1.2.1",
"version": "1.2.2",
"dateFormat": "",
"dateFormatLocale": "",
"pkgPath": "anime/src/all/autoembed.js"
@@ -253,7 +253,7 @@ class DefaultExtension extends MProvider {
// For anime episode video list
async getVideoList(url) {
var streamAPI = parseInt(this.getPreference("autoembed_stream_source"))
var streamAPI = parseInt(this.getPreference("autoembed_stream_source_2"))
var parts = url.split("||");
var media_type = parts[0];
@@ -327,7 +327,7 @@ class DefaultExtension extends MProvider {
id = `${id}&season=${s}&episode=${e}`
}
var api = `https://flicky.host/player/desi.php?id=${id}`
var response = await new Client().get(api, { "Referer": "https://flicky.host/" ,"sec-fetch-dest":"iframe"});
var response = await new Client().get(api, { "Referer": "https://flicky.host/", "sec-fetch-dest": "iframe" });
if (response.statusCode != 200) {
throw new Error("Video unavailable");
@@ -384,12 +384,15 @@ class DefaultExtension extends MProvider {
var body = JSON.parse(response.body);
var strms = body.streams
for (var strm of strms) {
streams.push({
url: strm.url,
originalUrl: strm.url,
quality: strm.quality,
headers: strm.headers
});
var streamLink = strm.url;
if (streamLink.length > 0) {
streams.push({
url: strm.url,
originalUrl: strm.url,
quality: `${strm.label} - Auto`,
headers: strm.headers
});
}
}
break;
}
@@ -397,24 +400,51 @@ class DefaultExtension extends MProvider {
if (media_type == "tv") {
id = `${id}/${s}/${e}`
}
var api = `https://febapi.bludclart.com/${media_type}/${id}`
var api = `https://vidsrc.su/embed/${media_type}/${id}`
var response = await new Client().get(api);
if (response.statusCode != 200) {
throw new Error("Video unavailable");
throw new Error("vidsrc.su unavailable");
}
var body = response.body
var sKey = 'fixedServers = '
var eKey = "];"
var start = body.indexOf(sKey)
if (start < 0) {
throw new Error("vidsrc.su unavailable");
}
start += sKey.length
var end = body.substring(start,).indexOf(eKey) + start + 1
var strms = body.substring(start, end)
// Split the data into lines
var lines = strms.split('\n');
// Regex to match URLs in quotes that start with https://
var regex = /url:\s*'(https:\/\/[^']+)'/;
var availableStreams = [];
// Process each line
lines.forEach(line => {
var match = line.match(regex);
if (match && match[1]) {
// Extract the label from the line
var labelMatch = line.match(/label:\s*'([^']+)'/);
var label = labelMatch ? labelMatch[1] : "Unknown";
// Add to our results
availableStreams.push({
url: match[1],
label: label,
});
}
});
for (var stream of availableStreams) {
var streamSplit = await this.splitStreams(stream.url, stream.label);
streams = [...streams, ...streamSplit]
}
var body = JSON.parse(response.body);
var strms = body.streams.qualities
for (var strm in strms) {
var quality = strm === "ORG" ? "auto" : strm
var url = strms[strm]
streams.push({
url: url,
originalUrl: url,
quality: quality,
});
}
break;
}
default: {
@@ -483,12 +513,12 @@ class DefaultExtension extends MProvider {
}
},
{
key: 'autoembed_stream_source',
key: 'autoembed_stream_source_2',
listPreference: {
title: 'Preferred stream source',
summary: '',
valueIndex: 0,
entries: ["tom.autoembed.cc", "123embed.net", "autoembed.cc - Indian languages", "flicky.host - Indian languages", "vidapi.click", "hexa.watch", "febapi (supports 4K)"],
entries: ["tom.autoembed.cc", "123embed.net", "autoembed.cc - Indian languages", "flicky.host - Indian languages", "vidapi.click", "hexa.watch", "vidsrc.su"],
entryValues: ["1", "2", "3", "4", "5", "6", "7"]
}
},