Skip to content

Commit

Permalink
fix(route/scmp): Replace got to obtain url from response (#16939)
Browse files Browse the repository at this point in the history
  • Loading branch information
dzx-dzx authored Sep 26, 2024
1 parent f72af1b commit 3dadf9c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/routes/scmp/utils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { load } from 'cheerio';
import got from '@/utils/got';
import { parseDate } from '@/utils/parse-date';
import ofetch from '@/utils/ofetch';

export const renderHTML = (node) => {
if (!node) {
Expand Down Expand Up @@ -60,7 +60,7 @@ export const renderHTML = (node) => {
};

export const parseItem = async (item) => {
const { data: response, url } = await got(item.link);
const { _data: response, url } = await ofetch.raw(item.link);

if (new URL(url).hostname !== 'www.scmp.com') {
// e.g., https://multimedia.scmp.com/
Expand Down

0 comments on commit 3dadf9c

Please sign in to comment.