This commit is contained in:
50/50 2025-10-11 17:18:45 +02:00
commit 09c423e95a
276 changed files with 54396 additions and 0 deletions

108
anitube/anitube.js Normal file
View file

@ -0,0 +1,108 @@
async function searchResults(keyword) {
const results = [];
try {
const response = await fetchv2("https://www.anitube.news/?s=" + keyword);
const html = await response.text();
const regex = /<div class="aniItem">\s*<a href="([^"]+)"[^>]*>[\s\S]*?<img src="([^"]+)"[^>]*>[\s\S]*?<div class="aniItemNome">\s*([^<]+)\s*<\/div>/g;
let match;
while ((match = regex.exec(html)) !== null) {
results.push({
href: match[1].trim(),
image: match[2].trim(),
title: match[3].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 regex = /<div id="sinopse2">(.*?)<\/div>/s;
const match = regex.exec(html);
const description = match ? match[1].trim() : "N/A";
return JSON.stringify([{
description: description,
aliases: "N/A",
airdate: "N/A"
}]);
} catch (err) {
return JSON.stringify([{
description: "Error",
aliases: "Error",
airdate: "Error"
}]);
}
}
async function extractEpisodes(url) {
try {
const response = await fetchv2(url);
const html = await response.text();
const episodes = [];
const epRegex = /<a href="([^"]+)" title="([^"]+)">/g;
let match;
let counter = 1;
while ((match = epRegex.exec(html)) !== null) {
const href = match[1].trim();
if (href === "https://www.anitube.news") continue;
const title = match[2];
const numMatch = /Episódio\s+(\d+)/.exec(title);
const number = numMatch ? parseInt(numMatch[1], 10) : counter++;
episodes.push({
number: number,
href: href
});
}
if (episodes.length > 1 && episodes[0].number > episodes[1].number) {
episodes.reverse();
}
return JSON.stringify(episodes);
} catch (err) {
return JSON.stringify([{
number: -1,
href: "Error"
}]);
}
}
async function extractStreamUrl(url) {
try {
const response = await fetchv2(url);
const html = await response.text();
const regex = /src="https:\/\/api\.anivideo\.net\/videohls\.php\?d=([^"&]+\.m3u8)[^"]*"/;
const match = regex.exec(html);
if (!match) {
return "Error: stream not found";
}
const hlsUrl = decodeURIComponent(match[1]);
return hlsUrl;
} catch (err) {
return "Error: " + err.message;
}
}

19
anitube/anitube.json Normal file
View file

@ -0,0 +1,19 @@
{
"sourceName": "AniTube",
"iconUrl": "https://www.anitube.news/wp-content/uploads/cropped-Favicon6-192x192.png",
"author": {
"name": "50/50",
"icon": "https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcQ3122kQwublLkZ6rf1fEpUP79BxZOFmH9BSA&s"
},
"version": "1.0.0",
"language": "Portuguese",
"streamType": "HLS",
"quality": "1080p",
"baseUrl": "https://www.anitube.news/",
"searchBaseUrl": "https://www.anitube.news/",
"scriptUrl": "https://gitlab.com/50n50/sources/-/raw/main/anitube/anitube.js",
"type": "anime",
"asyncJS": true,
"softsub": false,
"downloadSupport": false
}