mirror of
https://github.com/DIYgod/RSSHub.git
synced 2025-12-09 06:30:40 +08:00
fix: leetcode article image path (#2823)
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
const got = require('@/utils/got');
|
const got = require('@/utils/got');
|
||||||
const cheerio = require('cheerio');
|
const cheerio = require('cheerio');
|
||||||
const url = require('url');
|
const url = require('url');
|
||||||
|
const { addNoReferrer } = require('@/utils/common-utils');
|
||||||
|
|
||||||
const host = 'https://leetcode.com';
|
const host = 'https://leetcode.com';
|
||||||
|
|
||||||
@@ -42,6 +43,9 @@ module.exports = async (ctx) => {
|
|||||||
|
|
||||||
const response = await got.get(itemUrl);
|
const response = await got.get(itemUrl);
|
||||||
const $ = cheerio.load(response.data);
|
const $ = cheerio.load(response.data);
|
||||||
|
|
||||||
|
addNoReferrer($, '', 'src', itemUrl);
|
||||||
|
|
||||||
const description =
|
const description =
|
||||||
$('#question-preview')
|
$('#question-preview')
|
||||||
.html()
|
.html()
|
||||||
|
|||||||
Reference in New Issue
Block a user