mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-11 15:47:48 +08:00
feat: deps cloudscraper -> hooman, close #4538
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
const url = require('url');
|
||||
const cheerio = require('cheerio');
|
||||
const cloudscraper = require('cloudscraper');
|
||||
const got = require('hooman');
|
||||
const dateUtil = require('@/utils/date');
|
||||
|
||||
// 通过传入不同的ctx.state.data.link 返回javlibrary 不同link的rss
|
||||
exports.template = async function template(ctx) {
|
||||
const link = ctx.state.data.link;
|
||||
const response = await cloudscraper.get(link);
|
||||
const $ = cheerio.load(response);
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.body);
|
||||
const list = $('.videothumblist .video').get();
|
||||
|
||||
const items = await Promise.all(
|
||||
@@ -20,8 +20,8 @@ exports.template = async function template(ctx) {
|
||||
};
|
||||
|
||||
const details = await ctx.cache.tryGet(itemLink, async () => {
|
||||
const response = await cloudscraper.get(itemLink);
|
||||
const $ = cheerio.load(response);
|
||||
const response = await got.get(itemLink);
|
||||
const $ = cheerio.load(response.body);
|
||||
$('#video_info #video_review .icon').remove();
|
||||
return {
|
||||
author: $('.star').text(),
|
||||
@@ -40,8 +40,8 @@ exports.template = async function template(ctx) {
|
||||
};
|
||||
|
||||
exports.getVideoComments = async function getVideoComments(link) {
|
||||
const response = await cloudscraper.get(link);
|
||||
const $ = cheerio.load(response);
|
||||
const response = await got.get(link);
|
||||
const $ = cheerio.load(response.body);
|
||||
const list = $('#video_comments > table');
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user