From e600828bc2569a5ab3bf7aa6d35afdcfc5872250 Mon Sep 17 00:00:00 2001 From: nguyd1 <91645046+nguyd1@users.noreply.github.com> Date: Sat, 13 Jan 2024 01:01:09 -0800 Subject: [PATCH] Fix Cloudflare on NovelUpdates (#887) * fix cloudflare * fix import --- src/sources/en/novelupdates.js | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/sources/en/novelupdates.js b/src/sources/en/novelupdates.js index f4778756b..e5ae08646 100644 --- a/src/sources/en/novelupdates.js +++ b/src/sources/en/novelupdates.js @@ -1,15 +1,20 @@ import * as cheerio from 'cheerio'; -import { fetchApi, fetchHtml, cloudflareCheck } from '@utils/fetch/fetch'; +import { + fetchApi, + fetchHtml, + cloudflareCheck, + defaultUserAgentString, +} from '@utils/fetch/fetch'; import { defaultTo } from 'lodash-es'; import { FilterInputs } from '../types/filterTypes'; + const sourceId = 50; const sourceName = 'Novel Updates'; const baseUrl = 'https://www.novelupdates.com/'; -const userAgent = - 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36'; +const userAgent = defaultUserAgentString; const getPopularNovelsUrl = (page, { showLatestNovels, filters }) => { let url = `${baseUrl}${