New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add naver webtoon #3376
feat: add naver webtoon #3376
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add docs
I added docs. |
const domain = 'https://comic.naver.com'; | ||
|
||
async function getDescription(link) { | ||
const { body } = await got.get(link); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should use cache for invariable content here, see: https://docs.rsshub.app/en/joinus/#enable-caching
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I fixed it. please check it.
lib/routes/webtoons/naver.js
Outdated
const { body } = await got.get(link); | ||
const $ = cheerio.load(body); | ||
return $('#comic_view_area > div.wt_viewer').html(); | ||
result = $('#comic_view_area > div.wt_viewer').html(); | ||
ctx.cache.set(key, result, Number.POSITIVE_INFINITY); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the third parameter Number.POSITIVE_INFINITY
is not needed, there is a default value config.cache.contentExpire
: https://github.com/DIYgod/RSSHub/blob/master/lib/middleware/cache.js#L46, controlled by external config
Number.POSITIVE_INFINITY -> config.cache.contentExpire
https://comic.naver.com