Giter Site home page Giter Site logo

Comments (5)

dr110297 avatar dr110297 commented on June 21, 2024 1

+1

from z-reader.

smileqwe avatar smileqwe commented on June 21, 2024 1

起点页面更新了 作者没跟进,爬虫失败了

from z-reader.

aooiuu avatar aooiuu commented on June 21, 2024 1

年后会更新。新版本会支持自定义源

from z-reader.

1394225561 avatar 1394225561 commented on June 21, 2024

有新的可用的笔趣阁源地址嘛 在线等 急

from z-reader.

shakingbabygg avatar shakingbabygg commented on June 21, 2024

筆趣閣的 手動換了個源,大家將就著用吧,剩下等作者更新了
"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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.