mirror of
https://github.com/venera-app/venera-configs.git
synced 2025-09-27 08:27:24 +00:00
Compare commits
2 Commits
ef87d90e89
...
62fbe9294b
Author | SHA1 | Date | |
---|---|---|---|
62fbe9294b | |||
91823846a0 |
@@ -1,4 +1,19 @@
|
|||||||
/** @type {import('./_venera_.js')} */
|
/** @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 {
|
class NewComicSource extends ComicSource {
|
||||||
// Note: The fields which are marked as [Optional] should be removed if not used
|
// 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: [
|
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
|
// For a single option, use `-` to separate the value and text, left for value, right for text
|
||||||
options: [
|
options: [
|
||||||
"newToOld-New to Old",
|
"newToOld-New to Old",
|
||||||
"oldToNew-Old to New"
|
"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,
|
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
|
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: {
|
ranking: {
|
||||||
// For a single option, use `-` to separate the value and text, left for value, right for text
|
// For a single option, use `-` to separate the value and text, left for value, right for text
|
||||||
options: [
|
options: [
|
||||||
|
@@ -46,7 +46,7 @@
|
|||||||
"name": "禁漫天堂",
|
"name": "禁漫天堂",
|
||||||
"fileName": "jm.js",
|
"fileName": "jm.js",
|
||||||
"key": "jm",
|
"key": "jm",
|
||||||
"version": "1.2.2",
|
"version": "1.3.0",
|
||||||
"description": "禁漫天堂漫畫源, 不能使用時請嘗試切換分流"
|
"description": "禁漫天堂漫畫源, 不能使用時請嘗試切換分流"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
57
jm.js
57
jm.js
@@ -7,9 +7,9 @@ class JM extends ComicSource {
|
|||||||
// unique id of the source
|
// unique id of the source
|
||||||
key = "jm"
|
key = "jm"
|
||||||
|
|
||||||
version = "1.2.2"
|
version = "1.3.0"
|
||||||
|
|
||||||
minAppVersion = "1.2.5"
|
minAppVersion = "1.5.0"
|
||||||
|
|
||||||
static jmVersion = "2.0.6"
|
static jmVersion = "2.0.6"
|
||||||
|
|
||||||
@@ -370,6 +370,12 @@ class JM extends ComicSource {
|
|||||||
/// title of the category page, used to identify the page, it should be unique
|
/// title of the category page, used to identify the page, it should be unique
|
||||||
title: "禁漫天堂",
|
title: "禁漫天堂",
|
||||||
parts: [
|
parts: [
|
||||||
|
{
|
||||||
|
name: "每週必看",
|
||||||
|
type: "fixed",
|
||||||
|
categories: ["每週必看"],
|
||||||
|
itemType: "category",
|
||||||
|
},
|
||||||
{
|
{
|
||||||
name: "成人A漫",
|
name: "成人A漫",
|
||||||
type: "fixed",
|
type: "fixed",
|
||||||
@@ -480,6 +486,7 @@ class JM extends ComicSource {
|
|||||||
* @returns {Promise<{comics: Comic[], maxPage: number}>}
|
* @returns {Promise<{comics: Comic[], maxPage: number}>}
|
||||||
*/
|
*/
|
||||||
load: async (category, param, options, page) => {
|
load: async (category, param, options, page) => {
|
||||||
|
if (category !== "每週必看") {
|
||||||
param ??= category
|
param ??= category
|
||||||
param = encodeURIComponent(param)
|
param = encodeURIComponent(param)
|
||||||
let res = await this.get(`${this.baseUrl}/categories/filter?o=${options[0]}&c=${param}&page=${page}`)
|
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,
|
comics: comics,
|
||||||
maxPage: maxPage
|
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
|
// For a single option, use `-` to separate the value and text, left for value, right for text
|
||||||
options: [
|
options: [
|
||||||
"mr-最新",
|
"mr-最新",
|
||||||
@@ -506,7 +530,30 @@ class JM extends ComicSource {
|
|||||||
"tf-最多喜歡",
|
"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: {
|
ranking: {
|
||||||
// For a single option, use `-` to separate the value and text, left for value, right for text
|
// For a single option, use `-` to separate the value and text, left for value, right for text
|
||||||
options: [
|
options: [
|
||||||
|
Reference in New Issue
Block a user