mirror of
https://git.luna-app.eu/50n50/sources
synced 2025-12-21 21:26:19 +01:00
Upload
This commit is contained in:
commit
09c423e95a
276 changed files with 54396 additions and 0 deletions
295
asialiveaction/asialiveaction.js
Normal file
295
asialiveaction/asialiveaction.js
Normal file
|
|
@ -0,0 +1,295 @@
|
|||
async function searchResults(keyword) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetchv2("https://asialiveaction.com/?s=" + encodeURIComponent(keyword));
|
||||
const html = await response.text();
|
||||
|
||||
const containerMatch = html.match(/<ul class="navegacion-grid">([\s\S]*?)<\/ul>/);
|
||||
if (!containerMatch) return JSON.stringify([]);
|
||||
|
||||
const containerHtml = containerMatch[1];
|
||||
|
||||
const regex = /<a href="([^"]+)"[^>]*>[\s\S]*?<h5 class="carousel-title">([\s\S]*?)<\/h5>[\s\S]*?<img[^>]+src="([^"]+)"/g;
|
||||
|
||||
let match;
|
||||
while ((match = regex.exec(containerHtml)) !== null) {
|
||||
results.push({
|
||||
title: match[2].trim(),
|
||||
image: match[3].trim(),
|
||||
href: match[1].trim()
|
||||
});
|
||||
}
|
||||
|
||||
return JSON.stringify(results);
|
||||
} catch (err) {
|
||||
return JSON.stringify([{
|
||||
title: "Error",
|
||||
image: "Error",
|
||||
href: "Error"
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
async function extractDetails(url) {
|
||||
try {
|
||||
const response = await fetchv2(url);
|
||||
const html = await response.text();
|
||||
|
||||
const titleMatch = html.match(/<h2 class="Title">\s*([\s\S]*?)\s*<\/h2>/);
|
||||
const descriptionMatch = html.match(/<p>([\s\S]*?)<\/p>/);
|
||||
|
||||
const description = descriptionMatch ? descriptionMatch[1].trim() : "N/A";
|
||||
const title = titleMatch ? titleMatch[1].trim() : "N/A";
|
||||
|
||||
return JSON.stringify([{
|
||||
description: description,
|
||||
aliases: title,
|
||||
airdate: "N/A"
|
||||
}]);
|
||||
} catch (err) {
|
||||
return JSON.stringify([{
|
||||
description: "Error",
|
||||
aliases: "Error",
|
||||
airdate: "Error"
|
||||
}]);
|
||||
}
|
||||
}
|
||||
|
||||
async function extractEpisodes(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetchv2(url);
|
||||
const html = await response.text();
|
||||
|
||||
const listMatch = html.match(/<div class="lista-episodios">([\s\S]*?)<\/div>\s*<\/div>/);
|
||||
if (!listMatch) return JSON.stringify([]);
|
||||
|
||||
const listHtml = listMatch[1];
|
||||
|
||||
const regex = /<a href="([^"]+)">[\s\S]*?<b class="numero-episodio">Episodio (\d+)<\/b>/g;
|
||||
let match;
|
||||
while ((match = regex.exec(listHtml)) !== null) {
|
||||
results.push({
|
||||
href: match[1].trim(),
|
||||
number: parseInt(match[2], 10)
|
||||
});
|
||||
}
|
||||
|
||||
return JSON.stringify(results);
|
||||
} catch (err) {
|
||||
return JSON.stringify([{ href: "Error", number: "Error" }]);
|
||||
}
|
||||
}
|
||||
|
||||
async function extractStreamUrl(url) {
|
||||
try {
|
||||
const response = await fetchv2(url);
|
||||
const html = await response.text();
|
||||
|
||||
const match = html.match(/\["FM","(https:\\?\/\\?\/filemoon\.to\\?\/e\\?\/[^"]+)"/);
|
||||
|
||||
const filemoonLink = match[1].replace(/\\\//g, "/");
|
||||
console.log(filemoonLink);
|
||||
|
||||
const response2 = await fetchv2(filemoonLink);
|
||||
const html2 = await response2.text();
|
||||
let streamUrl = null;
|
||||
try {
|
||||
streamUrl = await filemoonExtractor(html2, filemoonLink);
|
||||
} catch (error) {
|
||||
console.log("filemoon HD extraction error:" + error);
|
||||
}
|
||||
|
||||
console.log("filemoon Stream URL: " + streamUrl);
|
||||
if (streamUrl && streamUrl !== false && streamUrl !== null) {
|
||||
return streamUrl;
|
||||
}
|
||||
|
||||
console.log("No stream URL found");
|
||||
|
||||
return null;
|
||||
} catch (error) {
|
||||
console.log("Fetch error:", error);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/* SCHEME START */
|
||||
/* {REQUIRED PLUGINS: unbaser} */
|
||||
|
||||
/**
|
||||
* @name filemoonExtractor
|
||||
* @author Cufiy - Inspired by Churly
|
||||
*/
|
||||
|
||||
async function filemoonExtractor(html, url = null) {
|
||||
// check if contains iframe, if does, extract the src and get the url
|
||||
const regex = /<iframe[^>]+src="([^"]+)"[^>]*><\/iframe>/;
|
||||
const match = html.match(regex);
|
||||
if (match) {
|
||||
console.log("Iframe URL: " + match[1]);
|
||||
const iframeUrl = match[1];
|
||||
const iframeResponse = await soraFetch(iframeUrl, {
|
||||
headers: {
|
||||
"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3",
|
||||
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
|
||||
"Referer": url,
|
||||
}
|
||||
});
|
||||
console.log("Iframe Response: " + iframeResponse.status);
|
||||
html = await iframeResponse.text();
|
||||
}
|
||||
// console.log("HTML: " + html);
|
||||
// get /<script[^>]*>([\s\S]*?)<\/script>/gi
|
||||
const scriptRegex = /<script[^>]*>([\s\S]*?)<\/script>/gi;
|
||||
const scripts = [];
|
||||
let scriptMatch;
|
||||
while ((scriptMatch = scriptRegex.exec(html)) !== null) {
|
||||
scripts.push(scriptMatch[1]);
|
||||
}
|
||||
// get the script with eval and m3u8
|
||||
const evalRegex = /eval\((.*?)\)/;
|
||||
const m3u8Regex = /m3u8/;
|
||||
// console.log("Scripts: " + scripts);
|
||||
const evalScript = scripts.find(script => evalRegex.test(script) && m3u8Regex.test(script));
|
||||
if (!evalScript) {
|
||||
console.log("No eval script found");
|
||||
return null;
|
||||
}
|
||||
const unpackedScript = unpack(evalScript);
|
||||
// get the m3u8 url
|
||||
const m3u8Regex2 = /https?:\/\/[^\s]+master\.m3u8[^\s]*?(\?[^"]*)?/;
|
||||
const m3u8Match = unpackedScript.match(m3u8Regex2);
|
||||
if (m3u8Match) {
|
||||
return m3u8Match[0];
|
||||
} else {
|
||||
console.log("No M3U8 URL found");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/* REMOVE_START */
|
||||
|
||||
|
||||
class Unbaser {
|
||||
constructor(base) {
|
||||
this.ALPHABET = {
|
||||
62: "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ",
|
||||
95: "' !\"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~'",
|
||||
};
|
||||
this.dictionary = {};
|
||||
this.base = base;
|
||||
if (36 < base && base < 62) {
|
||||
this.ALPHABET[base] = this.ALPHABET[base] ||
|
||||
this.ALPHABET[62].substr(0, base);
|
||||
}
|
||||
if (2 <= base && base <= 36) {
|
||||
this.unbase = (value) => parseInt(value, base);
|
||||
}
|
||||
else {
|
||||
try {
|
||||
[...this.ALPHABET[base]].forEach((cipher, index) => {
|
||||
this.dictionary[cipher] = index;
|
||||
});
|
||||
}
|
||||
catch (er) {
|
||||
throw Error("Unsupported base encoding.");
|
||||
}
|
||||
this.unbase = this._dictunbaser;
|
||||
}
|
||||
}
|
||||
_dictunbaser(value) {
|
||||
let ret = 0;
|
||||
[...value].reverse().forEach((cipher, index) => {
|
||||
ret = ret + ((Math.pow(this.base, index)) * this.dictionary[cipher]);
|
||||
});
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function unpack(source) {
|
||||
let { payload, symtab, radix, count } = _filterargs(source);
|
||||
if (count != symtab.length) {
|
||||
throw Error("Malformed p.a.c.k.e.r. symtab.");
|
||||
}
|
||||
let unbase;
|
||||
try {
|
||||
unbase = new Unbaser(radix);
|
||||
}
|
||||
catch (e) {
|
||||
throw Error("Unknown p.a.c.k.e.r. encoding.");
|
||||
}
|
||||
function lookup(match) {
|
||||
const word = match;
|
||||
let word2;
|
||||
if (radix == 1) {
|
||||
word2 = symtab[parseInt(word)];
|
||||
}
|
||||
else {
|
||||
word2 = symtab[unbase.unbase(word)];
|
||||
}
|
||||
return word2 || word;
|
||||
}
|
||||
source = payload.replace(/\b\w+\b/g, lookup);
|
||||
return _replacestrings(source);
|
||||
function _filterargs(source) {
|
||||
const juicers = [
|
||||
/}\('(.*)', *(\d+|\[\]), *(\d+), *'(.*)'\.split\('\|'\), *(\d+), *(.*)\)\)/,
|
||||
/}\('(.*)', *(\d+|\[\]), *(\d+), *'(.*)'\.split\('\|'\)/,
|
||||
];
|
||||
for (const juicer of juicers) {
|
||||
const args = juicer.exec(source);
|
||||
if (args) {
|
||||
let a = args;
|
||||
if (a[2] == "[]") {
|
||||
}
|
||||
try {
|
||||
return {
|
||||
payload: a[1],
|
||||
symtab: a[4].split("|"),
|
||||
radix: parseInt(a[2]),
|
||||
count: parseInt(a[3]),
|
||||
};
|
||||
}
|
||||
catch (ValueError) {
|
||||
throw Error("Corrupted p.a.c.k.e.r. data.");
|
||||
}
|
||||
}
|
||||
}
|
||||
throw Error("Could not make sense of p.a.c.k.e.r data (unexpected code structure)");
|
||||
}
|
||||
function _replacestrings(source) {
|
||||
return source;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Uses Sora's fetchv2 on ipad, fallbacks to regular fetch on Windows
|
||||
* @author ShadeOfChaos
|
||||
*
|
||||
* @param {string} url The URL to make the request to.
|
||||
* @param {object} [options] The options to use for the request.
|
||||
* @param {object} [options.headers] The headers to send with the request.
|
||||
* @param {string} [options.method='GET'] The method to use for the request.
|
||||
* @param {string} [options.body=null] The body of the request.
|
||||
*
|
||||
* @returns {Promise<Response|null>} The response from the server, or null if the
|
||||
* request failed.
|
||||
*/
|
||||
async function soraFetch(url, options = { headers: {}, method: 'GET', body: null }) {
|
||||
try {
|
||||
return await fetchv2(url, options.headers ?? {}, options.method ?? 'GET', options.body ?? null);
|
||||
} catch(e) {
|
||||
try {
|
||||
return await fetch(url, options);
|
||||
} catch(error) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
/* REMOVE_END */
|
||||
|
||||
/* SCHEME END */
|
||||
19
asialiveaction/asialiveaction.json
Normal file
19
asialiveaction/asialiveaction.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"sourceName": "AsiaLiveAction",
|
||||
"iconUrl": "https://asialiveaction.com/wp-content/uploads/cropped-favicon-200x200.png",
|
||||
"author": {
|
||||
"name": "50/50",
|
||||
"icon": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ3122kQwublLkZ6rf1fEpUP79BxZOFmH9BSA&s"
|
||||
},
|
||||
"version": "1.0.0",
|
||||
"language": "Spanish",
|
||||
"streamType": "HLS",
|
||||
"quality": "1080p",
|
||||
"baseUrl": "https://asialiveaction.com/",
|
||||
"searchBaseUrl": "https://asialiveaction.com/",
|
||||
"scriptUrl": "https://gitlab.com/50n50/sources/-/raw/main/asialiveaction/asialiveaction.js",
|
||||
"type": "shows/movies",
|
||||
"asyncJS": true,
|
||||
"softsub": false,
|
||||
"downloadSupport": false
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue