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
125
luciferdonghua/luciferdonghua.js
Normal file
125
luciferdonghua/luciferdonghua.js
Normal file
|
|
@ -0,0 +1,125 @@
|
|||
function cleanTitle(title) {
|
||||
return title
|
||||
.replace(/’/g, "'")
|
||||
.replace(/–/g, "-")
|
||||
.replace(/&#[0-9]+;/g, "");
|
||||
}
|
||||
|
||||
async function searchResults(keyword) {
|
||||
const results = [];
|
||||
const response = await fetchv2(`https://luciferdonghua.in/?s=${keyword}`);
|
||||
const html = await response.text();
|
||||
|
||||
const regex = /<article class="bs"[^>]*>.*?<a href="([^"]+)"[^>]*>.*?<img src="([^"]+)"[^>]*>.*?<h2[^>]*>(.*?)<\/h2>/gs;
|
||||
|
||||
let match;
|
||||
while ((match = regex.exec(html)) !== null) {
|
||||
results.push({
|
||||
title: cleanTitle(match[3].trim()),
|
||||
image: match[2].trim(),
|
||||
href: match[1].trim()
|
||||
});
|
||||
}
|
||||
|
||||
return JSON.stringify(results);
|
||||
}
|
||||
|
||||
async function extractDetails(url) {
|
||||
const results = [];
|
||||
const response = await fetchv2(url);
|
||||
const html = await response.text();
|
||||
|
||||
const match = html.match(/<div class="entry-content"[^>]*>([\s\S]*?)<\/div>/);
|
||||
|
||||
let description = "N/A";
|
||||
if (match) {
|
||||
description = match[1]
|
||||
.replace(/<[^>]+>/g, '')
|
||||
.replace(/&#(\d+);/g, (_, code) => String.fromCharCode(code))
|
||||
.replace(/"/g, '"')
|
||||
.replace(/'/g, "'")
|
||||
.replace(/&/g, "&")
|
||||
.trim();
|
||||
}
|
||||
|
||||
results.push({
|
||||
description: description,
|
||||
aliases: 'N/A',
|
||||
airdate: 'N/A'
|
||||
});
|
||||
|
||||
return JSON.stringify(results);
|
||||
}
|
||||
|
||||
async function extractEpisodes(url) {
|
||||
const results = [];
|
||||
const response = await fetchv2(url);
|
||||
const html = await response.text();
|
||||
|
||||
const regex = /<li data-index="\d+">[\s\S]*?<a href="([^"]+)">/g;
|
||||
|
||||
let match;
|
||||
let count = 1;
|
||||
while ((match = regex.exec(html)) !== null) {
|
||||
results.push({
|
||||
href: match[1].trim(),
|
||||
number: count
|
||||
});
|
||||
count++;
|
||||
}
|
||||
|
||||
results.reverse();
|
||||
return JSON.stringify(results.reverse());
|
||||
}
|
||||
|
||||
|
||||
async function extractStreamUrl(url) {
|
||||
try {
|
||||
const response = await fetchv2(url);
|
||||
const html = await response.text();
|
||||
|
||||
const iframeMatch = html.match(/<meta itemprop="embedUrl" content="https?:\/\/geo\.dailymotion\.com\/player\/[^?]+\.html\?video=([a-zA-Z0-9]+)"/);
|
||||
if (!iframeMatch) return JSON.stringify({ streams: [], subtitles: "" });
|
||||
|
||||
const videoId = iframeMatch[1];
|
||||
|
||||
const metaRes = await fetchv2(`https://www.dailymotion.com/player/metadata/video/${videoId}`);
|
||||
const metaJson = await metaRes.json();
|
||||
const hlsLink = metaJson.qualities?.auto?.[0]?.url;
|
||||
if (!hlsLink) return JSON.stringify({ streams: [], subtitles: "" });
|
||||
|
||||
async function getBestHls(hlsUrl) {
|
||||
try {
|
||||
const res = await fetchv2(hlsUrl);
|
||||
const text = await res.text();
|
||||
const regex = /#EXT-X-STREAM-INF:.*RESOLUTION=(\d+)x(\d+).*?\n(https?:\/\/[^\n]+)/g;
|
||||
const streams = [];
|
||||
let match;
|
||||
while ((match = regex.exec(text)) !== null) {
|
||||
streams.push({ width: parseInt(match[1]), height: parseInt(match[2]), url: match[3] });
|
||||
}
|
||||
if (streams.length === 0) return hlsUrl;
|
||||
streams.sort((a, b) => b.height - a.height);
|
||||
return streams[0].url;
|
||||
} catch {
|
||||
return hlsUrl;
|
||||
}
|
||||
}
|
||||
|
||||
const bestHls = await getBestHls(hlsLink);
|
||||
|
||||
const subtitles = metaJson.subtitles?.data?.['en-auto']?.urls?.[0] || "";
|
||||
|
||||
const result = {
|
||||
streams: ["english", bestHls],
|
||||
subtitles: subtitles
|
||||
};
|
||||
|
||||
console.log("Extracted stream result:" + JSON.stringify(result));
|
||||
|
||||
return bestHls;
|
||||
} catch {
|
||||
console.log("Extracted stream result:" + JSON.stringify(empty));
|
||||
return JSON.stringify("empty");
|
||||
}
|
||||
}
|
||||
19
luciferdonghua/luciferdonghua.json
Normal file
19
luciferdonghua/luciferdonghua.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"sourceName": "LuciferDonghua",
|
||||
"iconUrl": "https://i.ibb.co/MwKW01H/cropped-lucifer-donghua-DP-192x192-webp.png",
|
||||
"author": {
|
||||
"name": "50/50",
|
||||
"icon": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ3122kQwublLkZ6rf1fEpUP79BxZOFmH9BSA&s"
|
||||
},
|
||||
"version": "1.0.0",
|
||||
"language": "English",
|
||||
"streamType": "HLS",
|
||||
"quality": "4K",
|
||||
"baseUrl": "https://luciferdonghua.in/",
|
||||
"searchBaseUrl": "https://luciferdonghua.in/",
|
||||
"scriptUrl": "https://gitlab.com/50n50/sources/-/raw/main/luciferdonghua/luciferdonghua.js",
|
||||
"type": "anime",
|
||||
"asyncJS": true,
|
||||
"softsub": false,
|
||||
"downloadSupport": false
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue