forked from 50n50/sources
Update comet/comet.js
This commit is contained in:
+33
-3
@@ -6,7 +6,7 @@ const cachedOnly = false; // [true, false]
|
|||||||
const removeTrash = true; // [true, false]
|
const removeTrash = true; // [true, false]
|
||||||
const resultFormat = "all"; // ["all"]
|
const resultFormat = "all"; // ["all"]
|
||||||
const debridService = "realdebrid"; // ["realdebrid", "alldebrid", "premiumize", "torbox", "debridlink"]
|
const debridService = "realdebrid"; // ["realdebrid", "alldebrid", "premiumize", "torbox", "debridlink"]
|
||||||
const debridApiKey = "";
|
const debridApiKey = "DAD4OJCOD46VAWYXIFFZ6YXNAVJ4NOTL32GIPRLVMXW4U32BGAMQ";
|
||||||
const debridStreamProxyPassword = "";
|
const debridStreamProxyPassword = "";
|
||||||
const languagesExclude = "";
|
const languagesExclude = "";
|
||||||
const languagesPreferred = "en";
|
const languagesPreferred = "en";
|
||||||
@@ -15,6 +15,36 @@ const allowEnglishInLanguages = false; // [true, false]
|
|||||||
const removeUnknownLanguages = false; // [true, false]
|
const removeUnknownLanguages = false; // [true, false]
|
||||||
// Settings end
|
// Settings end
|
||||||
|
|
||||||
|
function btoa(str) {
|
||||||
|
if (typeof globalThis !== "undefined" && typeof globalThis.btoa === "function" && globalThis.btoa !== btoa) {
|
||||||
|
return globalThis.btoa(str);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (typeof Buffer !== "undefined") {
|
||||||
|
return Buffer.from(str, "utf8").toString("base64");
|
||||||
|
}
|
||||||
|
|
||||||
|
const chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||||
|
let result = "";
|
||||||
|
let i = 0;
|
||||||
|
|
||||||
|
while (i < str.length) {
|
||||||
|
const byte1 = str.charCodeAt(i++) & 0xff;
|
||||||
|
const hasByte2 = i < str.length;
|
||||||
|
const byte2 = hasByte2 ? str.charCodeAt(i++) & 0xff : 0;
|
||||||
|
const hasByte3 = i < str.length;
|
||||||
|
const byte3 = hasByte3 ? str.charCodeAt(i++) & 0xff : 0;
|
||||||
|
|
||||||
|
const chunk = (byte1 << 16) | (byte2 << 8) | byte3;
|
||||||
|
result += chars[(chunk >> 18) & 63];
|
||||||
|
result += chars[(chunk >> 12) & 63];
|
||||||
|
result += hasByte2 ? chars[(chunk >> 6) & 63] : "=";
|
||||||
|
result += hasByte3 ? chars[chunk & 63] : "=";
|
||||||
|
}
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
async function searchResults(keyword) {
|
async function searchResults(keyword) {
|
||||||
try {
|
try {
|
||||||
const moviesresponse = await fetchv2(
|
const moviesresponse = await fetchv2(
|
||||||
@@ -186,8 +216,8 @@ async function extractStreamUrl(ID) {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
const endpoint = type === "movie"
|
const endpoint = type === "movie"
|
||||||
? "https://comet.elfhosted.com/" + encodedConfig + "/stream/movie/" + actualID + ".json"
|
? "https://comet.feels.legal/" + encodedConfig + "/stream/movie/" + actualID + ".json"
|
||||||
: "https://comet.elfhosted.com/" + encodedConfig + "/stream/series/" + actualID + ".json";
|
: "https://comet.feels.legal/" + encodedConfig + "/stream/series/" + actualID + ".json";
|
||||||
|
|
||||||
const response = await fetchv2(endpoint);
|
const response = await fetchv2(endpoint);
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
|
|||||||
Reference in New Issue
Block a user