Comments (5)
+1
from z-reader.
起点页面更新了 作者没跟进,爬虫失败了
from z-reader.
年后会更新。新版本会支持自定义源
from z-reader.
有新的可用的笔趣阁源地址嘛 在线等 急
from z-reader.
筆趣閣的 手動換了個源,大家將就著用吧,剩下等作者更新了
"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator"throw"); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.readerDriver = void 0;
const cheerio = require("cheerio");
const iconv = require('iconv-lite');
const request_1 = require("../../../utils/request");
const TreeNode_1 = require("../../../explorer/TreeNode");
const DOMAIN = 'http://www.biqu520.net';
class ReaderDriver {
hasChapter() {
return true;
}
search(keyword) {
return __awaiter(this, void 0, void 0, function* () {
const result = [];
try {
//const res = yield request_1.default.send(DOMAIN + '/modules/article/search.php?searchkey=' + encodeURI(keyword));
const res = yield request_1.default.send({
url: DOMAIN + '/modules/article/search.php?searchkey=' + encodeURI(keyword),
responseType: 'buffer'
});
const html2 = iconv.decode(res.body, 'gb2312');
const $ = cheerio.load(html2);
$('.grid tbody > tr').each(function (i, elem) {
const title = $(elem).find('td:nth-child(1)').text();
const author = $(elem).find('td:nth-child(3)').text();
const path = $(elem).find('td:nth-child(1)').find('a').attr('href');
if (title && author) {
result.push(new TreeNode_1.TreeNode(Object.assign({}, TreeNode_1.defaultTreeNode, {
type: '.biquge',
name: ${title} - ${author}
,
isDirectory: true,
path
})));
}
});
}
catch (error) {
console.warn(error);
}
return result;
});
}
getChapter(pathStr) {
return __awaiter(this, void 0, void 0, function* () {
const result = [];
try {
const res = yield request_1.default.send({
url:DOMAIN + pathStr,
responseType: 'buffer'
});
const html2 = iconv.decode(res.body, 'gb2312');
const $ = cheerio.load(html2);
$('#list dd').each(function (i, elem) {
const name = $(elem).find('a').text();
const path = $(elem).find('a').attr().href;
result.push(new TreeNode_1.TreeNode(Object.assign({}, TreeNode_1.defaultTreeNode, {
type: '.biquge',
name,
isDirectory: false,
path: path
})));
});
}
catch (error) {
console.warn(error);
}
return result;
});
}
getContent(pathStr) {
return __awaiter(this, void 0, void 0, function* () {
let result = '';
try {
const res = yield request_1.default.send({
url:DOMAIN + pathStr,
responseType: 'buffer'
});
const html2 = iconv.decode(res.body, 'gb2312');
const $ = cheerio.load(html2);
const html = $('#content').html();
result = html ? html: '';
}
catch (error) {
console.warn(error);
}
return result;
});
}
}
exports.readerDriver = new ReaderDriver();
//# sourceMappingURL=index.js.map
from z-reader.
Related Issues (20)
- 【侧边栏本地txt小说不显示目录】 HOT 1
- 笔趣阁的源不能用,自己改了一下,发现不能获取目录,能告诉是哪里错了吗 HOT 12
- 笔趣阁这个网站搜索有问题,书搜索不出来 HOT 5
- 打开本地epub文件,内部的图片加载不出来 HOT 2
- 作者可不可以加自定义笔趣阁源的功能 HOT 2
- 打开本地文件目录失效 HOT 2
- 老板键功能
- 经常出现网络错误问题,这个是什么原因 HOT 3
- [feature request] Provide an option to hide the icon on status bar HOT 1
- 几天以前能搜到的小说,现在搜索不到了 HOT 2
- 进度保存还是失效
- 在线搜索搜不到了 HOT 1
- 🚀支持自定义书源的新插件 HOT 14
- 本地txt乱码 HOT 1
- 开启代理无法查询到资源,报错 HOT 1
- 阅读进度保存后没有自动跳转
- 没法用了 搜索不到 HOT 1
- 为什么不多支持几个书源呢,希望有番茄 HOT 1
- 书源 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from z-reader.