fix and push
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
{
|
||||
"sourceName": "AnimeVerse",
|
||||
"iconUrl": "https://animeverse.to/apple-touch-icon.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": "1080p",
|
||||
"baseUrl": "https://animeverse.to/",
|
||||
"searchBaseUrl": "https://animeverse.to/",
|
||||
"scriptUrl": "https://git.luna-app.eu/50n50/sources/raw/branch/main/animeverse/animeverse.js",
|
||||
"type": "anime",
|
||||
"asyncJS": true,
|
||||
"softsub": true,
|
||||
"downloadSupport": true,
|
||||
"supportsSora": true,
|
||||
"supportsLuna": true,
|
||||
"supportsMojuru": true,
|
||||
"supportsDartotsu": true,
|
||||
"supportsAnymex": true,
|
||||
"supportsTsumi": true,
|
||||
"supportsHiyoku": true,
|
||||
"supportsShirox": true
|
||||
}
|
||||
+47
-33
@@ -1,18 +1,23 @@
|
||||
async function searchResults(keyword, page=0) {
|
||||
async function searchResults(keyword, page = 0) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch("https://mangabuddy.com/api/manga/search?q=" + encodeURIComponent(keyword));
|
||||
const response = await fetch("https://mangak.io/search?q=" + encodeURIComponent(keyword));
|
||||
const html = await response.text();
|
||||
|
||||
const regex = /href="([^"]*)"[^>]*>[\s\S]*?<img src="([^"]*)"[\s\S]*?<h3><a[^>]*>([\s\S]*?)<\/a><\/h3>/g;
|
||||
|
||||
let match;
|
||||
while ((match = regex.exec(html)) !== null) {
|
||||
results.push({
|
||||
id: "https://mangabuddy.com" + match[1].trim(),
|
||||
imageURL: "https://passthrough-worker.simplepostrequest.workers.dev/?simple=" + match[2].trim() + "&referer=https://mangabuddy.com",
|
||||
title: match[3].replace(/<[^>]+>/g, '').trim()
|
||||
});
|
||||
const jsonRegex = /<script id="__NEXT_DATA__" type="application\/json">([\s\S]*?)<\/script>/;
|
||||
const match = jsonRegex.exec(html);
|
||||
if (match) {
|
||||
const data = JSON.parse(match[1]);
|
||||
const items = data.props?.pageProps?.ssrItems || [];
|
||||
for (const item of items) {
|
||||
if (item.url && item.name && item.id) {
|
||||
results.push({
|
||||
id: "https://mangak.io" + item.url.trim() + " | " + item.id.trim(),
|
||||
imageURL: "https://passthrough-worker.simplepostrequest.workers.dev/?simple=" + (item.cover || "").trim() + "&referer=https://mangabuddy.com",
|
||||
title: item.name.trim()
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
@@ -23,7 +28,8 @@ async function searchResults(keyword, page=0) {
|
||||
|
||||
async function extractDetails(url) {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const [urlPart] = url.split(" | ");
|
||||
const response = await fetch(urlPart);
|
||||
const html = await response.text();
|
||||
|
||||
const descRegex = /<meta name="description" content="([^"]+)"/i;
|
||||
@@ -44,30 +50,28 @@ async function extractDetails(url) {
|
||||
async function extractChapters(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const html = await response.text();
|
||||
const idRegex = /var bookId = (\d+);/;
|
||||
const idMatch = idRegex.exec(html);
|
||||
if (!idMatch) return { en: [] };
|
||||
const manga_id = idMatch[1];
|
||||
const [, titleId] = url.split(" | ");
|
||||
if (!titleId) return { en: [] };
|
||||
|
||||
const chapUrl = `https://mangabuddy.com/api/manga/${manga_id}/chapters?source=detail`;
|
||||
const chapUrl = `https://api.mangak.io/titles/${titleId.trim()}/chapters`;
|
||||
const chapResponse = await fetch(chapUrl);
|
||||
const chapHtml = await chapResponse.text();
|
||||
const chapJson = await chapResponse.json();
|
||||
|
||||
if (!chapJson.success || !chapJson.data || !chapJson.data.chapters) {
|
||||
return { en: [] };
|
||||
}
|
||||
|
||||
const chapters = chapJson.data.chapters;
|
||||
for (const chapter of chapters) {
|
||||
const match = /(\d+(?:\.\d+)?)/.exec(chapter.name);
|
||||
const chapterNum = match ? match[1] : String(chapter.chapter_number || 0);
|
||||
|
||||
const regex = /<li id="c-\d+">\s*<a href="([^"]*)"[^>]*>\s*<div>\s*<strong class="chapter-title">Chapter (\d+)<\/strong>/g;
|
||||
|
||||
let match;
|
||||
|
||||
while ((match = regex.exec(chapHtml)) !== null) {
|
||||
const chapterUrl = "https://mangabuddy.com" + match[1];
|
||||
const chapterNum = match[2];
|
||||
results.push([
|
||||
String(chapterNum),
|
||||
[{
|
||||
id: chapterUrl,
|
||||
chapter: parseInt(chapterNum),
|
||||
scanlation_group: `Chapter ${chapterNum}`
|
||||
id: "https://mangak.io" + chapter.url,
|
||||
chapter: parseFloat(chapterNum) || 0,
|
||||
scanlation_group: chapter.name || `Chapter ${chapterNum}`
|
||||
}]
|
||||
]);
|
||||
}
|
||||
@@ -85,12 +89,22 @@ async function extractImages(url) {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const html = await response.text();
|
||||
const regex = /var chapImages = '([^']*)'/;
|
||||
const match = regex.exec(html);
|
||||
|
||||
const jsonRegex = /<script id="__NEXT_DATA__" type="application\/json">([\s\S]*?)<\/script>/;
|
||||
const match = jsonRegex.exec(html);
|
||||
if (match) {
|
||||
const images = match[1].split(',');
|
||||
const data = JSON.parse(match[1]);
|
||||
const images = data.props?.pageProps?.initialChapter?.images || [];
|
||||
const processedImages = images.map(img => "https://passthrough-worker.simplepostrequest.workers.dev/?simple=" + img.trim() + "&referer=https://mangabuddy.com");
|
||||
results.push(...processedImages);
|
||||
} else {
|
||||
const regex = /var chapImages = '([^']*)'/;
|
||||
const legacyMatch = regex.exec(html);
|
||||
if (legacyMatch) {
|
||||
const images = legacyMatch[1].split(',');
|
||||
const processedImages = images.map(img => "https://passthrough-worker.simplepostrequest.workers.dev/?simple=" + img.trim() + "&referer=https://mangabuddy.com");
|
||||
results.push(...processedImages);
|
||||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"sourceName": "MangaBuddy",
|
||||
"iconURL": "https://mangabuddy.com/static/sites/mangabuddy/icons/apple-touch-icon.png",
|
||||
"version": "1.0",
|
||||
"version": "2.0",
|
||||
"language": "English",
|
||||
"scriptURL": "https://git.luna-app.eu/50n50/sources/raw/branch/main/mangabuddy/mangabuddy.js",
|
||||
"author": {
|
||||
|
||||
Reference in New Issue
Block a user