Skip to content

Commit

Permalink
实现 #369 #273 #587
Browse files Browse the repository at this point in the history
  • Loading branch information
ldm0206 committed Nov 15, 2024
1 parent 954b6be commit 47b4a09
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 8 deletions.
8 changes: 8 additions & 0 deletions src/header.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@
"*://www.banzhuer.org/*_*/",
"*://www.xbiquge.tw/book/*/",
"*://www.xsbiquge.la/book/*/",
"*://www.bqu9.cc/book/*/",
"*://www.biququ.com/html/*/",
"*://www.ddyucshu.cc/*/",
"*://www.ddyveshu.cc/*/",
"*://www.007zw.com/shuzhai/*/",
"*://www.shaoniandream.com/book_detail/*",
"*://www.linovelib.com/novel/*/catalog",
Expand Down Expand Up @@ -368,6 +372,10 @@
"xbyuan.com",
"shaoniandream.com",
"fuxs1.com",
"bqu9.cc",
"biququ.com",
"ddyucshu.cc",
"ddyveshu.cc",
"*"
],
"require": [
Expand Down
7 changes: 7 additions & 0 deletions src/router/download.ts
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,13 @@ export async function getRule(): Promise<BaseRuleClass> {
/** mbtxt End **/

/** 笔趣阁 **/
case "www.bqu9.cc": {
const { bqu9 } = await import("../rules/biquge/onePage");
ruleClass = bqu9();
break;
}
case "www.biququ.com":
case "www.ddyveshu.cc":
case "www.81book.com":
case "www.81zw.com":
case "www.fuguoduxs.com":
Expand Down
13 changes: 13 additions & 0 deletions src/router/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ export function getUI(): () => UIObject {
}
};
}
case "www.ddyucshu.cc": {
return () => {
return {
type: "jump",
jumpFunction: () => {
document.location.href = document.location.href.replace(
"ddyucshu.cc",
'ddyveshu.cc'
)
},
}
};
}
case "www.ciyuanji.com": {
return () => {
if (document.location.pathname.startsWith("/bookDetails/info")) {
Expand Down
27 changes: 20 additions & 7 deletions src/rules/biquge/onePage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,19 @@ export const gebiqu = () =>
return content;
}
);

export const bqu9 = () =>
mkBiquge(
(introDom) => {
rms([/如果您喜欢.+,别忘记分享给朋友/g], introDom);
rm('a[href^="http://down.gebiqu.com"]', false, introDom);
return introDom;
},
(content) => {
rm2(['请收藏本站:https://www.bqu9.cc。笔趣阁手机版:https://m.bqu9.cc/'], content);
return content;
},
"#chaptercontent",
);
export const luoqiuzw = () =>
mkBiquge(
(introDom) => introDom,
Expand All @@ -52,6 +64,7 @@ export const biquwx = () =>
return introDom;
},
(content) => content,
undefined,
1
);

Expand All @@ -76,6 +89,7 @@ export const dijiubook = () =>
rm('img[src$="alipay.png"]', true, content);
return content;
},
undefined,
1,
50,
3000,
Expand Down Expand Up @@ -131,6 +145,7 @@ export const yruan = () =>
rm("b", true, content);
return content;
},
undefined,
3
);

Expand All @@ -147,6 +162,7 @@ export const b5200 = () =>
mkBiquge(
(introDom) => introDom,
(content) => content,
undefined,
1
);

Expand All @@ -159,12 +175,7 @@ export const bxwx333 = () =>
rm(".bottem2", true, content);
return content;
},
undefined,
undefined,
undefined,
undefined,
undefined,
"#zjneirong"
"#zjneirong",
);

export const xbiqugeLa = () =>
Expand All @@ -177,6 +188,7 @@ export const xbiqugeLa = () =>
rm2(["手机站全新改版升级地址"], content);
return content;
},
undefined,
1
);

Expand All @@ -201,6 +213,7 @@ export const shuquge = () =>
rm2(["请记住本书首发域名:", "www.ishuquge.org"], content);
return content;
},
undefined,
1
);

Expand Down
7 changes: 6 additions & 1 deletion src/rules/biquge/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,13 +126,18 @@ export function baseMultiIndex(
export function mkBiquge(
introDomPatch: (introDom: HTMLElement) => HTMLElement,
contentPatch: (content: HTMLElement) => HTMLElement,
chapterContentSelector?: string,
concurrencyLimit?: number,
sleepTime?: number,
maxSleepTime?: number,
overRide?: (classThis: BaseRuleClass) => any,
postHook?: (chapter: Chapter) => Chapter | void,
chapterContenSelector = "#content"
) {
let chapterContenSelector = "#content";

if (typeof chapterContentSelector == "string") {
chapterContenSelector = chapterContentSelector;
}
return mkRuleClass({
...baseOnePage(introDomPatch, concurrencyLimit, sleepTime, maxSleepTime, overRide, postHook),
getContent: (doc) => doc.querySelector(chapterContenSelector),
Expand Down

0 comments on commit 47b4a09

Please sign in to comment.