update mangas
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
async function searchContent(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));
|
||||
@@ -21,7 +21,7 @@ async function searchContent(keyword, page=0) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getContentData(url) {
|
||||
async function extractDetails(url) {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const html = await response.text();
|
||||
@@ -41,7 +41,7 @@ async function getContentData(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapters(url) {
|
||||
async function extractChapters(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
@@ -80,7 +80,7 @@ async function getChapters(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapterImages(url) {
|
||||
async function extractImages(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
async function searchContent(keyword,page=0){
|
||||
async function searchResults(keyword,page=0){
|
||||
const results = [];
|
||||
try {
|
||||
const headers = {
|
||||
@@ -31,7 +31,7 @@ async function searchContent(keyword,page=0){
|
||||
}
|
||||
}
|
||||
|
||||
async function getContentData(ID) {
|
||||
async function extractDetails(ID) {
|
||||
try {
|
||||
const response = await fetch(`https://api.mangacloud.org/comic/${ID}`);
|
||||
const data = await response.json();
|
||||
@@ -48,7 +48,7 @@ async function getContentData(ID) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapters(ID) {
|
||||
async function extractChapters(ID) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(`https://api.mangacloud.org/comic/${ID}`);
|
||||
@@ -73,7 +73,7 @@ async function getChapters(ID) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapterImages(url) {
|
||||
async function extractImages(url) {
|
||||
const chapterID = url.split("/").pop();
|
||||
const ID = url.split("/").slice(-2, -1)[0];
|
||||
const results = [];
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
async function searchContent(keyword, page=0) {
|
||||
async function searchResults(keyword, page=0) {
|
||||
const results = [];
|
||||
try {
|
||||
const offset = page * 100;
|
||||
@@ -46,7 +46,7 @@ async function searchContent(keyword, page=0) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getContentData(ID) {
|
||||
async function extractDetails(ID) {
|
||||
try {
|
||||
const response = await fetch(`https://api.mangadex.org/manga/${ID}?includes[]=artist&includes[]=author&includes[]=cover_art`);
|
||||
const data = await response.json();
|
||||
@@ -77,7 +77,7 @@ async function getContentData(ID) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapters(url) {
|
||||
async function extractChapters(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const limit = 100;
|
||||
@@ -147,7 +147,7 @@ async function getChapters(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapterImages(chapterId) {
|
||||
async function extractImages(chapterId) {
|
||||
try {
|
||||
const apiEndpoint = `https://api.mangadex.org/at-home/server/${chapterId}`;
|
||||
const apiResponse = await fetch(apiEndpoint);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
async function searchContent(input,page=0){
|
||||
async function searchResults(input,page=0){
|
||||
function parseSearchResults(html) {
|
||||
const results = [];
|
||||
const regex = /<div class="unit item-\d+">[\s\S]*?<a href="\/manga\/([\w\-\.]+)"[^>]*class="poster"[\s\S]*?<img src="([^"]*)"[^>]*alt="([^"]*)"/g;
|
||||
@@ -20,7 +20,7 @@ async function searchContent(input,page=0){
|
||||
return parseSearchResults(data);
|
||||
}
|
||||
|
||||
async function getContentData(url) {
|
||||
async function extractDetails(url) {
|
||||
function parseHtmlData(htmlContent) {
|
||||
const genreRegex = /<a href="\/genre\/[^"]*">([^<]+)<\/a>/g;
|
||||
const tags = [];
|
||||
@@ -69,7 +69,7 @@ async function getContentData(url) {
|
||||
return parseHtmlData(data);
|
||||
}
|
||||
|
||||
async function getChapters(url) {
|
||||
async function extractChapters(url) {
|
||||
const mangaIdMatch = url.match(/\.([a-z0-9]+)$/);
|
||||
const mangaId = mangaIdMatch ? mangaIdMatch[1] : null;
|
||||
|
||||
@@ -130,7 +130,7 @@ async function getChapters(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapterImages(ID) {
|
||||
async function extractImages(ID) {
|
||||
vrf = generate_vrf(`chapter@${ID}`);
|
||||
|
||||
try {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
async function searchContent(keyword, page=0) {
|
||||
async function searchResults(keyword, page=0) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch("https://ww2.mangafreak.me/Find/" + encodeURIComponent(keyword));
|
||||
@@ -20,7 +20,7 @@ async function searchContent(keyword, page=0) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getContentData(url) {
|
||||
async function extractDetails(url) {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const html = await response.text();
|
||||
@@ -40,7 +40,7 @@ async function getContentData(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapters(url) {
|
||||
async function extractChapters(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
@@ -67,7 +67,7 @@ async function getChapters(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapterImages(url) {
|
||||
async function extractImages(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
async function searchContent(keyword, page = 0) {
|
||||
async function searchResults(keyword, page = 0) {
|
||||
let results = [];
|
||||
try {
|
||||
const headers = {
|
||||
@@ -34,7 +34,7 @@ async function searchContent(keyword, page = 0) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getContentData(url) {
|
||||
async function extractDetails(url) {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const html = await response.text();
|
||||
@@ -74,7 +74,7 @@ async function getContentData(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapters(url) {
|
||||
async function extractChapters(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
@@ -110,7 +110,7 @@ async function getChapters(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapterImages(url) {
|
||||
async function extractImages(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
|
||||
@@ -13,7 +13,7 @@ function decodeHtmlEntities(text) {
|
||||
return text.replace(/&#?\w+;/g, (entity) => map[entity] || entity);
|
||||
}
|
||||
|
||||
async function searchContent(keyword) {
|
||||
async function searchResults(keyword) {
|
||||
const results = [];
|
||||
|
||||
const pages = [0, 2, 3, 4, 5];
|
||||
@@ -53,7 +53,7 @@ async function searchContent(keyword) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getContentData(url) {
|
||||
async function extractDetails(url) {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const html = await response.text();
|
||||
@@ -82,7 +82,7 @@ async function getContentData(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapters(url) {
|
||||
async function extractChapters(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
@@ -129,7 +129,7 @@ async function getChapters(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapterImages(url) {
|
||||
async function extractImages(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
async function searchContent(keyword, page=0) {
|
||||
async function searchResults(keyword, page=0) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch("https://mangapub.com/api/book/search?q=" + encodeURIComponent(keyword));
|
||||
@@ -21,7 +21,7 @@ async function searchContent(keyword, page=0) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getContentData(url) {
|
||||
async function extractDetails(url) {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const html = await response.text();
|
||||
@@ -41,7 +41,7 @@ async function getContentData(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapters(url) {
|
||||
async function extractChapters(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
@@ -80,7 +80,7 @@ async function getChapters(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapterImages(url) {
|
||||
async function extractImages(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
async function searchContent(keyword, page = 0) {
|
||||
async function searchResults(keyword, page = 0) {
|
||||
let results = [];
|
||||
try {
|
||||
const headers = {
|
||||
@@ -28,7 +28,7 @@ async function searchContent(keyword, page = 0) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getContentData(urlID) {
|
||||
async function extractDetails(urlID) {
|
||||
try {
|
||||
const url = urlID.split(".").slice(0, -1).join(".");
|
||||
const response = await fetch(url);
|
||||
@@ -49,7 +49,7 @@ async function getContentData(urlID) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapters(urlID) {
|
||||
async function extractChapters(urlID) {
|
||||
const results = [];
|
||||
try {
|
||||
function md5(string) {
|
||||
@@ -272,7 +272,7 @@ async function getChapters(urlID) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapterImages(url) {
|
||||
async function extractImages(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
async function searchContent(keyword,page=0){
|
||||
async function searchResults(keyword,page=0){
|
||||
const headers = {
|
||||
"Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
|
||||
"X-Requested-With": "XMLHttpRequest",
|
||||
@@ -25,7 +25,7 @@ async function searchContent(keyword,page=0){
|
||||
return results;
|
||||
}
|
||||
|
||||
async function getContentData(url) {
|
||||
async function extractDetails(url) {
|
||||
function parseHtmlData(htmlContent) {
|
||||
const tagsRegex = /<span>标\s+签:\s*<\/span>\s*([\s\S]*?)<span>状/;
|
||||
const descRegex = /<p class="content">([\s\S]+?)<\/p>/;
|
||||
@@ -53,7 +53,7 @@ async function getContentData(url) {
|
||||
return parseHtmlData(data);
|
||||
}
|
||||
|
||||
async function getChapters(url) {
|
||||
async function extractChapters(url) {
|
||||
function parseHtmlData(htmlContent) {
|
||||
const chapterRegex = /<a href="([^"]+)"><li>([^<]+)<\/li><\/a>/g;
|
||||
const chapters = [];
|
||||
@@ -86,7 +86,7 @@ async function getChapters(url) {
|
||||
return parseHtmlData(data);
|
||||
}
|
||||
|
||||
async function getChapterImages(url) {
|
||||
async function extractImages(url) {
|
||||
function parseHtmlData(htmlContent) {
|
||||
const scriptRegex = /<script[^>]*type=['"]text\/javascript['"][^>]*>([\s\S]*?)<\/script>/g;
|
||||
let obfuscatedScript = null;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
async function searchContent(keyword, page=0) {
|
||||
async function searchResults(keyword, page=0) {
|
||||
const results = [];
|
||||
try {
|
||||
const headers = {
|
||||
@@ -30,7 +30,7 @@ async function searchContent(keyword, page=0) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getContentData(url) {
|
||||
async function extractDetails(url) {
|
||||
try {
|
||||
const response = await fetch(url);
|
||||
const html = await response.text();
|
||||
@@ -61,7 +61,7 @@ async function getContentData(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapters(url) {
|
||||
async function extractChapters(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const fullUrl = url.replace(/\/[^/]+$/, "/full-chapter-list");
|
||||
@@ -93,7 +93,7 @@ async function getChapters(url) {
|
||||
}
|
||||
}
|
||||
|
||||
async function getChapterImages(url) {
|
||||
async function extractImages(url) {
|
||||
const results = [];
|
||||
try {
|
||||
const fullUrl = url + "/images?is_prev=False¤t_page=1&reading_style=long_strip";
|
||||
|
||||
Reference in New Issue
Block a user