Skip to content

Commit

Permalink
add sfacg
Browse files Browse the repository at this point in the history
  • Loading branch information
Moleys committed Apr 28, 2022
1 parent e5ae681 commit dc301d2
Show file tree
Hide file tree
Showing 13 changed files with 125 additions and 7 deletions.
4 changes: 2 additions & 2 deletions jjwxc/plugin.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"metadata": {
"name": "jjwxc [Tấn Giang]",
"name": "Jjwxc [Tấn Giang] 💰",
"author": "Moleys",
"version": 3,
"version": 4,
"source": "http://www.jjwxc.net",
"regexp": "(www.|my.|m.)?jjwxc.net/(onebook|book2)(.*?)",
"description": "Đọc truyện trên trang http://www.jjwxc.net",
Expand Down
Binary file modified jjwxc/plugin.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions mipciweimao/plugin.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"metadata": {
"name": "Mip Ciweimao",
"name": "Mip Ciweimao 💰",
"author": "Moleys",
"version": 1,
"version": 2,
"source": "https://mip.ciweimao.com",
"regexp": "(mip.|wap.|www.)ciweimao.com/(book|chapter)/(\\d+)",
"description": "Đọc truyện trên trang https://mip.ciweimao.com",
Expand Down
Binary file modified mipciweimao/plugin.zip
Binary file not shown.
17 changes: 14 additions & 3 deletions plugin.json
Original file line number Diff line number Diff line change
Expand Up @@ -489,10 +489,10 @@
"locale": "vi-VN"
},
{
"name": "jjwxc [Tấn Giang]",
"name": "Jjwxc [Tấn Giang] 💰",
"author": "Moleys",
"path": "https://raw.githubusercontent.com/Moleys/vbook-ext/main/jjwxc/plugin.zip",
"version": 3,
"version": 4,
"source": "https://www.jjwxc.net",
"icon": "https://raw.githubusercontent.com/Moleys/vbook-ext/main/jjwxc/icon.png",
"description": "Đọc truyện trên trang https://www.jjwxc.net",
Expand Down Expand Up @@ -577,7 +577,7 @@
"locale": "zh_CN"
},
{
"name": "Mip Ciweimao",
"name": "Mip Ciweimao 💰",
"author": "Moleys",
"path": "https://raw.githubusercontent.com/Moleys/vbook-ext/main/mipciweimao/plugin.zip",
"version": 1,
Expand Down Expand Up @@ -820,6 +820,17 @@
"description": "Đọc truyện trên trang http://www.yodu.org",
"type": "chinese_novel",
"locale": "zh_CN"
},
{
"name": "Sfacg 💰",
"author": "Moleys",
"path": "https://raw.githubusercontent.com/Moleys/vbook-ext/main/sfacg/plugin.zip",
"version": 1,
"source": "https://book.sfacg.com",
"icon": "https://raw.githubusercontent.com/Moleys/vbook-ext/main/sfacg/icon.png",
"description": "Đọc truyện trên trang https://book.sfacg.com",
"type": "chinese_novel",
"locale": "zh_CN"
}
]
}
Binary file added sfacg/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions sfacg/plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"metadata": {
"name": "Sfacg 💰",
"author": "Moleys",
"version": 1,
"source": "https://book.sfacg.com",
"regexp": "(book.|m.)?sfacg.com/(Novel|b)/\\d+/?$",
"description": "Đọc truyện trên trang https://book.sfacg.com",
"locale": "zh_CN",
"language": "javascript",
"type": "chinese_novel"
},
"script": {
"home": "home.js",
"detail": "detail.js",
"toc": "toc.js",
"chap": "chap.js"
}
}
Binary file added sfacg/plugin.zip
Binary file not shown.
11 changes: 11 additions & 0 deletions sfacg/src/chap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function execute(url) {
let response = fetch(url);
if (response.ok) {
let doc = response.html();
let htm = doc.select("#ChapterBody").html();
if(url.includes("/vip/"))
htm = "Extension hiện không hỗ trợ đọc chương VIP"
return Response.success(htm);
}
return null;
}
22 changes: 22 additions & 0 deletions sfacg/src/detail.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
function execute(url) {
url = url.replace('m.sfacg.com/b/', 'book.sfacg.com/Novel/');
let response = fetch(url);
if (response.ok) {

let doc = response.html();
let coverImg = doc.select(".figure .pic img").first().attr("src");
if (coverImg.startsWith("/")) {
coverImg = "https://book.sfacg.com" + coverImg;
}
let author = doc.select(".author-name").first().text();
return Response.success({
name: doc.select(".content .book-title").text(),
cover: coverImg,
author: author,
description: doc.select(".introduce").text(),
detail: "作者: " + author + "<br>" + doc.select(".count-detail .text-row").first().html(),
host: "https://book.sfacg.com"
});
}
return null;
}
21 changes: 21 additions & 0 deletions sfacg/src/gen.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
function execute(url, page) {
if(!page) page='1'
let response = fetch(url+"&PageIndex=" + page);
if (response.ok) {
let doc = response.html();
const data = [];
doc.select(".list_tabs ul.Comic_Pic_List").forEach(e => {
data.push({
name: e.select("img").first().attr("alt"),
link: e.select("a").first().attr("href"),
cover: e.select("img").first().attr("src"),
description: e.select("a").get(2).text(),
host: "https://book.sfacg.com"
})
});
let next = doc.select("li.pagebarNext a").attr("href").split(/[= ]+/).pop();
// let next = (parseInt(page) + 1).toString();
return Response.success(data, next)
}
return null;
}
13 changes: 13 additions & 0 deletions sfacg/src/home.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
function execute() {
return Response.success([
{title: "魔幻", input: "https://book.sfacg.com/List/default.aspx?tid=21", script: "gen.js"},
{title: "玄幻", input: "https://book.sfacg.com/List/default.aspx?tid=22", script: "gen.js"},
{title: "古风", input: "https://book.sfacg.com/List/default.aspx?tid=23", script: "gen.js"},
{title: "科幻", input: "https://book.sfacg.com/List/default.aspx?tid=24", script: "gen.js"},
{title: "校园", input: "https://book.sfacg.com/List/default.aspx?tid=25", script: "gen.js"},
{title: "都市", input: "https://book.sfacg.com/List/default.aspx?tid=26", script: "gen.js"},
{title: "游戏", input: "https://book.sfacg.com/List/default.aspx?tid=27", script: "gen.js"},
{title: "同人", input: "https://book.sfacg.com/List/default.aspx?tid=28", script: "gen.js"},
{title: "悬疑", input: "https://book.sfacg.com/List/default.aspx?tid=29", script: "gen.js"}
]);
}
21 changes: 21 additions & 0 deletions sfacg/src/toc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
function execute(url) {
url = url.replace('m.sfacg.com/b/', 'book.sfacg.com/Novel/');
if(url.endsWith('/'))
url = url.slice(0, -1)
let response = fetch(url+"/MainIndex/");
if (response.ok) {
let doc = response.html();
let el = doc.select(".catalog-list ul li a")
const data = [];
for (let i = 0;i < el.size(); i++) {
var e = el.get(i);
data.push({
name: e.select("a").text().replace("","").trim(),
url: "https://book.sfacg.com" + e.attr("href"),
host: "https://book.sfacg.com"
})
}
return Response.success(data);
}
return null;
}

0 comments on commit dc301d2

Please sign in to comment.