mirror of
https://github.com/venera-app/venera-configs.git
synced 2025-09-27 16:37:23 +00:00
Compare commits
11 Commits
8a26cff469
...
main
Author | SHA1 | Date | |
---|---|---|---|
![]() |
603fefe9be | ||
![]() |
cd941b92ef | ||
62fbe9294b | |||
91823846a0 | |||
ef87d90e89 | |||
![]() |
a991dac6d6 | ||
![]() |
c9fdc8367a | ||
![]() |
aafc7078ba | ||
![]() |
edebc0c430 | ||
![]() |
b6448c2055 | ||
![]() |
ca2f626483 |
@@ -1,4 +1,19 @@
|
||||
/** @type {import('./_venera_.js')} */
|
||||
|
||||
/**
|
||||
* @typedef {Object} PageJumpTarget
|
||||
* @Property {string} page - The page name (search, category)
|
||||
* @Property {Object} attributes - The attributes of the page
|
||||
*
|
||||
* @example
|
||||
* {
|
||||
* page: "search",
|
||||
* attributes: {
|
||||
* keyword: "example",
|
||||
* },
|
||||
* }
|
||||
*/
|
||||
|
||||
class NewComicSource extends ComicSource {
|
||||
// Note: The fields which are marked as [Optional] should be removed if not used
|
||||
|
||||
@@ -256,20 +271,42 @@ class NewComicSource extends ComicSource {
|
||||
```
|
||||
*/
|
||||
},
|
||||
// provide options for category comic loading
|
||||
// [Optional] provide options for category comic loading
|
||||
optionList: [
|
||||
{
|
||||
// [Optional] The label will not be displayed if it is empty.
|
||||
label: "",
|
||||
// For a single option, use `-` to separate the value and text, left for value, right for text
|
||||
options: [
|
||||
"newToOld-New to Old",
|
||||
"oldToNew-Old to New"
|
||||
],
|
||||
// [Optional] {string[]} - show this option only when the value not in the list
|
||||
// [Optional] {string[]} - show this option only when the category not in the list
|
||||
notShowWhen: null,
|
||||
// [Optional] {string[]} - show this option only when the value in the list
|
||||
// [Optional] {string[]} - show this option only when the category in the list
|
||||
showWhen: null
|
||||
}
|
||||
],
|
||||
/**
|
||||
* [Optional] load options dynamically. If `optionList` is provided, this will be ignored.
|
||||
* @since 1.5.0
|
||||
* @param category {string}
|
||||
* @param param {string?}
|
||||
* @return {Promise<{options: string[], label?: string}[]>} - return a list of option group, each group contains a list of options
|
||||
*/
|
||||
optionLoader: async (category, param) => {
|
||||
return [
|
||||
{
|
||||
// [Optional] The label will not be displayed if it is empty.
|
||||
label: "",
|
||||
// For a single option, use `-` to separate the value and text, left for value, right for text
|
||||
options: [
|
||||
"newToOld-New to Old",
|
||||
"oldToNew-Old to New"
|
||||
],
|
||||
}
|
||||
]
|
||||
},
|
||||
ranking: {
|
||||
// For a single option, use `-` to separate the value and text, left for value, right for text
|
||||
options: [
|
||||
|
71
_venera_.js
71
_venera_.js
@@ -4,6 +4,18 @@ Venera JavaScript Library
|
||||
This library provides a set of APIs for interacting with the Venera app.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @function sendMessage
|
||||
* @global
|
||||
* @param {Object} message
|
||||
* @returns {any}
|
||||
*/
|
||||
|
||||
/**
|
||||
* Set a timeout to execute a callback function after a specified delay.
|
||||
* @param callback {Function}
|
||||
* @param delay {number} - delay in milliseconds
|
||||
*/
|
||||
function setTimeout(callback, delay) {
|
||||
sendMessage({
|
||||
method: 'delay',
|
||||
@@ -42,8 +54,6 @@ let Convert = {
|
||||
/**
|
||||
* @param str {string}
|
||||
* @returns {ArrayBuffer}
|
||||
*
|
||||
* @since 1.4.3
|
||||
*/
|
||||
encodeGbk: (str) => {
|
||||
return sendMessage({
|
||||
@@ -57,8 +67,6 @@ let Convert = {
|
||||
/**
|
||||
* @param value {ArrayBuffer}
|
||||
* @returns {string}
|
||||
*
|
||||
* @since 1.4.3
|
||||
*/
|
||||
decodeGbk: (value) => {
|
||||
return sendMessage({
|
||||
@@ -1042,20 +1050,6 @@ function ImageLoadingConfig({url, method, data, headers, onResponse, modifyImage
|
||||
this.onLoadFailed = onLoadFailed;
|
||||
}
|
||||
|
||||
/**
|
||||
* @typedef {Object} PageJumpTarget
|
||||
* @Property {string} page - The page name (search, category)
|
||||
* @Property {Object} attributes - The attributes of the page
|
||||
*
|
||||
* @example
|
||||
* {
|
||||
* page: "search",
|
||||
* attributes: {
|
||||
* keyword: "example",
|
||||
* },
|
||||
* }
|
||||
*/
|
||||
|
||||
class ComicSource {
|
||||
name = ""
|
||||
|
||||
@@ -1404,3 +1398,44 @@ let APP = {
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set clipboard text
|
||||
* @param text {string}
|
||||
* @returns {Promise<void>}
|
||||
*
|
||||
* @since 1.3.4
|
||||
*/
|
||||
function setClipboard(text) {
|
||||
return sendMessage({
|
||||
method: 'setClipboard',
|
||||
text: text
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Get clipboard text
|
||||
* @returns {Promise<string>}
|
||||
*
|
||||
* @since 1.3.4
|
||||
*/
|
||||
function getClipboard() {
|
||||
return sendMessage({
|
||||
method: 'getClipboard'
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* Compute a function with arguments. The function will be executed in the engine pool which is not in the main thread.
|
||||
* @param func {string} - A js code string which can be evaluated to a function. The function will receive the args as its only argument.
|
||||
* @param args {any[]} - The arguments to pass to the function.
|
||||
* @returns {Promise<any>} - The result of the function.
|
||||
* @since 1.5.0
|
||||
*/
|
||||
function compute(func, ...args) {
|
||||
return sendMessage({
|
||||
method: 'compute',
|
||||
function: func,
|
||||
args: args
|
||||
})
|
||||
}
|
||||
|
@@ -4,7 +4,7 @@ class CopyManga extends ComicSource {
|
||||
|
||||
key = "copy_manga"
|
||||
|
||||
version = "1.3.7"
|
||||
version = "1.3.8"
|
||||
|
||||
minAppVersion = "1.2.1"
|
||||
|
||||
@@ -14,13 +14,18 @@ class CopyManga extends ComicSource {
|
||||
let token = this.loadData("token");
|
||||
let secret = "M2FmMDg1OTAzMTEwMzJlZmUwNjYwNTUwYTA1NjNhNTM="
|
||||
|
||||
let now = new Date(Date.now());
|
||||
let year = now.getFullYear();
|
||||
let month = (now.getMonth() + 1).toString().padStart(2, '0');
|
||||
let day = now.getDate().toString().padStart(2, '0');
|
||||
let ts = Math.floor(now.getTime() / 1000).toString()
|
||||
|
||||
if (!token) {
|
||||
token = "";
|
||||
} else {
|
||||
token = " " + token;
|
||||
}
|
||||
|
||||
let ts = Math.floor(Date.now() / 1000).toString()
|
||||
let sig = Convert.hmacString(
|
||||
Convert.decodeBase64(secret),
|
||||
Convert.encodeUtf8(ts),
|
||||
@@ -31,6 +36,7 @@ class CopyManga extends ComicSource {
|
||||
"User-Agent": "COPY/3.0.0",
|
||||
"source": "copyApp",
|
||||
"deviceinfo": this.deviceinfo,
|
||||
"dt": `${year}.${month}.${day}`,
|
||||
"platform": "3",
|
||||
"referer": `com.copymanga.app-3.0.0`,
|
||||
"version": "3.0.0",
|
||||
@@ -602,7 +608,7 @@ class CopyManga extends ComicSource {
|
||||
let getChapters = async (id, groups) => {
|
||||
let fetchSingle = async (id, path) => {
|
||||
let res = await Network.get(
|
||||
`${this.apiUrl}/api/v3/comic/${id}/group/${path}/chapters?limit=500&offset=0&in_mainland=true&request_id=`,
|
||||
`${this.apiUrl}/api/v3/comic/${id}/group/${path}/chapters?limit=100&offset=0&in_mainland=true&request_id=`,
|
||||
this.headers
|
||||
);
|
||||
if (res.status !== 200) {
|
||||
@@ -616,11 +622,11 @@ class CopyManga extends ComicSource {
|
||||
eps.set(id, title);
|
||||
});
|
||||
let maxChapter = data.results.total;
|
||||
if (maxChapter > 500) {
|
||||
let offset = 500;
|
||||
if (maxChapter > 100) {
|
||||
let offset = 100;
|
||||
while (offset < maxChapter) {
|
||||
res = await Network.get(
|
||||
`${this.apiUrl}/api/v3/comic/${id}/group/${path}/chapters?limit=500&offset=${offset}`,
|
||||
`${this.apiUrl}/api/v3/comic/${id}/group/${path}/chapters?limit=100&offset=${offset}`,
|
||||
this.headers
|
||||
);
|
||||
if (res.status !== 200) {
|
||||
@@ -632,7 +638,7 @@ class CopyManga extends ComicSource {
|
||||
let id = e.uuid;
|
||||
eps.set(id, title)
|
||||
});
|
||||
offset += 500;
|
||||
offset += 100;
|
||||
}
|
||||
}
|
||||
return eps;
|
||||
|
@@ -7,7 +7,7 @@ class Ehentai extends ComicSource {
|
||||
// unique id of the source
|
||||
key = "ehentai"
|
||||
|
||||
version = "1.1.3"
|
||||
version = "1.1.4"
|
||||
|
||||
minAppVersion = "1.0.0"
|
||||
|
||||
@@ -1182,7 +1182,7 @@ class Ehentai extends ComicSource {
|
||||
if(url.includes('?')) {
|
||||
url = url.split('?')[0]
|
||||
}
|
||||
let reg = RegExp("https?://(e-|ex)hentai.org/g/(\\d+)/(\\w+)/")
|
||||
let reg = RegExp("https?://(e-|ex)hentai.org/g/(\\d+)/(\\w+)/?$")
|
||||
let match = reg.exec(url)
|
||||
if(match) {
|
||||
return `${this.baseUrl}/g/${match[2]}/${match[3]}/`
|
||||
|
128
hitomi.js
128
hitomi.js
@@ -995,7 +995,7 @@ class Hitomi extends ComicSource {
|
||||
// unique id of the source
|
||||
key = "hitomi";
|
||||
|
||||
version = "1.1.1";
|
||||
version = "1.1.2";
|
||||
|
||||
minAppVersion = "1.4.6";
|
||||
|
||||
@@ -1004,7 +1004,7 @@ class Hitomi extends ComicSource {
|
||||
|
||||
galleryCache = [];
|
||||
categoryResultCache = undefined;
|
||||
searchResultCache = undefined;
|
||||
searchResultCaches = new Map();
|
||||
|
||||
_mapGalleryBlockInfoToComic(n) {
|
||||
return new Comic({
|
||||
@@ -1088,95 +1088,24 @@ class Hitomi extends ComicSource {
|
||||
title: "hitomi.la",
|
||||
parts: [
|
||||
{
|
||||
name: "Language",
|
||||
name: "语言",
|
||||
type: "fixed",
|
||||
categories: [
|
||||
{
|
||||
label: "Chinese",
|
||||
target: {
|
||||
page: "category",
|
||||
attributes: {
|
||||
category: "language",
|
||||
param: "chinese",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "English",
|
||||
target: {
|
||||
page: "category",
|
||||
attributes: {
|
||||
category: "language",
|
||||
param: "english",
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
categories: ["汉语", "英语"],
|
||||
itemType: "category",
|
||||
categoryParams: ["language:chinese", "language:english"],
|
||||
},
|
||||
{
|
||||
name: "类别",
|
||||
type: "fixed",
|
||||
categories: [
|
||||
{
|
||||
label: "doujinshi",
|
||||
target: {
|
||||
page: "category",
|
||||
attributes: {
|
||||
category: "type",
|
||||
param: "doujinshi",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "manga",
|
||||
target: {
|
||||
page: "category",
|
||||
attributes: {
|
||||
category: "type",
|
||||
param: "manga",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "artistcg",
|
||||
target: {
|
||||
page: "category",
|
||||
attributes: {
|
||||
category: "type",
|
||||
param: "artistcg",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "gamecg",
|
||||
target: {
|
||||
page: "category",
|
||||
attributes: {
|
||||
category: "type",
|
||||
param: "gamecg",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "imageset",
|
||||
target: {
|
||||
page: "category",
|
||||
attributes: {
|
||||
category: "type",
|
||||
param: "imageset",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "anime",
|
||||
target: {
|
||||
page: "category",
|
||||
attributes: {
|
||||
category: "type",
|
||||
param: "anime",
|
||||
},
|
||||
},
|
||||
},
|
||||
categories: ["同人志", "漫画", "画师CG", "游戏CG", "图集", "动画"],
|
||||
itemType: "category",
|
||||
categoryParams: [
|
||||
"type:doujinshi",
|
||||
"type:manga",
|
||||
"type:artistcg",
|
||||
"type:gamecg",
|
||||
"type:imageset",
|
||||
"type:anime",
|
||||
],
|
||||
},
|
||||
],
|
||||
@@ -1195,9 +1124,11 @@ class Hitomi extends ComicSource {
|
||||
* @returns {Promise<{comics: Comic[], maxPage: number}>}
|
||||
*/
|
||||
load: async (category, param, options, page) => {
|
||||
const term = param;
|
||||
if (!term.includes(":"))
|
||||
throw new Error("不合法的标签,请使用namespace:tag的格式");
|
||||
if (page === 1) {
|
||||
const option = parseInt(options[0]);
|
||||
const term = category + ":" + param;
|
||||
const searchOptions = {
|
||||
term,
|
||||
orderby: "date",
|
||||
@@ -1351,6 +1282,7 @@ class Hitomi extends ComicSource {
|
||||
* @returns {Promise<{comics: Comic[], maxPage: number}>}
|
||||
*/
|
||||
load: async (keyword, options, page) => {
|
||||
const cacheKey = (keyword || "") + "|" + options.join(",");
|
||||
if (page === 1) {
|
||||
const option = parseInt(options[0]);
|
||||
const term = keyword;
|
||||
@@ -1392,11 +1324,11 @@ class Hitomi extends ComicSource {
|
||||
const comics = (await get_galleryblocks(result.gids)).map((n) =>
|
||||
this._mapGalleryBlockInfoToComic(n)
|
||||
);
|
||||
this.searchResultCache = {
|
||||
this.searchResultCaches.set(cacheKey, {
|
||||
type: "single",
|
||||
state: result.state,
|
||||
count: result.count,
|
||||
};
|
||||
});
|
||||
return {
|
||||
comics,
|
||||
maxPage: Math.ceil(result.count / 25),
|
||||
@@ -1407,20 +1339,21 @@ class Hitomi extends ComicSource {
|
||||
result.gids.slice(25 * page - 25, 25 * page)
|
||||
)
|
||||
).map((n) => this._mapGalleryBlockInfoToComic(n));
|
||||
this.searchResultCache = {
|
||||
this.searchResultCaches.set(cacheKey, {
|
||||
type: "all",
|
||||
gids: result.gids,
|
||||
count: result.count,
|
||||
};
|
||||
});
|
||||
return {
|
||||
comics,
|
||||
maxPage: Math.ceil(result.count / 25),
|
||||
};
|
||||
}
|
||||
} else {
|
||||
if (this.searchResultCache.type === "single") {
|
||||
const searchResultCache = this.searchResultCaches.get(cacheKey);
|
||||
if (searchResultCache.type === "single") {
|
||||
const result = await getSingleTagSearchPage({
|
||||
state: this.searchResultCache.state,
|
||||
state: searchResultCache.state,
|
||||
page: page - 1,
|
||||
});
|
||||
const comics = (await get_galleryblocks(result.galleryids)).map((n) =>
|
||||
@@ -1428,17 +1361,17 @@ class Hitomi extends ComicSource {
|
||||
);
|
||||
return {
|
||||
comics,
|
||||
maxPage: Math.ceil(this.searchResultCache.count / 25),
|
||||
maxPage: Math.ceil(searchResultCache.count / 25),
|
||||
};
|
||||
} else {
|
||||
const comics = (
|
||||
await get_galleryblocks(
|
||||
this.searchResultCache.gids.slice(25 * page - 25, 25 * page)
|
||||
searchResultCache.gids.slice(25 * page - 25, 25 * page)
|
||||
)
|
||||
).map((n) => this._mapGalleryBlockInfoToComic(n));
|
||||
return {
|
||||
comics,
|
||||
maxPage: Math.ceil(this.searchResultCache.count / 25),
|
||||
maxPage: Math.ceil(searchResultCache.count / 25),
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -1526,7 +1459,8 @@ class Hitomi extends ComicSource {
|
||||
if ("type" in data && data.type) tags.set("type", [data.type]);
|
||||
if (data.groups.length) tags.set("groups", data.groups);
|
||||
if (data.artists.length) tags.set("artists", data.artists);
|
||||
if ("language" in data && data.language) tags.set("language", [data.language]);
|
||||
if ("language" in data && data.language)
|
||||
tags.set("language", [data.language]);
|
||||
if (data.series.length) tags.set("series", data.series);
|
||||
if (data.characters.length) tags.set("characters", data.characters);
|
||||
if (data.females.length) tags.set("females", data.females);
|
||||
|
128
ikmmh.js
128
ikmmh.js
@@ -1,13 +1,47 @@
|
||||
/** @type {import('./_venera_.js')} */
|
||||
|
||||
function getValidatorCookie(htmlString) {
|
||||
// 正则表达式匹配 document.cookie 设置语句
|
||||
const cookieRegex = /document\.cookie\s*=\s*"([^"]+)"/;
|
||||
const match = htmlString.match(cookieRegex);
|
||||
|
||||
if (!match) {
|
||||
return null; // 没有找到 cookie 设置语句
|
||||
}
|
||||
|
||||
const cookieSetting = match[1];
|
||||
const cookies = cookieSetting.split(';');
|
||||
if (cookies.length === 0) {
|
||||
return null
|
||||
}
|
||||
const nameValuePart = cookies[0].trim();
|
||||
const equalsIndex = nameValuePart.indexOf('=');
|
||||
|
||||
const name = nameValuePart.substring(0, equalsIndex);
|
||||
const value = nameValuePart.substring(equalsIndex + 1);
|
||||
|
||||
return new Cookie({ name, value, domain: "www.ikmmh.com" })
|
||||
}
|
||||
|
||||
function needPassValidator(htmlString) {
|
||||
var cookie = getValidatorCookie(htmlString)
|
||||
if (cookie != null) {
|
||||
Network.setCookies(Ikm.baseUrl, [cookie])
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
class Ikm extends ComicSource {
|
||||
// 基础配置
|
||||
name = "爱看漫";
|
||||
key = "ikmmh";
|
||||
version = "1.0.4";
|
||||
version = "1.0.5";
|
||||
minAppVersion = "1.0.0";
|
||||
url = "https://git.nyne.dev/nyne/venera-configs/raw/branch/main/ikmmh.js";
|
||||
// 常量定义
|
||||
static baseUrl = "https://ymcdnyfqdapp.ikmmh.com";
|
||||
static Mobile_UA = "Mozilla/5.0 (Linux; Android) Mobile";
|
||||
static baseUrl = "https://www.ikmmh.com";
|
||||
static Mobile_UA = "Mozilla/5.0 (iPhone; CPU iPhone OS 18_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/18.5 Mobile/15E148 Safari/604.1 Edg/140.0.0.0";
|
||||
static webHeaders = {
|
||||
"User-Agent": Ikm.Mobile_UA,
|
||||
"Accept":
|
||||
@@ -38,14 +72,26 @@ class Ikm extends ComicSource {
|
||||
);
|
||||
if (res.status !== 200)
|
||||
throw new Error(`登录失败,状态码:${res.status}`);
|
||||
|
||||
if (needPassValidator(res.body)) {
|
||||
// rePost
|
||||
res = await Network.post(
|
||||
`${Ikm.baseUrl}/api/user/userarr/login`,
|
||||
Ikm.jsonHead,
|
||||
`user=${account}&pass=${pwd}`
|
||||
);
|
||||
}
|
||||
|
||||
let data = JSON.parse(res.body);
|
||||
if (data.code !== 0) throw new Error(data.msg || "登录异常");
|
||||
if (data.code !== 0)
|
||||
throw new Error(data.msg || "登录异常");
|
||||
|
||||
return "ok";
|
||||
} catch (err) {
|
||||
throw new Error(`登录失败:${err.message}`);
|
||||
}
|
||||
},
|
||||
logout: () => Network.deleteCookies("ymcdnyfqdapp.ikmmh.com"),
|
||||
logout: () => Network.deleteCookies("www.ikmmh.com"),
|
||||
registerWebsite: `${Ikm.baseUrl}/user/register/`,
|
||||
};
|
||||
// 探索页面
|
||||
@@ -58,6 +104,12 @@ class Ikm extends ComicSource {
|
||||
let res = await Network.get(`${Ikm.baseUrl}/`, Ikm.webHeaders);
|
||||
if (res.status !== 200)
|
||||
throw new Error(`加载探索页面失败,状态码:${res.status}`);
|
||||
|
||||
if (needPassValidator(res.body)) {
|
||||
// rePost
|
||||
res = await Network.get(`${Ikm.baseUrl}/`, Ikm.webHeaders);
|
||||
}
|
||||
|
||||
let document = new HtmlDocument(res.body);
|
||||
let parseComic = (e) => {
|
||||
let title = e.querySelector("div.title").text.split("~")[0];
|
||||
@@ -176,6 +228,15 @@ class Ikm extends ComicSource {
|
||||
);
|
||||
if (res.status !== 200)
|
||||
throw new Error(`分类请求失败,状态码:${res.status}`);
|
||||
|
||||
if (needPassValidator(res.body)) {
|
||||
// rePost
|
||||
res = await Network.get(
|
||||
`${Ikm.baseUrl}/update/${param}.html`,
|
||||
Ikm.webHeaders
|
||||
);
|
||||
}
|
||||
|
||||
let document = new HtmlDocument(res.body);
|
||||
let comics = document.querySelectorAll("li.comic-item").map((e) => ({
|
||||
title: e.querySelector("p.title").text.split("~")[0],
|
||||
@@ -195,6 +256,17 @@ class Ikm extends ComicSource {
|
||||
options[0]
|
||||
}&page=${page}`
|
||||
);
|
||||
|
||||
if (needPassValidator(res.body)) {
|
||||
// rePost
|
||||
res = await Network.post(
|
||||
`${Ikm.baseUrl}/api/comic/index/lists`,
|
||||
Ikm.jsonHead,
|
||||
`area=${options[1]}&tags=${encodeURIComponent(category)}&full=${options[0]
|
||||
}&page=${page}`
|
||||
);
|
||||
}
|
||||
|
||||
let resData = JSON.parse(res.body);
|
||||
return {
|
||||
comics: resData.data.map((e) => ({
|
||||
@@ -260,6 +332,15 @@ class Ikm extends ComicSource {
|
||||
`${Ikm.baseUrl}/search?searchkey=${encodeURIComponent(keyword)}`,
|
||||
Ikm.webHeaders
|
||||
);
|
||||
|
||||
if (needPassValidator(res.body)) {
|
||||
// rePost
|
||||
res = await Network.get(
|
||||
`${Ikm.baseUrl}/search?searchkey=${encodeURIComponent(keyword)}`,
|
||||
Ikm.webHeaders
|
||||
);
|
||||
}
|
||||
|
||||
let document = new HtmlDocument(res.body);
|
||||
return {
|
||||
comics: document.querySelectorAll("li.comic-item").map((e) => ({
|
||||
@@ -286,6 +367,12 @@ class Ikm extends ComicSource {
|
||||
if (isAdding) {
|
||||
// 获取漫画信息
|
||||
let infoRes = await Network.get(comicId, Ikm.webHeaders);
|
||||
|
||||
if (needPassValidator(infoRes.body)) {
|
||||
// rePost
|
||||
infoRes = await Network.get(comicId, Ikm.webHeaders);
|
||||
}
|
||||
|
||||
let name = new HtmlDocument(infoRes.body).querySelector(
|
||||
"meta[property='og:title']"
|
||||
).attributes["content"];
|
||||
@@ -305,6 +392,16 @@ class Ikm extends ComicSource {
|
||||
Ikm.jsonHead,
|
||||
`articleid=${id}`
|
||||
);
|
||||
|
||||
if (needPassValidator(res.body)) {
|
||||
// rePost
|
||||
res = await Network.post(
|
||||
`${Ikm.baseUrl}/api/user/bookcase/del`,
|
||||
Ikm.jsonHead,
|
||||
`articleid=${id}`
|
||||
);
|
||||
}
|
||||
|
||||
let data = JSON.parse(res.body);
|
||||
if (data.code !== "0") throw new Error(data.msg || "取消收藏失败");
|
||||
return "ok";
|
||||
@@ -322,6 +419,15 @@ class Ikm extends ComicSource {
|
||||
if (res.status !== 200) {
|
||||
throw "加载收藏失败:" + res.status;
|
||||
}
|
||||
|
||||
if (needPassValidator(res.body)) {
|
||||
// rePost
|
||||
res = await Network.get(
|
||||
`${Ikm.baseUrl}/user/bookcase`,
|
||||
Ikm.webHeaders
|
||||
);
|
||||
}
|
||||
|
||||
let document = new HtmlDocument(res.body);
|
||||
return {
|
||||
comics: document.querySelectorAll("div.bookrack-item").map((e) => ({
|
||||
@@ -347,6 +453,12 @@ class Ikm extends ComicSource {
|
||||
console.error("加载收藏页失败:", error);
|
||||
}
|
||||
let res = await Network.get(id, Ikm.webHeaders);
|
||||
|
||||
if (needPassValidator(res.body)) {
|
||||
// rePost
|
||||
res = await Network.get(id, Ikm.webHeaders);
|
||||
}
|
||||
|
||||
let document = new HtmlDocument(res.body);
|
||||
let comicId = id.match(/\d+/)[0];
|
||||
// 获取章节数据
|
||||
@@ -417,6 +529,12 @@ class Ikm extends ComicSource {
|
||||
loadEp: async (comicId, epId) => {
|
||||
try {
|
||||
let res = await Network.get(epId, Ikm.webHeaders);
|
||||
|
||||
if (needPassValidator(res.body)) {
|
||||
// rePost
|
||||
res = await Network.get(epId, Ikm.webHeaders);
|
||||
}
|
||||
|
||||
let document = new HtmlDocument(res.body);
|
||||
return {
|
||||
images: document
|
||||
|
14
index.json
14
index.json
@@ -3,7 +3,7 @@
|
||||
"name": "拷贝漫画",
|
||||
"fileName": "copy_manga.js",
|
||||
"key": "copy_manga",
|
||||
"version": "1.3.7"
|
||||
"version": "1.3.8"
|
||||
},
|
||||
{
|
||||
"name": "Komiic",
|
||||
@@ -27,7 +27,7 @@
|
||||
"name": "nhentai",
|
||||
"fileName": "nhentai.js",
|
||||
"key": "nhentai",
|
||||
"version": "1.0.5"
|
||||
"version": "1.0.6"
|
||||
},
|
||||
{
|
||||
"name": "紳士漫畫",
|
||||
@@ -40,13 +40,13 @@
|
||||
"name": "ehentai",
|
||||
"fileName": "ehentai.js",
|
||||
"key": "ehentai",
|
||||
"version": "1.1.3"
|
||||
"version": "1.1.4"
|
||||
},
|
||||
{
|
||||
"name": "禁漫天堂",
|
||||
"fileName": "jm.js",
|
||||
"key": "jm",
|
||||
"version": "1.2.1",
|
||||
"version": "1.3.0",
|
||||
"description": "禁漫天堂漫畫源, 不能使用時請嘗試切換分流"
|
||||
},
|
||||
{
|
||||
@@ -60,7 +60,7 @@
|
||||
"name": "爱看漫",
|
||||
"fileName": "ikmmh.js",
|
||||
"key": "ikmmh",
|
||||
"version": "1.0.4"
|
||||
"version": "1.0.5"
|
||||
},
|
||||
{
|
||||
"name": "少年ジャンプ+",
|
||||
@@ -72,7 +72,7 @@
|
||||
"name": "hitomi.la",
|
||||
"fileName": "hitomi.js",
|
||||
"key": "hitomi",
|
||||
"version": "1.1.1"
|
||||
"version": "1.1.2"
|
||||
},
|
||||
{
|
||||
"name": "comick",
|
||||
@@ -114,6 +114,6 @@
|
||||
"name": "Lanraragi",
|
||||
"fileName": "lanraragi.js",
|
||||
"key": "lanraragi",
|
||||
"version": "1.0.0"
|
||||
"version": "1.1.0"
|
||||
}
|
||||
]
|
||||
|
87
jm.js
87
jm.js
@@ -7,22 +7,22 @@ class JM extends ComicSource {
|
||||
// unique id of the source
|
||||
key = "jm"
|
||||
|
||||
version = "1.2.1"
|
||||
version = "1.3.0"
|
||||
|
||||
minAppVersion = "1.2.5"
|
||||
minAppVersion = "1.5.0"
|
||||
|
||||
static jmVersion = "2.0.1"
|
||||
static jmVersion = "2.0.6"
|
||||
|
||||
static jmPkgName = "com.example.app"
|
||||
|
||||
// update url
|
||||
url = "https://git.nyne.dev/nyne/venera-configs/raw/branch/main/jm.js"
|
||||
|
||||
static apiDomains = [
|
||||
"www.cdnaspa.vip",
|
||||
"www.cdnaspa.club",
|
||||
"www.cdnplaystation6.vip",
|
||||
"www.cdnplaystation6.cc"
|
||||
static fallbackServers = [
|
||||
"www.cdntwice.org",
|
||||
"www.cdnsha.org",
|
||||
"www.cdnaspa.cc",
|
||||
"www.cdnntr.cc",
|
||||
];
|
||||
|
||||
static imageUrl = "https://cdn-msp.jmapinodeudzn.net"
|
||||
@@ -121,11 +121,11 @@ class JM extends ComicSource {
|
||||
* @param showConfirmDialog {boolean}
|
||||
*/
|
||||
async refreshApiDomains(showConfirmDialog) {
|
||||
let url = "https://jmapp03-1308024008.cos.ap-jakarta.myqcloud.com/server-2024.txt"
|
||||
let url = "https://rup4a04-c02.tos-cn-hongkong.bytepluses.com/newsvr-2025.txt"
|
||||
let domainSecret = "diosfjckwpqpdfjkvnqQjsik"
|
||||
let title = ""
|
||||
let message = ""
|
||||
let jm3_Server = []
|
||||
let servers = []
|
||||
let domains = []
|
||||
let res = await fetch(
|
||||
url,
|
||||
@@ -134,20 +134,20 @@ class JM extends ComicSource {
|
||||
if (res.status === 200) {
|
||||
let data = this.convertData(await res.text(), domainSecret)
|
||||
let json = JSON.parse(data)
|
||||
if (json["jm3_Server"]) {
|
||||
if (json["Server"]) {
|
||||
title = "Update Success"
|
||||
message = "\n"
|
||||
jm3_Server = json["jm3_Server"]
|
||||
servers = json["Server"].slice(0, 4)
|
||||
}
|
||||
}
|
||||
if (jm3_Server.length === 0) {
|
||||
if (servers.length === 0) {
|
||||
title = "Update Failed"
|
||||
message = `Using built-in domains:\n\n`
|
||||
domains = JM.apiDomains
|
||||
servers = JM.fallbackServers
|
||||
}
|
||||
for (let [domain, index] of jm3_Server) {
|
||||
message = message + `${index}: ${domain}\n`
|
||||
domains.push(domain)
|
||||
for (let i = 0; i < servers.length; i++) {
|
||||
message = message + `線路${i + 1}: ${servers[i]}\n\n`
|
||||
domains.push(servers[i])
|
||||
}
|
||||
if (showConfirmDialog) {
|
||||
UI.showDialog(
|
||||
@@ -370,6 +370,12 @@ class JM extends ComicSource {
|
||||
/// title of the category page, used to identify the page, it should be unique
|
||||
title: "禁漫天堂",
|
||||
parts: [
|
||||
{
|
||||
name: "每週必看",
|
||||
type: "fixed",
|
||||
categories: ["每週必看"],
|
||||
itemType: "category",
|
||||
},
|
||||
{
|
||||
name: "成人A漫",
|
||||
type: "fixed",
|
||||
@@ -480,6 +486,7 @@ class JM extends ComicSource {
|
||||
* @returns {Promise<{comics: Comic[], maxPage: number}>}
|
||||
*/
|
||||
load: async (category, param, options, page) => {
|
||||
if (category !== "每週必看") {
|
||||
param ??= category
|
||||
param = encodeURIComponent(param)
|
||||
let res = await this.get(`${this.baseUrl}/categories/filter?o=${options[0]}&c=${param}&page=${page}`)
|
||||
@@ -491,10 +498,27 @@ class JM extends ComicSource {
|
||||
comics: comics,
|
||||
maxPage: maxPage
|
||||
}
|
||||
} else {
|
||||
let res = await this.get(`${this.baseUrl}/week/filter?id=${options[0]}&page=1&type=${options[1]}&page=0`)
|
||||
let data = JSON.parse(res)
|
||||
let comics = data.list.map((e) => this.parseComic(e))
|
||||
return {
|
||||
comics: comics,
|
||||
maxPage: 1
|
||||
}
|
||||
}
|
||||
},
|
||||
// provide options for category comic loading
|
||||
optionList: [
|
||||
/**
|
||||
* [Optional] load options dynamically. If `optionList` is provided, this will be ignored.
|
||||
* @param category {string}
|
||||
* @param param {string?}
|
||||
* @return {Promise<{options: string[], label?: string}[]>} - return a list of option group, each group contains a list of options
|
||||
*/
|
||||
optionLoader: async (category, param) => {
|
||||
if (category !== "每週必看") {
|
||||
return [
|
||||
{
|
||||
label: "排序",
|
||||
// For a single option, use `-` to separate the value and text, left for value, right for text
|
||||
options: [
|
||||
"mr-最新",
|
||||
@@ -506,7 +530,30 @@ class JM extends ComicSource {
|
||||
"tf-最多喜歡",
|
||||
],
|
||||
}
|
||||
],
|
||||
]
|
||||
} else {
|
||||
let res = await this.get(`${this.baseUrl}/week`)
|
||||
let data = JSON.parse(res)
|
||||
let options = []
|
||||
for (let e of data["categories"]) {
|
||||
options.push(`${e["id"]}-${e["time"]}`)
|
||||
}
|
||||
return [
|
||||
{
|
||||
label: "時間",
|
||||
options: options,
|
||||
},
|
||||
{
|
||||
label: "類型",
|
||||
options: [
|
||||
"manga-日漫",
|
||||
"hanman-韓漫",
|
||||
"another-其他",
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
ranking: {
|
||||
// For a single option, use `-` to separate the value and text, left for value, right for text
|
||||
options: [
|
||||
|
43
lanraragi.js
43
lanraragi.js
@@ -2,23 +2,34 @@
|
||||
class Lanraragi extends ComicSource {
|
||||
name = "Lanraragi"
|
||||
key = "lanraragi"
|
||||
version = "1.0.0"
|
||||
version = "1.1.0"
|
||||
minAppVersion = "1.4.0"
|
||||
url = "https://git.nyne.dev/nyne/venera-configs/raw/branch/main/lanraragi.js"
|
||||
|
||||
settings = {
|
||||
api: { title: "API", type: "input", default: "http://lrr.tvc-16.science" }
|
||||
api: { title: "API", type: "input", default: "http://lrr.tvc-16.science" },
|
||||
apiKey: { title: "APIKEY", type: "input", default: "" }
|
||||
}
|
||||
get baseUrl() {
|
||||
|
||||
get baseUrl() {
|
||||
const api = this.loadSetting('api') || this.settings.api.default
|
||||
|
||||
return api.replace(/\/$/, '')
|
||||
}
|
||||
|
||||
get headers() {
|
||||
let apiKey = this.loadSetting('apiKey')
|
||||
if (apiKey) apiKey = "Bearer " + Convert.encodeBase64(Convert.encodeUtf8(apiKey))
|
||||
|
||||
return {
|
||||
"Authorization": `${apiKey}`,
|
||||
}
|
||||
}
|
||||
|
||||
async init() {
|
||||
try {
|
||||
const url = `${this.baseUrl}/api/categories`
|
||||
const res = await Network.get(url)
|
||||
const res = await Network.get(url, this.headers)
|
||||
if (res.status !== 200) { this.saveData('categories', []); return }
|
||||
let data = []
|
||||
try { data = JSON.parse(res.body) } catch (_) { data = [] }
|
||||
@@ -39,7 +50,7 @@ class Lanraragi extends ComicSource {
|
||||
explore = [
|
||||
{ title: "Lanraragi", type: "multiPageComicList", load: async (page = 1) => {
|
||||
const url = `${this.baseUrl}/api/archives`
|
||||
const res = await Network.get(url)
|
||||
const res = await Network.get(url, this.headers)
|
||||
if (res.status !== 200) throw `Invalid status code: ${res.status}`
|
||||
const data = JSON.parse(res.body)
|
||||
const list = data.slice((page-1)*50, page*50)
|
||||
@@ -114,7 +125,7 @@ class Lanraragi extends ComicSource {
|
||||
add('search[regex]', 'false')
|
||||
|
||||
const url = `${base}/search?${qp.join('&')}`
|
||||
const res = await Network.get(url)
|
||||
const res = await Network.get(url, this.headers)
|
||||
if (res.status !== 200) throw `Invalid status code: ${res.status}`
|
||||
const data = JSON.parse(res.body)
|
||||
const list = Array.isArray(data.data) ? data.data : []
|
||||
@@ -169,7 +180,7 @@ class Lanraragi extends ComicSource {
|
||||
add('groupby_tanks', groupby)
|
||||
|
||||
const url = `${base}/api/search?${qp.join('&')}`
|
||||
const res = await Network.get(url)
|
||||
const res = await Network.get(url, this.headers)
|
||||
if (res.status !== 200) throw `Invalid status code: ${res.status}`
|
||||
const data = JSON.parse(res.body)
|
||||
const all = Array.isArray(data.data) ? data.data : []
|
||||
@@ -225,7 +236,7 @@ class Lanraragi extends ComicSource {
|
||||
comic = {
|
||||
loadInfo: async (id) => {
|
||||
const url = `${this.baseUrl}/api/archives/${id}/metadata`
|
||||
const res = await Network.get(url)
|
||||
const res = await Network.get(url, this.headers)
|
||||
if (res.status !== 200) throw `Invalid status code: ${res.status}`
|
||||
const data = JSON.parse(res.body)
|
||||
const cover = `${this.baseUrl}/api/archives/${id}/thumbnail`
|
||||
@@ -237,7 +248,7 @@ class Lanraragi extends ComicSource {
|
||||
},
|
||||
loadThumbnails: async (id, next) => {
|
||||
const metaUrl = `${this.baseUrl}/api/archives/${id}/metadata`
|
||||
const res = await Network.get(metaUrl)
|
||||
const res = await Network.get(metaUrl, this.headers)
|
||||
if (res.status !== 200) throw `Invalid status code: ${res.status}`
|
||||
const data = JSON.parse(res.body)
|
||||
const pagecount = data.pagecount || 1
|
||||
@@ -249,7 +260,7 @@ class Lanraragi extends ComicSource {
|
||||
loadEp: async (comicId, epId) => {
|
||||
const base = (this.baseUrl || '').replace(/\/$/, '')
|
||||
const url = `${base}/api/archives/${comicId}/files?force=false`
|
||||
const res = await Network.get(url)
|
||||
const res = await Network.get(url, this.headers)
|
||||
if (res.status !== 200) throw `Invalid status code: ${res.status}`
|
||||
const data = JSON.parse(res.body)
|
||||
const images = (data.pages || []).map(p => {
|
||||
@@ -260,8 +271,16 @@ class Lanraragi extends ComicSource {
|
||||
}).filter(Boolean)
|
||||
return { images }
|
||||
},
|
||||
// onImageLoad: (url, comicId, epId) => ({}),
|
||||
// onThumbnailLoad: (url) => ({}),
|
||||
onImageLoad: (url, comicId, epId) => {
|
||||
return {
|
||||
headers: this.headers
|
||||
}
|
||||
},
|
||||
onThumbnailLoad: (url) => {
|
||||
return {
|
||||
headers: this.headers
|
||||
}
|
||||
},
|
||||
// likeComic: async (id, isLike) => {},
|
||||
// loadComments: async (comicId, subId, page, replyTo) => {},
|
||||
// sendComment: async (comicId, subId, content, replyTo) => {},
|
||||
|
@@ -7,7 +7,7 @@ class Nhentai extends ComicSource {
|
||||
// unique id of the source
|
||||
key = "nhentai"
|
||||
|
||||
version = "1.0.5"
|
||||
version = "1.0.6"
|
||||
|
||||
minAppVersion = "1.0.0"
|
||||
|
||||
@@ -523,7 +523,7 @@ class Nhentai extends ComicSource {
|
||||
'nhentai.net',
|
||||
],
|
||||
linkToId: (url) => {
|
||||
let regex = /\/g\/(\d+)\//g
|
||||
let regex = /\/g\/(\d+)\/?$/g
|
||||
let match = regex.exec(url)
|
||||
if(match) {
|
||||
return match[1]
|
||||
|
Reference in New Issue
Block a user