diff --git a/lib/v2/12306/index.js b/lib/v2/12306/index.js index 4def837085..2765eed802 100644 --- a/lib/v2/12306/index.js +++ b/lib/v2/12306/index.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; const rootUrl = 'https://kyfw.12306.cn'; diff --git a/lib/v2/141jav/index.js b/lib/v2/141jav/index.js index 770305d6f3..b95e7a10d1 100644 --- a/lib/v2/141jav/index.js +++ b/lib/v2/141jav/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://www.141jav.com'; diff --git a/lib/v2/141ppv/index.js b/lib/v2/141ppv/index.js index 8d5c8583eb..a65ce12bda 100644 --- a/lib/v2/141ppv/index.js +++ b/lib/v2/141ppv/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://www.141ppv.com'; diff --git a/lib/v2/163/ds.js b/lib/v2/163/ds.js index 0c3934cb2a..4b358d8a52 100644 --- a/lib/v2/163/ds.js +++ b/lib/v2/163/ds.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const root_url = 'https://inf.ds.163.com'; diff --git a/lib/v2/163/exclusive.js b/lib/v2/163/exclusive.js index ec33212215..4ee406af75 100644 --- a/lib/v2/163/exclusive.js +++ b/lib/v2/163/exclusive.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const ids = { '': { diff --git a/lib/v2/163/music/artist-songs.js b/lib/v2/163/music/artist-songs.js index 1c219e98a0..3d2f1627c1 100644 --- a/lib/v2/163/music/artist-songs.js +++ b/lib/v2/163/music/artist-songs.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { id } = ctx.params; diff --git a/lib/v2/163/music/artist.js b/lib/v2/163/music/artist.js index e41ab19b9d..8391d9a61d 100644 --- a/lib/v2/163/music/artist.js +++ b/lib/v2/163/music/artist.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/163/music/djradio.js b/lib/v2/163/music/djradio.js index 4698cd947d..49abeb9b6a 100644 --- a/lib/v2/163/music/djradio.js +++ b/lib/v2/163/music/djradio.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/163/music/playlist.js b/lib/v2/163/music/playlist.js index 12c3961056..7c89723f84 100644 --- a/lib/v2/163/music/playlist.js +++ b/lib/v2/163/music/playlist.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { if (!config.ncm || !config.ncm.cookies) { diff --git a/lib/v2/163/music/userevents.js b/lib/v2/163/music/userevents.js index 2976cdea94..dd7f1ad6ad 100644 --- a/lib/v2/163/music/userevents.js +++ b/lib/v2/163/music/userevents.js @@ -1,4 +1,4 @@ -const path = require('path'); +import * as path from 'node:path'; import got from '@/utils/got'; import { art } from '@/utils/render'; const renderDescription = (info) => art(path.join(__dirname, '../templates/music/userevents.art'), info); diff --git a/lib/v2/163/music/userplaylist.js b/lib/v2/163/music/userplaylist.js index 862ccd7b51..010ef8e6fc 100644 --- a/lib/v2/163/music/userplaylist.js +++ b/lib/v2/163/music/userplaylist.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const uid = ctx.req.param('uid'); diff --git a/lib/v2/163/music/userplayrecords.js b/lib/v2/163/music/userplayrecords.js index e9ae552c59..00cad4e5e6 100644 --- a/lib/v2/163/music/userplayrecords.js +++ b/lib/v2/163/music/userplayrecords.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const headers = { cookie: config.ncm.cookies, diff --git a/lib/v2/163/open/vip.js b/lib/v2/163/open/vip.js index c91f2c06d6..6896d61f74 100644 --- a/lib/v2/163/open/vip.js +++ b/lib/v2/163/open/vip.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const url = 'https://vip.open.163.com'; diff --git a/lib/v2/163/utils.js b/lib/v2/163/utils.js index 7f33ebef76..6d202be61f 100644 --- a/lib/v2/163/utils.js +++ b/lib/v2/163/utils.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const iconv = require('iconv-lite'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const parseDyArticle = (charset, item, tryGet) => tryGet(item.link, async () => { diff --git a/lib/v2/18comic/utils.js b/lib/v2/18comic/utils.js index 2bc40b32c3..f37f7bdcbf 100644 --- a/lib/v2/18comic/utils.js +++ b/lib/v2/18comic/utils.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; const defaultDomain = 'jmcomic1.me'; diff --git a/lib/v2/1point3acres/offer.js b/lib/v2/1point3acres/offer.js index 6d8d49acb5..08e3524939 100644 --- a/lib/v2/1point3acres/offer.js +++ b/lib/v2/1point3acres/offer.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { // year 2017-2022 diff --git a/lib/v2/1point3acres/utils.js b/lib/v2/1point3acres/utils.js index c7baaf411c..4aa32fe825 100644 --- a/lib/v2/1point3acres/utils.js +++ b/lib/v2/1point3acres/utils.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const bbcode = require('bbcodejs'); const rootUrl = 'https://instant.1point3acres.com'; diff --git a/lib/v2/2048/index.js b/lib/v2/2048/index.js index ea8806f2e8..0f17b0194f 100644 --- a/lib/v2/2048/index.js +++ b/lib/v2/2048/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id') ?? '2'; diff --git a/lib/v2/4gamers/utils.js b/lib/v2/4gamers/utils.js index df3384edc8..b604a64d90 100644 --- a/lib/v2/4gamers/utils.js +++ b/lib/v2/4gamers/utils.js @@ -1,5 +1,5 @@ import got from '@/utils/got'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/4ksj/forum.js b/lib/v2/4ksj/forum.js index 75f49fc2d0..27c59d7896 100644 --- a/lib/v2/4ksj/forum.js +++ b/lib/v2/4ksj/forum.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const iconv = require('iconv-lite'); module.exports = async (ctx) => { diff --git a/lib/v2/500px/tribe-set.js b/lib/v2/500px/tribe-set.js index 2e93521db8..7f05fa6ad5 100644 --- a/lib/v2/500px/tribe-set.js +++ b/lib/v2/500px/tribe-set.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { baseUrl, getTribeDetail, getTribeSets } = require('./utils'); diff --git a/lib/v2/500px/user.js b/lib/v2/500px/user.js index 2a18525621..8513dd54b1 100644 --- a/lib/v2/500px/user.js +++ b/lib/v2/500px/user.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; const { baseUrl, getUserInfoFromUsername, getUserInfoFromId, getUserWorks } = require('./utils'); module.exports = async (ctx) => { diff --git a/lib/v2/56kog/util.js b/lib/v2/56kog/util.js index 5b0647c5d9..668852b6bc 100644 --- a/lib/v2/56kog/util.js +++ b/lib/v2/56kog/util.js @@ -4,7 +4,7 @@ const iconv = require('iconv-lite'); import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://www.56kog.com'; diff --git a/lib/v2/591/list.js b/lib/v2/591/list.js index a6c77fc92c..970248acf9 100644 --- a/lib/v2/591/list.js +++ b/lib/v2/591/list.js @@ -1,4 +1,4 @@ -const path = require('path'); +import * as path from 'node:path'; const { CookieJar } = require('tough-cookie'); import { load } from 'cheerio'; diff --git a/lib/v2/78dm/index.js b/lib/v2/78dm/index.js index 904eb3f7ac..81cb8bf368 100644 --- a/lib/v2/78dm/index.js +++ b/lib/v2/78dm/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://www.78dm.net'; diff --git a/lib/v2/7mmtv/index.js b/lib/v2/7mmtv/index.js index dc93bf03d4..ffd6c27462 100644 --- a/lib/v2/7mmtv/index.js +++ b/lib/v2/7mmtv/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const language = ctx.req.param('language') ?? 'en'; diff --git a/lib/v2/8264/list.js b/lib/v2/8264/list.js index aea2a78ece..5d0d657894 100644 --- a/lib/v2/8264/list.js +++ b/lib/v2/8264/list.js @@ -5,7 +5,7 @@ const iconv = require('iconv-lite'); import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { id = '751' } = ctx.params; diff --git a/lib/v2/91porn/author.js b/lib/v2/91porn/author.js index 39cfb82d4d..1898cf04ab 100644 --- a/lib/v2/91porn/author.js +++ b/lib/v2/91porn/author.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { domainValidation } = require('./utils'); module.exports = async (ctx) => { diff --git a/lib/v2/91porn/index.js b/lib/v2/91porn/index.js index d8eb55a94c..8dc6e7d004 100644 --- a/lib/v2/91porn/index.js +++ b/lib/v2/91porn/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { domainValidation } = require('./utils'); module.exports = async (ctx) => { diff --git a/lib/v2/95mm/utils.js b/lib/v2/95mm/utils.js index b508405257..7d13f61cfc 100644 --- a/lib/v2/95mm/utils.js +++ b/lib/v2/95mm/utils.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://www.95mm.vip'; diff --git a/lib/v2/abc/index.js b/lib/v2/abc/index.js index c1cd89b2f9..d1cef2d936 100644 --- a/lib/v2/abc/index.js +++ b/lib/v2/abc/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category = 'news/justin' } = ctx.params; diff --git a/lib/v2/acs/journal.js b/lib/v2/acs/journal.js index a54d3c82cb..f8ce37d609 100644 --- a/lib/v2/acs/journal.js +++ b/lib/v2/acs/journal.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; import puppeteer from '@/utils/puppeteer'; diff --git a/lib/v2/aeaweb/index.js b/lib/v2/aeaweb/index.js index 35b144c1b8..12f566d0b1 100644 --- a/lib/v2/aeaweb/index.js +++ b/lib/v2/aeaweb/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { let id = ctx.req.param('id'); diff --git a/lib/v2/aeon/utils.js b/lib/v2/aeon/utils.js index 51f42936ba..f494632095 100644 --- a/lib/v2/aeon/utils.js +++ b/lib/v2/aeon/utils.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const getData = async (ctx, list) => { const items = await Promise.all( diff --git a/lib/v2/aicaijing/index.js b/lib/v2/aicaijing/index.js index 960093e76d..1cf7cbc408 100644 --- a/lib/v2/aicaijing/index.js +++ b/lib/v2/aicaijing/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const category = ctx.req.param('category') ?? 'latest'; diff --git a/lib/v2/aip/utils.js b/lib/v2/aip/utils.js index d5914c56ff..3c7780e730 100644 --- a/lib/v2/aip/utils.js +++ b/lib/v2/aip/utils.js @@ -1,4 +1,4 @@ -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const puppeteerGet = async (url, browser) => { diff --git a/lib/v2/aljazeera/index.js b/lib/v2/aljazeera/index.js index 1be46a0fa5..f6542702a9 100644 --- a/lib/v2/aljazeera/index.js +++ b/lib/v2/aljazeera/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const languages = { arabic: { diff --git a/lib/v2/amazon/kindle-software-updates.js b/lib/v2/amazon/kindle-software-updates.js index 690c3eb4fa..c8aab7f692 100644 --- a/lib/v2/amazon/kindle-software-updates.js +++ b/lib/v2/amazon/kindle-software-updates.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.amazon.com'; module.exports = async (ctx) => { diff --git a/lib/v2/app-center/release.js b/lib/v2/app-center/release.js index 3ac4fd3e2b..bbddfd8421 100644 --- a/lib/v2/app-center/release.js +++ b/lib/v2/app-center/release.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const MarkdownIt = require('markdown-it'); module.exports = async (ctx) => { diff --git a/lib/v2/aqara/post.js b/lib/v2/aqara/post.js index f5f0f981e3..7cc6387aed 100644 --- a/lib/v2/aqara/post.js +++ b/lib/v2/aqara/post.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/v2/arcteryx/new-arrivals.js b/lib/v2/arcteryx/new-arrivals.js index 00ded08250..022b1d9613 100644 --- a/lib/v2/arcteryx/new-arrivals.js +++ b/lib/v2/arcteryx/new-arrivals.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { generateRssData } = require('./utils'); module.exports = async (ctx) => { diff --git a/lib/v2/arcteryx/outlet.js b/lib/v2/arcteryx/outlet.js index 6d59db5492..9b388a3a05 100644 --- a/lib/v2/arcteryx/outlet.js +++ b/lib/v2/arcteryx/outlet.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { generateRssData } = require('./utils'); module.exports = async (ctx) => { diff --git a/lib/v2/arcteryx/regear-new-arrivals.js b/lib/v2/arcteryx/regear-new-arrivals.js index 71c3d5f62c..27ce925391 100644 --- a/lib/v2/arcteryx/regear-new-arrivals.js +++ b/lib/v2/arcteryx/regear-new-arrivals.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const host = 'https://www.regear.arcteryx.com'; function getUSDPrice(number) { diff --git a/lib/v2/artstation/user.js b/lib/v2/artstation/user.js index 758585e9e0..1809ff5aa2 100644 --- a/lib/v2/artstation/user.js +++ b/lib/v2/artstation/user.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { config } from '@/config'; diff --git a/lib/v2/asiantolick/index.js b/lib/v2/asiantolick/index.js index c2ec0bf2c2..5274dc48a8 100644 --- a/lib/v2/asiantolick/index.js +++ b/lib/v2/asiantolick/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category } = ctx.params; diff --git a/lib/v2/asus/bios.js b/lib/v2/asus/bios.js index 6297cdba5b..50ffdfa21a 100644 --- a/lib/v2/asus/bios.js +++ b/lib/v2/asus/bios.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const getProductID = async (model) => { const searchAPI = `https://odinapi.asus.com.cn/recent-data/apiv2/SearchSuggestion?SystemCode=asus&WebsiteCode=cn&SearchKey=${model}&SearchType=ProductsAll&RowLimit=4&sitelang=cn`; diff --git a/lib/v2/baidu/gushitong/index.js b/lib/v2/baidu/gushitong/index.js index 170b6c05ef..aceb3acec6 100644 --- a/lib/v2/baidu/gushitong/index.js +++ b/lib/v2/baidu/gushitong/index.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const STATUS_MAP = { up: '上涨', diff --git a/lib/v2/baidu/search.js b/lib/v2/baidu/search.js index c1453812b8..810a0d086e 100644 --- a/lib/v2/baidu/search.js +++ b/lib/v2/baidu/search.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const renderDescription = (description, images) => art(path.join(__dirname, './templates/description.art'), { description, images }); import { config } from '@/config'; diff --git a/lib/v2/baidu/tieba/forum.js b/lib/v2/baidu/tieba/forum.js index c06d904552..537beca78a 100644 --- a/lib/v2/baidu/tieba/forum.js +++ b/lib/v2/baidu/tieba/forum.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { // sortBy: created, replied diff --git a/lib/v2/baidu/tieba/post.js b/lib/v2/baidu/tieba/post.js index 88f394e145..1cc77f0734 100644 --- a/lib/v2/baidu/tieba/post.js +++ b/lib/v2/baidu/tieba/post.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; /** * 获取最新的帖子回复(倒序查看) diff --git a/lib/v2/baidu/tieba/search.js b/lib/v2/baidu/tieba/search.js index 68685387ed..0dc037fa70 100644 --- a/lib/v2/baidu/tieba/search.js +++ b/lib/v2/baidu/tieba/search.js @@ -4,7 +4,7 @@ const iconv = require('iconv-lite'); import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const qw = ctx.req.param('qw'); diff --git a/lib/v2/baidu/top.js b/lib/v2/baidu/top.js index 7956511313..990613adc2 100644 --- a/lib/v2/baidu/top.js +++ b/lib/v2/baidu/top.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { board = 'realtime' } = ctx.params; diff --git a/lib/v2/bandcamp/weekly.js b/lib/v2/bandcamp/weekly.js index b72b4446da..17f6200775 100644 --- a/lib/v2/bandcamp/weekly.js +++ b/lib/v2/bandcamp/weekly.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://bandcamp.com'; diff --git a/lib/v2/bangumi/online/online.js b/lib/v2/bangumi/online/online.js index 8a81b06a89..c5db847a9c 100644 --- a/lib/v2/bangumi/online/online.js +++ b/lib/v2/bangumi/online/online.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const url = 'https://api.bangumi.online/serve/home'; diff --git a/lib/v2/bangumi/tv/calendar/today.js b/lib/v2/bangumi/tv/calendar/today.js index 3f2d74e805..733c1313af 100644 --- a/lib/v2/bangumi/tv/calendar/today.js +++ b/lib/v2/bangumi/tv/calendar/today.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; const getData = require('./_base'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const [list, data] = await getData(cache.tryGet); diff --git a/lib/v2/bangumi/tv/subject/ep.js b/lib/v2/bangumi/tv/subject/ep.js index 8a73cbe79c..a7cf8ebfd0 100644 --- a/lib/v2/bangumi/tv/subject/ep.js +++ b/lib/v2/bangumi/tv/subject/ep.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { getLocalName } = require('./utils'); module.exports = async (subjectID, showOriginalName) => { diff --git a/lib/v2/baozimh/index.js b/lib/v2/baozimh/index.js index 6bb435ab09..ab3025d920 100644 --- a/lib/v2/baozimh/index.js +++ b/lib/v2/baozimh/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://www.baozimh.com'; diff --git a/lib/v2/bdys/index.js b/lib/v2/bdys/index.js index 42b872781a..8c4df68fbd 100644 --- a/lib/v2/bdys/index.js +++ b/lib/v2/bdys/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const asyncPool = require('tiny-async-pool'); import { config } from '@/config'; diff --git a/lib/v2/bgmlist/onair.js b/lib/v2/bgmlist/onair.js index d81e4c9a15..84e3b9bb48 100644 --- a/lib/v2/bgmlist/onair.js +++ b/lib/v2/bgmlist/onair.js @@ -1,5 +1,5 @@ import got from '@/utils/got'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/v2/bloomberg/utils.js b/lib/v2/bloomberg/utils.js index e831a22246..98980ac16d 100644 --- a/lib/v2/bloomberg/utils.js +++ b/lib/v2/bloomberg/utils.js @@ -1,6 +1,6 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; const asyncPool = require('tiny-async-pool'); import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/bsky/posts.js b/lib/v2/bsky/posts.js index c8801cefca..1896f26e0a 100644 --- a/lib/v2/bsky/posts.js +++ b/lib/v2/bsky/posts.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import { parseDate } from '@/utils/parse-date'; const { resolveHandle, getProfile, getAuthorFeed } = require('./utils'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { handle } = ctx.params; diff --git a/lib/v2/btzj/index.js b/lib/v2/btzj/index.js index 903181bcba..881c2da55c 100644 --- a/lib/v2/btzj/index.js +++ b/lib/v2/btzj/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; const allowDomain = new Set(['2btjia.com', '88btbtt.com', 'btbtt15.com', 'btbtt20.com']); diff --git a/lib/v2/caai/utils.js b/lib/v2/caai/utils.js index 8d3534f861..489316e9a7 100644 --- a/lib/v2/caai/utils.js +++ b/lib/v2/caai/utils.js @@ -1,7 +1,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/v2/caareviews/utils.js b/lib/v2/caareviews/utils.js index 55bacce8eb..172c7ed78e 100644 --- a/lib/v2/caareviews/utils.js +++ b/lib/v2/caareviews/utils.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'http://www.caareviews.org'; diff --git a/lib/v2/cahkms/index.js b/lib/v2/cahkms/index.js index 89207862a7..47c05bb279 100644 --- a/lib/v2/cahkms/index.js +++ b/lib/v2/cahkms/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const titles = { '01': '关于我们', diff --git a/lib/v2/caixin/database.js b/lib/v2/caixin/database.js index 4543a6ddc7..3d96e03539 100644 --- a/lib/v2/caixin/database.js +++ b/lib/v2/caixin/database.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://database.caixin.com'; diff --git a/lib/v2/caixin/latest.js b/lib/v2/caixin/latest.js index 8e5a30f5f1..e86078db27 100644 --- a/lib/v2/caixin/latest.js +++ b/lib/v2/caixin/latest.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { data } = await got('https://gateway.caixin.com/api/dataplatform/scroll/index').json(); diff --git a/lib/v2/caixin/utils.js b/lib/v2/caixin/utils.js index 9926333540..94d57facca 100644 --- a/lib/v2/caixin/utils.js +++ b/lib/v2/caixin/utils.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const parseArticle = (item, tryGet) => /\.blog\.caixin\.com$/.test(new URL(item.link).hostname) diff --git a/lib/v2/cankaoxiaoxi/index.js b/lib/v2/cankaoxiaoxi/index.js index 6b46fb532c..c46d5c0dc5 100644 --- a/lib/v2/cankaoxiaoxi/index.js +++ b/lib/v2/cankaoxiaoxi/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id') ?? 'diyi'; diff --git a/lib/v2/cartoonmad/comic.js b/lib/v2/cartoonmad/comic.js index f51ff00a19..de686c84e2 100644 --- a/lib/v2/cartoonmad/comic.js +++ b/lib/v2/cartoonmad/comic.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; const iconv = require('iconv-lite'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const baseUrl = 'https://www.cartoonmad.com'; const KEY = '5e585'; diff --git a/lib/v2/cbaigui/index.js b/lib/v2/cbaigui/index.js index f38a5b4db4..ab9989dab0 100644 --- a/lib/v2/cbaigui/index.js +++ b/lib/v2/cbaigui/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { rootUrl, apiSlug, GetFilterId } = require('./utils'); diff --git a/lib/v2/ccf/ccfcv/index.js b/lib/v2/ccf/ccfcv/index.js index 26fbfdab95..90ccdb7125 100644 --- a/lib/v2/ccf/ccfcv/index.js +++ b/lib/v2/ccf/ccfcv/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://tc.ccf.org.cn'; diff --git a/lib/v2/ccf/tfbd/utils.js b/lib/v2/ccf/tfbd/utils.js index 5a6ba92630..286a020a15 100644 --- a/lib/v2/ccf/tfbd/utils.js +++ b/lib/v2/ccf/tfbd/utils.js @@ -1,7 +1,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/v2/cctv/utils/news.js b/lib/v2/cctv/utils/news.js index c72afc83c9..978d78c742 100644 --- a/lib/v2/cctv/utils/news.js +++ b/lib/v2/cctv/utils/news.js @@ -1,6 +1,6 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import randUserAgent from '@/utils/rand-user-agent'; diff --git a/lib/v2/cde/xxgk.js b/lib/v2/cde/xxgk.js index 8b9bbda659..873690a81e 100644 --- a/lib/v2/cde/xxgk.js +++ b/lib/v2/cde/xxgk.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const utils = require('./utils'); const baseUrl = 'https://www.cde.org.cn'; diff --git a/lib/v2/cdzjryb/project-list.js b/lib/v2/cdzjryb/project-list.js index a491911825..b7fc58d2ab 100644 --- a/lib/v2/cdzjryb/project-list.js +++ b/lib/v2/cdzjryb/project-list.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const url = 'https://zw.cdzjryb.com/lottery/accept/projectList'; diff --git a/lib/v2/cebbank/all.js b/lib/v2/cebbank/all.js index 492cf8f8e4..d5326c8999 100644 --- a/lib/v2/cebbank/all.js +++ b/lib/v2/cebbank/all.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/cebbank/history.js b/lib/v2/cebbank/history.js index f5293de485..887a32a463 100644 --- a/lib/v2/cebbank/history.js +++ b/lib/v2/cebbank/history.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const utils = require('./utils'); diff --git a/lib/v2/chaincatcher/home.js b/lib/v2/chaincatcher/home.js index 7650346ca4..a212765c3b 100644 --- a/lib/v2/chaincatcher/home.js +++ b/lib/v2/chaincatcher/home.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://www.chaincatcher.com'; diff --git a/lib/v2/changba/user.js b/lib/v2/changba/user.js index 62a39e7e6e..b73ccf36c7 100644 --- a/lib/v2/changba/user.js +++ b/lib/v2/changba/user.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const headers = { 'User-Agent': 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1' }; module.exports = async (ctx) => { diff --git a/lib/v2/chaoxing/qk.js b/lib/v2/chaoxing/qk.js index a55c120bdf..a3bec6fb86 100644 --- a/lib/v2/chaoxing/qk.js +++ b/lib/v2/chaoxing/qk.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/chinadegrees/province.js b/lib/v2/chinadegrees/province.js index fdb62f8011..e9370e29bc 100644 --- a/lib/v2/chinadegrees/province.js +++ b/lib/v2/chinadegrees/province.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; import puppeteer from '@/utils/puppeteer'; const baseUrl = 'http://www.chinadegrees.com.cn'; diff --git a/lib/v2/chuanliu/nice.js b/lib/v2/chuanliu/nice.js index b99601d6ee..e0a3ae3011 100644 --- a/lib/v2/chuanliu/nice.js +++ b/lib/v2/chuanliu/nice.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const md = require('markdown-it')({ html: true, }); diff --git a/lib/v2/cls/depth.js b/lib/v2/cls/depth.js index 430bf04d8f..31a1fe28a9 100644 --- a/lib/v2/cls/depth.js +++ b/lib/v2/cls/depth.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { rootUrl, getSearchParams } = require('./utils'); diff --git a/lib/v2/cls/hot.js b/lib/v2/cls/hot.js index c9c2c2807a..d0e4298422 100644 --- a/lib/v2/cls/hot.js +++ b/lib/v2/cls/hot.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { rootUrl, getSearchParams } = require('./utils'); diff --git a/lib/v2/cls/telegraph.js b/lib/v2/cls/telegraph.js index 522e7e58d8..df5c593274 100644 --- a/lib/v2/cls/telegraph.js +++ b/lib/v2/cls/telegraph.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { rootUrl, getSearchParams } = require('./utils'); diff --git a/lib/v2/cma/channel.js b/lib/v2/cma/channel.js index c3d51e3951..150f0b1452 100644 --- a/lib/v2/cma/channel.js +++ b/lib/v2/cma/channel.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { id = '380' } = ctx.params; diff --git a/lib/v2/cngal/entry.js b/lib/v2/cngal/entry.js index cad0c5c1e3..a9ca0e19bb 100644 --- a/lib/v2/cngal/entry.js +++ b/lib/v2/cngal/entry.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/v2/cngal/weekly.js b/lib/v2/cngal/weekly.js index 8dc4c5ce39..90e0af5a5e 100644 --- a/lib/v2/cngal/weekly.js +++ b/lib/v2/cngal/weekly.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; module.exports = async (ctx) => { diff --git a/lib/v2/cnjxol/index.js b/lib/v2/cnjxol/index.js index 3b96116e64..6ab3c88e82 100644 --- a/lib/v2/cnjxol/index.js +++ b/lib/v2/cnjxol/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const categories = { jxrb: '嘉兴日报', diff --git a/lib/v2/cnki/debut.js b/lib/v2/cnki/debut.js index de201b3ea6..bc1d24855d 100644 --- a/lib/v2/cnki/debut.js +++ b/lib/v2/cnki/debut.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://chn.oversea.cnki.net'; diff --git a/lib/v2/cnki/utils.js b/lib/v2/cnki/utils.js index 321be8e86c..b79ca624c7 100644 --- a/lib/v2/cnki/utils.js +++ b/lib/v2/cnki/utils.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const ProcessItem = async (item) => { const detailResponse = await got(item.link); diff --git a/lib/v2/cntheory/paper.js b/lib/v2/cntheory/paper.js index 69348fb1ee..8b42eb36be 100644 --- a/lib/v2/cntheory/paper.js +++ b/lib/v2/cntheory/paper.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/cntv/column.js b/lib/v2/cntv/column.js index d5f6ff8485..84e9655564 100644 --- a/lib/v2/cntv/column.js +++ b/lib/v2/cntv/column.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; module.exports = async (ctx) => { diff --git a/lib/v2/codeforces/contests.js b/lib/v2/codeforces/contests.js index 571a6baa57..a2585f740e 100644 --- a/lib/v2/codeforces/contests.js +++ b/lib/v2/codeforces/contests.js @@ -1,5 +1,5 @@ import got from '@/utils/got'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const dayjs = require('dayjs'); diff --git a/lib/v2/comicskingdom/index.js b/lib/v2/comicskingdom/index.js index b9cea14c69..cc76466443 100644 --- a/lib/v2/comicskingdom/index.js +++ b/lib/v2/comicskingdom/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const baseURL = 'https://comicskingdom.com'; diff --git a/lib/v2/copymanga/comic.js b/lib/v2/copymanga/comic.js index d2f3eca5b9..12a63905eb 100644 --- a/lib/v2/copymanga/comic.js +++ b/lib/v2/copymanga/comic.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; const asyncPool = require('tiny-async-pool'); diff --git a/lib/v2/creative-comic/book.js b/lib/v2/creative-comic/book.js index eae697dae3..9da8ea7b24 100644 --- a/lib/v2/creative-comic/book.js +++ b/lib/v2/creative-comic/book.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { getUuid, getBook, getChapter, getChapters, getImgEncrypted, getImgKey, decrypt, getRealKey, siteHost } = require('./utils'); module.exports = async (ctx) => { diff --git a/lib/v2/curius/links.js b/lib/v2/curius/links.js index 4c5d551ddd..c7b9995ad1 100644 --- a/lib/v2/curius/links.js +++ b/lib/v2/curius/links.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const username = ctx.req.param('name'); diff --git a/lib/v2/cztv/daily.js b/lib/v2/cztv/daily.js index 43f032325e..e55ba6d7fb 100644 --- a/lib/v2/cztv/daily.js +++ b/lib/v2/cztv/daily.js @@ -2,7 +2,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const renderDesc = (item) => art(path.join(__dirname, 'templates/daily.art'), item); diff --git a/lib/v2/cztv/zjxwlb.js b/lib/v2/cztv/zjxwlb.js index da0c7c1d6a..dc358986d3 100644 --- a/lib/v2/cztv/zjxwlb.js +++ b/lib/v2/cztv/zjxwlb.js @@ -2,7 +2,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const renderDesc = (item) => art(path.join(__dirname, 'templates/zjxwlb.art'), item); diff --git a/lib/v2/damai/activity.js b/lib/v2/damai/activity.js index c4a26e468b..4cfdf814f7 100644 --- a/lib/v2/damai/activity.js +++ b/lib/v2/damai/activity.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const city = ctx.req.param('city') === '全部' ? '' : ctx.req.param('city'); diff --git a/lib/v2/dcfever/utils.js b/lib/v2/dcfever/utils.js index 40a17839b9..8b737eb96c 100644 --- a/lib/v2/dcfever/utils.js +++ b/lib/v2/dcfever/utils.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const baseUrl = 'https://www.dcfever.com'; diff --git a/lib/v2/deadline/posts.js b/lib/v2/deadline/posts.js index e731795fc8..ac923297d6 100644 --- a/lib/v2/deadline/posts.js +++ b/lib/v2/deadline/posts.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const baseUrl = 'https://deadline.com'; diff --git a/lib/v2/dedao/knowledge.js b/lib/v2/dedao/knowledge.js index e834c9d1cb..fd3ffe2f09 100644 --- a/lib/v2/dedao/knowledge.js +++ b/lib/v2/dedao/knowledge.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const topic = ctx.req.param('topic') ?? ''; diff --git a/lib/v2/dedao/user.js b/lib/v2/dedao/user.js index e844017158..a1ffafb5be 100644 --- a/lib/v2/dedao/user.js +++ b/lib/v2/dedao/user.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const types = { 0: '动态', diff --git a/lib/v2/diershoubing/news.js b/lib/v2/diershoubing/news.js index f3083c30eb..f96453cace 100644 --- a/lib/v2/diershoubing/news.js +++ b/lib/v2/diershoubing/news.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const renderDesc = (data) => art(path.join(__dirname, 'templates/news.art'), data); module.exports = async (ctx) => { diff --git a/lib/v2/discord/channel.js b/lib/v2/discord/channel.js index 887c1ba5ec..1c653b934c 100644 --- a/lib/v2/discord/channel.js +++ b/lib/v2/discord/channel.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { baseUrl, getChannel, getChannelMessages, getGuild } = require('./discord-api'); module.exports = async (ctx) => { diff --git a/lib/v2/dlnews/category.js b/lib/v2/dlnews/category.js index 1cb2e35fdc..e3a152f228 100644 --- a/lib/v2/dlnews/category.js +++ b/lib/v2/dlnews/category.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; const { getData, getList } = require('./utils'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const asyncPool = require('tiny-async-pool'); const _website = 'dlnews'; diff --git a/lib/v2/dlsite/utils.js b/lib/v2/dlsite/utils.js index a03e63f096..5f8788fa3e 100644 --- a/lib/v2/dlsite/utils.js +++ b/lib/v2/dlsite/utils.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const dayjs = require('dayjs'); const rootUrl = 'https://www.dlsite.com'; diff --git a/lib/v2/dn/news.js b/lib/v2/dn/news.js index 8b2243c48f..7af25ce720 100644 --- a/lib/v2/dn/news.js +++ b/lib/v2/dn/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { language, category = '' } = ctx.params; diff --git a/lib/v2/douban/other/explore.js b/lib/v2/douban/other/explore.js index ea490d5c55..8057b04da9 100644 --- a/lib/v2/douban/other/explore.js +++ b/lib/v2/douban/other/explore.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const response = await got({ diff --git a/lib/v2/douban/other/list.js b/lib/v2/douban/other/list.js index b97447e7e2..7b98d14c77 100644 --- a/lib/v2/douban/other/list.js +++ b/lib/v2/douban/other/list.js @@ -1,5 +1,5 @@ import got from '@/utils/got'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { fallback, queryToInteger } from '@/utils/readable-social'; diff --git a/lib/v2/douban/other/recommended.js b/lib/v2/douban/other/recommended.js index 01c372ff08..2ee3fa5e19 100644 --- a/lib/v2/douban/other/recommended.js +++ b/lib/v2/douban/other/recommended.js @@ -1,5 +1,5 @@ import got from '@/utils/got'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { fallback, queryToInteger } from '@/utils/readable-social'; diff --git a/lib/v2/douban/other/weekly-best.js b/lib/v2/douban/other/weekly-best.js index 20071f58c3..177e2cab62 100644 --- a/lib/v2/douban/other/weekly-best.js +++ b/lib/v2/douban/other/weekly-best.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const type = ctx.req.param('type') || 'movie_weekly_best'; diff --git a/lib/v2/douyin/utils.js b/lib/v2/douyin/utils.js index 3f34f36b0c..a06ad76630 100644 --- a/lib/v2/douyin/utils.js +++ b/lib/v2/douyin/utils.js @@ -1,5 +1,5 @@ import cache from '@/utils/cache'; -const path = require('path'); +import * as path from 'node:path'; import got from '@/utils/got'; import { load } from 'cheerio'; import logger from '@/utils/logger'; diff --git a/lib/v2/douyu/group.js b/lib/v2/douyu/group.js index 5e36a77260..e2c1c82114 100644 --- a/lib/v2/douyu/group.js +++ b/lib/v2/douyu/group.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/douyu/post.js b/lib/v2/douyu/post.js index 090282fb8f..11d841a549 100644 --- a/lib/v2/douyu/post.js +++ b/lib/v2/douyu/post.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/dribbble/utils.js b/lib/v2/dribbble/utils.js index 81c5b77dd8..819ecbff89 100644 --- a/lib/v2/dribbble/utils.js +++ b/lib/v2/dribbble/utils.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; // Refactored function to load a link asynchronously async function loadContent(link) { diff --git a/lib/v2/duozhuayu/search.js b/lib/v2/duozhuayu/search.js index 57bf5c1321..e62fa21403 100644 --- a/lib/v2/duozhuayu/search.js +++ b/lib/v2/duozhuayu/search.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const aesjs = require('aes-js'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; module.exports = async (ctx) => { diff --git a/lib/v2/dushu/fuzhou/index.js b/lib/v2/dushu/fuzhou/index.js index 398c866caa..44e5667a17 100644 --- a/lib/v2/dushu/fuzhou/index.js +++ b/lib/v2/dushu/fuzhou/index.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const host = 'https://gateway-api-ipv4.dushu365.com/compose-orch/offlineActivity/v100/activity/list'; const itemLink = 'https://card.dushu.io/requirement/offline-activity/activity-detail/v/index.html'; diff --git a/lib/v2/e-hentai/index.js b/lib/v2/e-hentai/index.js index 79d122cda1..4993721719 100644 --- a/lib/v2/e-hentai/index.js +++ b/lib/v2/e-hentai/index.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/ecnu/contest.js b/lib/v2/ecnu/contest.js index 45a2ccc26a..4e33f23638 100644 --- a/lib/v2/ecnu/contest.js +++ b/lib/v2/ecnu/contest.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const category = ctx.req.param('category') ?? ''; diff --git a/lib/v2/ehentai/ehapi.js b/lib/v2/ehentai/ehapi.js index 0dbee2951f..78c55cd348 100644 --- a/lib/v2/ehentai/ehapi.js +++ b/lib/v2/ehentai/ehapi.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import logger from '@/utils/logger'; import timezone from '@/utils/timezone'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; const headers = {}; diff --git a/lib/v2/elsevier/issue.js b/lib/v2/elsevier/issue.js index 9e0710cded..f0c99f621b 100644 --- a/lib/v2/elsevier/issue.js +++ b/lib/v2/elsevier/issue.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); diff --git a/lib/v2/elsevier/journal.js b/lib/v2/elsevier/journal.js index ca20527097..5aa023ee4e 100644 --- a/lib/v2/elsevier/journal.js +++ b/lib/v2/elsevier/journal.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); diff --git a/lib/v2/epicgames/index.js b/lib/v2/epicgames/index.js index eadf65973b..142b5bb383 100644 --- a/lib/v2/epicgames/index.js +++ b/lib/v2/epicgames/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const dayjs = require('dayjs'); module.exports = async (ctx) => { diff --git a/lib/v2/eprice/rss.js b/lib/v2/eprice/rss.js index 78ca8ab45d..aa0797dcee 100644 --- a/lib/v2/eprice/rss.js +++ b/lib/v2/eprice/rss.js @@ -4,7 +4,7 @@ import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const allowRegion = new Set(['tw', 'hk']); module.exports = async (ctx) => { diff --git a/lib/v2/fansly/utils.js b/lib/v2/fansly/utils.js index 10048f8445..8db8df2e0d 100644 --- a/lib/v2/fansly/utils.js +++ b/lib/v2/fansly/utils.js @@ -1,5 +1,5 @@ import got from '@/utils/got'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const apiBaseUrl = 'https://apiv3.fansly.com'; diff --git a/lib/v2/farmatters/index.js b/lib/v2/farmatters/index.js index 4880e8ef00..d6bd85f91b 100644 --- a/lib/v2/farmatters/index.js +++ b/lib/v2/farmatters/index.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const md = require('markdown-it')({ html: true, }); diff --git a/lib/v2/fastbull/news.js b/lib/v2/fastbull/news.js index ee992e8aa4..452c00a539 100644 --- a/lib/v2/fastbull/news.js +++ b/lib/v2/fastbull/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://www.fastbull.cn'; diff --git a/lib/v2/feng/forum.js b/lib/v2/feng/forum.js index 7260bc3f92..307533f59d 100644 --- a/lib/v2/feng/forum.js +++ b/lib/v2/feng/forum.js @@ -1,7 +1,7 @@ import { parseDate } from '@/utils/parse-date'; const { baseUrl, getForumMeta, getThreads, getThread } = require('./utils'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const topicId = Number(ctx.req.param('id')); diff --git a/lib/v2/ff14/ff14-global.js b/lib/v2/ff14/ff14-global.js index b4fd67bb5a..078f560e00 100644 --- a/lib/v2/ff14/ff14-global.js +++ b/lib/v2/ff14/ff14-global.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; module.exports = async (ctx) => { diff --git a/lib/v2/ff14/ff14-zh.js b/lib/v2/ff14/ff14-zh.js index 8064649141..67d7919af0 100644 --- a/lib/v2/ff14/ff14-zh.js +++ b/lib/v2/ff14/ff14-zh.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const referer = 'https://ff.sdo.com/web8/index.html'; diff --git a/lib/v2/fffdm/manhua/manhua.js b/lib/v2/fffdm/manhua/manhua.js index dd4d41775d..78a4c23d23 100644 --- a/lib/v2/fffdm/manhua/manhua.js +++ b/lib/v2/fffdm/manhua/manhua.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; const domain = 'manhua.fffdm.com'; const host = `https://${domain}`; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const get_pic = async (url) => { diff --git a/lib/v2/fisher-spb/news.js b/lib/v2/fisher-spb/news.js index 1d236bed7d..38fc18056d 100644 --- a/lib/v2/fisher-spb/news.js +++ b/lib/v2/fisher-spb/news.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const renderVideo = (link) => art(path.join(__dirname, './templates/video.art'), { link }); diff --git a/lib/v2/focustaiwan/index.js b/lib/v2/focustaiwan/index.js index 6c7d084b73..17acb258ef 100644 --- a/lib/v2/focustaiwan/index.js +++ b/lib/v2/focustaiwan/index.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/followin/utils.js b/lib/v2/followin/utils.js index 88619dfc69..b594ca9b36 100644 --- a/lib/v2/followin/utils.js +++ b/lib/v2/followin/utils.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const apiUrl = 'https://api.followin.io'; const baseUrl = 'https://followin.io'; diff --git a/lib/v2/foresightnews/util.js b/lib/v2/foresightnews/util.js index 86ba9a6142..c172083c06 100644 --- a/lib/v2/foresightnews/util.js +++ b/lib/v2/foresightnews/util.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const zlib = require('zlib'); const constants = { diff --git a/lib/v2/fosshub/index.js b/lib/v2/fosshub/index.js index 5f366191d0..bbf6c64a6d 100644 --- a/lib/v2/fosshub/index.js +++ b/lib/v2/fosshub/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id') ?? ''; diff --git a/lib/v2/freecomputerbooks/index.js b/lib/v2/freecomputerbooks/index.js index 415e16e191..77be282e9f 100644 --- a/lib/v2/freecomputerbooks/index.js +++ b/lib/v2/freecomputerbooks/index.js @@ -1,5 +1,5 @@ import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/v2/furstar/utils.js b/lib/v2/furstar/utils.js index 9dadaec83c..0c759939cd 100644 --- a/lib/v2/furstar/utils.js +++ b/lib/v2/furstar/utils.js @@ -1,7 +1,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const base = 'https://furstar.jp'; diff --git a/lib/v2/futunn/main.js b/lib/v2/futunn/main.js index a7540071fc..3080a61eed 100644 --- a/lib/v2/futunn/main.js +++ b/lib/v2/futunn/main.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 50; diff --git a/lib/v2/gameapps/index.js b/lib/v2/gameapps/index.js index 8f5a3aa039..2d4184fb24 100644 --- a/lib/v2/gameapps/index.js +++ b/lib/v2/gameapps/index.js @@ -4,7 +4,7 @@ import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const baseUrl = 'https://www.gameapps.hk'; diff --git a/lib/v2/gcores/radio.js b/lib/v2/gcores/radio.js index a60f5b0500..5ea86daea3 100644 --- a/lib/v2/gcores/radio.js +++ b/lib/v2/gcores/radio.js @@ -3,7 +3,7 @@ import { parseDate } from '@/utils/parse-date'; import { load } from 'cheerio'; import got from '@/utils/got'; import md5 from '@/utils/md5'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const category = ctx.req.param('category') || 'all'; diff --git a/lib/v2/gelonghui/live.js b/lib/v2/gelonghui/live.js index 56ac317dcf..3a2bf59fa7 100644 --- a/lib/v2/gelonghui/live.js +++ b/lib/v2/gelonghui/live.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const baseUrl = 'https://www.gelonghui.com'; diff --git a/lib/v2/gettr/user.js b/lib/v2/gettr/user.js index 9ee7f01aa2..8087415577 100644 --- a/lib/v2/gettr/user.js +++ b/lib/v2/gettr/user.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const actionMap = { pub_pst: 'Published a post: ', diff --git a/lib/v2/github/pulse.js b/lib/v2/github/pulse.js index c47c7cbdd3..98a0d4b694 100644 --- a/lib/v2/github/pulse.js +++ b/lib/v2/github/pulse.js @@ -1,5 +1,5 @@ import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import got from '@/utils/got'; import md5 from '@/utils/md5'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/github/trending.js b/lib/v2/github/trending.js index cf2bdbc1b4..537b5bb266 100644 --- a/lib/v2/github/trending.js +++ b/lib/v2/github/trending.js @@ -2,7 +2,7 @@ import { config } from '@/config'; import got from '@/utils/got'; import { art } from '@/utils/render'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { if (!config.github || !config.github.access_token) { diff --git a/lib/v2/gitpod/blog.js b/lib/v2/gitpod/blog.js index 0da0c3f8a9..a188f68204 100644 --- a/lib/v2/gitpod/blog.js +++ b/lib/v2/gitpod/blog.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { rootUrl } = require('./utils'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 10; diff --git a/lib/v2/gofans/index.js b/lib/v2/gofans/index.js index fa1df84bdb..f002973628 100644 --- a/lib/v2/gofans/index.js +++ b/lib/v2/gofans/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { kind = '' } = ctx.params; diff --git a/lib/v2/google/fonts.js b/lib/v2/google/fonts.js index 2fd734653a..f04aadebc4 100644 --- a/lib/v2/google/fonts.js +++ b/lib/v2/google/fonts.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const titleMap = { diff --git a/lib/v2/google/news.js b/lib/v2/google/news.js index bce70484b4..4fb3c0559d 100644 --- a/lib/v2/google/news.js +++ b/lib/v2/google/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const baseUrl = 'https://news.google.com'; diff --git a/lib/v2/google/search.js b/lib/v2/google/search.js index 7922b9b2f5..f5321c77ca 100644 --- a/lib/v2/google/search.js +++ b/lib/v2/google/search.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; const renderDescription = (description, images) => art(path.join(__dirname, './templates/description.art'), { description, images }); diff --git a/lib/v2/gov/caac/cjwt.js b/lib/v2/gov/caac/cjwt.js index a8340b9b3d..97225e7a2b 100644 --- a/lib/v2/gov/caac/cjwt.js +++ b/lib/v2/gov/caac/cjwt.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category = '' } = ctx.params; diff --git a/lib/v2/gov/cmse/fxrw.js b/lib/v2/gov/cmse/fxrw.js index 1d567145fd..d9aa738ed4 100644 --- a/lib/v2/gov/cmse/fxrw.js +++ b/lib/v2/gov/cmse/fxrw.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'http://www.cmse.gov.cn'; diff --git a/lib/v2/gov/cmse/index.js b/lib/v2/gov/cmse/index.js index 9bfeae5ba7..1e09176b4a 100644 --- a/lib/v2/gov/cmse/index.js +++ b/lib/v2/gov/cmse/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { ctx.path = ctx.path.replaceAll(/(^\/cmse|\/$)/g, ''); diff --git a/lib/v2/gov/csrc/news.js b/lib/v2/gov/csrc/news.js index 0c3f46d474..70e80f170d 100644 --- a/lib/v2/gov/csrc/news.js +++ b/lib/v2/gov/csrc/news.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const baseUrl = 'http://www.csrc.gov.cn'; diff --git a/lib/v2/gov/forestry/gjlckjdjt.js b/lib/v2/gov/forestry/gjlckjdjt.js index 332fc1fa21..51379b0c88 100644 --- a/lib/v2/gov/forestry/gjlckjdjt.js +++ b/lib/v2/gov/forestry/gjlckjdjt.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category = 'gjlckjdjt' } = ctx.params; diff --git a/lib/v2/gov/general/general.js b/lib/v2/gov/general/general.js index 6867394e37..78a67be1d0 100644 --- a/lib/v2/gov/general/general.js +++ b/lib/v2/gov/general/general.js @@ -41,6 +41,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; +import { finishArticleItem } from '@/utils/wechat-mp'; const gdgov = async (info, ctx) => { const path = ctx.path.split('/').filter((item) => item !== ''); @@ -186,7 +187,6 @@ const gdgov = async (info, ctx) => { }; }); } else if (idlink.host === 'mp.weixin.qq.com') { - import { finishArticleItem } from '@/utils/wechat-mp'; return finishArticleItem({ link }); } else { return cache.tryGet(link, async () => { diff --git a/lib/v2/gov/guangdong/tqyb/sncsyjxh.js b/lib/v2/gov/guangdong/tqyb/sncsyjxh.js index 96dd6a2fd8..84028d063b 100644 --- a/lib/v2/gov/guangdong/tqyb/sncsyjxh.js +++ b/lib/v2/gov/guangdong/tqyb/sncsyjxh.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/v2/gov/guangdong/tqyb/tfxtq.js b/lib/v2/gov/guangdong/tqyb/tfxtq.js index ece011f698..b8978af2ca 100644 --- a/lib/v2/gov/guangdong/tqyb/tfxtq.js +++ b/lib/v2/gov/guangdong/tqyb/tfxtq.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const rootUrl = 'http://www.tqyb.com.cn'; diff --git a/lib/v2/gov/safe/util.js b/lib/v2/gov/safe/util.js index bafaac2405..9a217f23ce 100644 --- a/lib/v2/gov/safe/util.js +++ b/lib/v2/gov/safe/util.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://www.safe.gov.cn'; diff --git a/lib/v2/gov/samr/xgzlyhd.js b/lib/v2/gov/samr/xgzlyhd.js index f066bcd949..dbd6af1536 100644 --- a/lib/v2/gov/samr/xgzlyhd.js +++ b/lib/v2/gov/samr/xgzlyhd.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://xgzlyhd.samr.gov.cn'; const apiUrl = new URL('gjjly/message/getMessageList', rootUrl).href; diff --git a/lib/v2/gov/shanghai/rsj/ksxm.js b/lib/v2/gov/shanghai/rsj/ksxm.js index 86b105dfe8..336c56fb57 100644 --- a/lib/v2/gov/shanghai/rsj/ksxm.js +++ b/lib/v2/gov/shanghai/rsj/ksxm.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; const iconv = require('iconv-lite'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'http://www.rsj.sh.gov.cn'; diff --git a/lib/v2/gov/shanghai/wgj/wgj.js b/lib/v2/gov/shanghai/wgj/wgj.js index 8a3a62832b..7fd6fd8e6b 100644 --- a/lib/v2/gov/shanghai/wgj/wgj.js +++ b/lib/v2/gov/shanghai/wgj/wgj.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const baseUrl = 'http://wsbs.wgj.sh.gov.cn'; diff --git a/lib/v2/gov/sichuan/deyang/govpublicinfo.js b/lib/v2/gov/sichuan/deyang/govpublicinfo.js index 0f050a42fb..975dfb6f6b 100644 --- a/lib/v2/gov/sichuan/deyang/govpublicinfo.js +++ b/lib/v2/gov/sichuan/deyang/govpublicinfo.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import timezone from '@/utils/timezone'; // 各地区url信息 diff --git a/lib/v2/gov/sichuan/deyang/mztoday.js b/lib/v2/gov/sichuan/deyang/mztoday.js index de0cfaa249..e178930797 100644 --- a/lib/v2/gov/sichuan/deyang/mztoday.js +++ b/lib/v2/gov/sichuan/deyang/mztoday.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import timezone from '@/utils/timezone'; const rootUrl = 'http://www.mztoday.gov.cn'; diff --git a/lib/v2/gov/stats/index.js b/lib/v2/gov/stats/index.js index 2c3abf99bb..7ae4543814 100644 --- a/lib/v2/gov/stats/index.js +++ b/lib/v2/gov/stats/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 15; diff --git a/lib/v2/guduodata/daily.js b/lib/v2/guduodata/daily.js index a8f008e32d..5d472bf003 100644 --- a/lib/v2/guduodata/daily.js +++ b/lib/v2/guduodata/daily.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const dayjs = require('dayjs'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const host = 'http://data.guduodata.com'; diff --git a/lib/v2/gumroad/index.js b/lib/v2/gumroad/index.js index 2048e56a26..18805135a9 100644 --- a/lib/v2/gumroad/index.js +++ b/lib/v2/gumroad/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; module.exports = async (ctx) => { diff --git a/lib/v2/gzdaily/app.js b/lib/v2/gzdaily/app.js index b6ac2ebc69..bec0575c60 100644 --- a/lib/v2/gzdaily/app.js +++ b/lib/v2/gzdaily/app.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const column = ctx.req.param('column') ?? 74; diff --git a/lib/v2/hafu/utils.js b/lib/v2/hafu/utils.js index e4e94ca40e..322a1d5eb8 100644 --- a/lib/v2/hafu/utils.js +++ b/lib/v2/hafu/utils.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const typeMap = { ggtz: { url: 'https://www.hafu.edu.cn/index/ggtz.htm', root: 'https://www.hafu.edu.cn/', title: '河南财院 - 公告通知', parseFn: ggtzParse }, diff --git a/lib/v2/hashnode/blog.js b/lib/v2/hashnode/blog.js index 53234d961c..913222f5f4 100644 --- a/lib/v2/hashnode/blog.js +++ b/lib/v2/hashnode/blog.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const baseApiUrl = 'https://api.hashnode.com'; diff --git a/lib/v2/hebtv/nong-bo-shi-zai-xing-dong.js b/lib/v2/hebtv/nong-bo-shi-zai-xing-dong.js index b9b112ae45..ee34d6c6d0 100644 --- a/lib/v2/hebtv/nong-bo-shi-zai-xing-dong.js +++ b/lib/v2/hebtv/nong-bo-shi-zai-xing-dong.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const baseUrl = 'https://web.cmc.hebtv.com/cms/rmt0336/19/19js/st/ds/nmpd/nbszxd/index.shtml'; diff --git a/lib/v2/hellogithub/index.js b/lib/v2/hellogithub/index.js index 01bbf7c1f8..b3ec47a767 100644 --- a/lib/v2/hellogithub/index.js +++ b/lib/v2/hellogithub/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const sorts = { hot: '热门', diff --git a/lib/v2/hellogithub/report.js b/lib/v2/hellogithub/report.js index 287f9c3472..384b0c3f2e 100644 --- a/lib/v2/hellogithub/report.js +++ b/lib/v2/hellogithub/report.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const types = { tiobe: '编程语言', diff --git a/lib/v2/hellogithub/volume.js b/lib/v2/hellogithub/volume.js index 746480de53..7dca462a42 100644 --- a/lib/v2/hellogithub/volume.js +++ b/lib/v2/hellogithub/volume.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const md = require('markdown-it')({ html: true, }); diff --git a/lib/v2/hk01/utils.js b/lib/v2/hk01/utils.js index 9e1c4716c0..c534d54fc2 100644 --- a/lib/v2/hk01/utils.js +++ b/lib/v2/hk01/utils.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://hk01.com'; const apiRootUrl = 'https://web-data.api.hk01.com'; diff --git a/lib/v2/hkej/index.js b/lib/v2/hkej/index.js index bdb508d564..5a35944fb3 100644 --- a/lib/v2/hkej/index.js +++ b/lib/v2/hkej/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { CookieJar } = require('tough-cookie'); const cookieJar = new CookieJar(); diff --git a/lib/v2/hket/index.js b/lib/v2/hket/index.js index 36f1bee9a9..c3d32d75ec 100644 --- a/lib/v2/hket/index.js +++ b/lib/v2/hket/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const urlMap = { diff --git a/lib/v2/hostmonit/cloudflareyes.js b/lib/v2/hostmonit/cloudflareyes.js index d79bb8b898..7671f647b6 100644 --- a/lib/v2/hostmonit/cloudflareyes.js +++ b/lib/v2/hostmonit/cloudflareyes.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const lines = { CM: '中国移动', diff --git a/lib/v2/houxu/events.js b/lib/v2/houxu/events.js index 8b94b6d328..8bb3a9abd8 100644 --- a/lib/v2/houxu/events.js +++ b/lib/v2/houxu/events.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://houxu.app'; diff --git a/lib/v2/houxu/index.js b/lib/v2/houxu/index.js index b9acd1db39..b943aeba3d 100644 --- a/lib/v2/houxu/index.js +++ b/lib/v2/houxu/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://houxu.app'; diff --git a/lib/v2/houxu/memory.js b/lib/v2/houxu/memory.js index 1410f76300..59667588e7 100644 --- a/lib/v2/houxu/memory.js +++ b/lib/v2/houxu/memory.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://houxu.app'; diff --git a/lib/v2/hoyolab/news.js b/lib/v2/hoyolab/news.js index ab418875c7..d904f0ce30 100644 --- a/lib/v2/hoyolab/news.js +++ b/lib/v2/hoyolab/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import logger from '@/utils/logger'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { HOST, NEW_LIST, OFFICIAL_PAGE_TYPE, POST_FULL, LINK, PUBLIC_IMG, PRIVATE_IMG } = require('./constant'); const { getI18nGameInfo, getI18nType } = require('./utils'); diff --git a/lib/v2/hrbust/utils.js b/lib/v2/hrbust/utils.js index a9ea122d9e..fc87c0ef4d 100644 --- a/lib/v2/hrbust/utils.js +++ b/lib/v2/hrbust/utils.js @@ -1,7 +1,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/v2/hupu/all.js b/lib/v2/hupu/all.js index e29be5dc74..1295668819 100644 --- a/lib/v2/hupu/all.js +++ b/lib/v2/hupu/all.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id') ?? 'topic-daily'; diff --git a/lib/v2/hupu/bbs.js b/lib/v2/hupu/bbs.js index 40f39f081f..2027e34b83 100644 --- a/lib/v2/hupu/bbs.js +++ b/lib/v2/hupu/bbs.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id') ?? '34'; diff --git a/lib/v2/huxiu/util.js b/lib/v2/huxiu/util.js index c2a0bde903..64a370258b 100644 --- a/lib/v2/huxiu/util.js +++ b/lib/v2/huxiu/util.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const CryptoJS = require('crypto-js'); const domain = 'huxiu.com'; diff --git a/lib/v2/ianspriggs/index.js b/lib/v2/ianspriggs/index.js index 2312ce3cb9..fb9ab57318 100644 --- a/lib/v2/ianspriggs/index.js +++ b/lib/v2/ianspriggs/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category = 'portraits' } = ctx.params; diff --git a/lib/v2/ieee/earlyaccess.js b/lib/v2/ieee/earlyaccess.js index 29b2202898..498a19d9de 100644 --- a/lib/v2/ieee/earlyaccess.js +++ b/lib/v2/ieee/earlyaccess.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); diff --git a/lib/v2/ieee/journal.js b/lib/v2/ieee/journal.js index 05d4438914..914a8bd29b 100644 --- a/lib/v2/ieee/journal.js +++ b/lib/v2/ieee/journal.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); diff --git a/lib/v2/ieee/recent.js b/lib/v2/ieee/recent.js index b4daa8a6ee..be56843c1d 100644 --- a/lib/v2/ieee/recent.js +++ b/lib/v2/ieee/recent.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); diff --git a/lib/v2/ifeng/news.js b/lib/v2/ifeng/news.js index 60c008dad0..e672350360 100644 --- a/lib/v2/ifeng/news.js +++ b/lib/v2/ifeng/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20; diff --git a/lib/v2/ifeng/utils.js b/lib/v2/ifeng/utils.js index 582f6068d8..30e50f4de6 100644 --- a/lib/v2/ifeng/utils.js +++ b/lib/v2/ifeng/utils.js @@ -1,5 +1,5 @@ import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const extractDoc = (data) => data diff --git a/lib/v2/ikea/cn/utils.js b/lib/v2/ikea/cn/utils.js index 0df848373d..f3f9b7608c 100644 --- a/lib/v2/ikea/cn/utils.js +++ b/lib/v2/ikea/cn/utils.js @@ -1,6 +1,6 @@ import { art } from '@/utils/render'; import md5 from '@/utils/md5'; -const path = require('path'); +import * as path from 'node:path'; const generateRequestHeaders = () => { const now = Math.round(Date.now() / 1000); diff --git a/lib/v2/ikea/gb/new.js b/lib/v2/ikea/gb/new.js index 2ee5046558..40599d8c13 100644 --- a/lib/v2/ikea/gb/new.js +++ b/lib/v2/ikea/gb/new.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const link = 'https://www.ikea.com/gb/en/new/new-products/'; diff --git a/lib/v2/ikea/gb/offer.js b/lib/v2/ikea/gb/offer.js index e2d4dfd05d..7ffda32d41 100644 --- a/lib/v2/ikea/gb/offer.js +++ b/lib/v2/ikea/gb/offer.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const link = 'https://www.ikea.com/gb/en/offers/'; diff --git a/lib/v2/imiker/jinghua.js b/lib/v2/imiker/jinghua.js index 4a056ecb10..6ca5557861 100644 --- a/lib/v2/imiker/jinghua.js +++ b/lib/v2/imiker/jinghua.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/v2/informs/index.js b/lib/v2/informs/index.js index 2ba577b608..4994a02721 100644 --- a/lib/v2/informs/index.js +++ b/lib/v2/informs/index.js @@ -3,7 +3,7 @@ import { config } from '@/config'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://pubsonline.informs.org'; diff --git a/lib/v2/instagram/common-utils.js b/lib/v2/instagram/common-utils.js index 3cb7398f9a..5bcd0f41aa 100644 --- a/lib/v2/instagram/common-utils.js +++ b/lib/v2/instagram/common-utils.js @@ -1,6 +1,6 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const renderItems = (items) => items.map((item) => { diff --git a/lib/v2/instagram/web-api/utils.js b/lib/v2/instagram/web-api/utils.js index d1eaeb5d74..65222a652e 100644 --- a/lib/v2/instagram/web-api/utils.js +++ b/lib/v2/instagram/web-api/utils.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const baseUrl = 'https://www.instagram.com'; const COOKIE_URL = 'https://instagram.com'; diff --git a/lib/v2/iqilu/program.js b/lib/v2/iqilu/program.js index edd6590843..de372cd5a0 100644 --- a/lib/v2/iqilu/program.js +++ b/lib/v2/iqilu/program.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category = 'sdws/sdxwlb' } = ctx.params; diff --git a/lib/v2/iqiyi/album.js b/lib/v2/iqiyi/album.js index 83568ede18..5da81bcd73 100644 --- a/lib/v2/iqiyi/album.js +++ b/lib/v2/iqiyi/album.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { id } = ctx.params; diff --git a/lib/v2/iresearch/report.js b/lib/v2/iresearch/report.js index 2a3e348216..dbcf5d9a4a 100644 --- a/lib/v2/iresearch/report.js +++ b/lib/v2/iresearch/report.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/v2/iresearch/weekly.js b/lib/v2/iresearch/weekly.js index 76376a8b26..8e4c2d151e 100644 --- a/lib/v2/iresearch/weekly.js +++ b/lib/v2/iresearch/weekly.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const category = ctx.req.param('category') ?? ''; diff --git a/lib/v2/itch/devlog.js b/lib/v2/itch/devlog.js index 9cfc87fc1f..fe588c5675 100644 --- a/lib/v2/itch/devlog.js +++ b/lib/v2/itch/devlog.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; module.exports = async (ctx) => { diff --git a/lib/v2/itch/index.js b/lib/v2/itch/index.js index 0b43480bde..38963bcc15 100644 --- a/lib/v2/itch/index.js +++ b/lib/v2/itch/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://itch.io'; diff --git a/lib/v2/iwara/subscriptions.js b/lib/v2/iwara/subscriptions.js index 7fd0b2aa06..cf93ad55b7 100644 --- a/lib/v2/iwara/subscriptions.js +++ b/lib/v2/iwara/subscriptions.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; const md = require('markdown-it')({ html: true, }); diff --git a/lib/v2/ixigua/user-video.js b/lib/v2/ixigua/user-video.js index 1274076ced..35a6c5d36f 100644 --- a/lib/v2/ixigua/user-video.js +++ b/lib/v2/ixigua/user-video.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const host = 'https://www.ixigua.com'; diff --git a/lib/v2/japanpost/track.js b/lib/v2/japanpost/track.js index ad700eb1b8..c7874d3032 100644 --- a/lib/v2/japanpost/track.js +++ b/lib/v2/japanpost/track.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; const utils = require('./utils'); let baseTitle = '日本郵便'; diff --git a/lib/v2/javbus/index.js b/lib/v2/javbus/index.js index 0df69030db..8a602b7851 100644 --- a/lib/v2/javbus/index.js +++ b/lib/v2/javbus/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; const toSize = (raw) => { diff --git a/lib/v2/javlibrary/utils.js b/lib/v2/javlibrary/utils.js index e5fcb6d7f2..a1e3a010bf 100644 --- a/lib/v2/javlibrary/utils.js +++ b/lib/v2/javlibrary/utils.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://www.javlibrary.com'; diff --git a/lib/v2/jd/price.js b/lib/v2/jd/price.js index 3ef4e72b55..72c245939a 100644 --- a/lib/v2/jd/price.js +++ b/lib/v2/jd/price.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/jiemian/lists.js b/lib/v2/jiemian/lists.js index b97dd50a68..8b27ee9a9c 100644 --- a/lib/v2/jiemian/lists.js +++ b/lib/v2/jiemian/lists.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category = '' } = ctx.params; diff --git a/lib/v2/jin10/index.js b/lib/v2/jin10/index.js index 250548c940..e89fa6d857 100644 --- a/lib/v2/jin10/index.js +++ b/lib/v2/jin10/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; module.exports = async (ctx) => { diff --git a/lib/v2/jinse/catalogue.js b/lib/v2/jinse/catalogue.js index 5ed614a8e4..79944690e4 100644 --- a/lib/v2/jinse/catalogue.js +++ b/lib/v2/jinse/catalogue.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const categories = { zhengce: '政策', diff --git a/lib/v2/jinse/lives.js b/lib/v2/jinse/lives.js index a89908a2b2..7044420e68 100644 --- a/lib/v2/jinse/lives.js +++ b/lib/v2/jinse/lives.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const categories = { 0: '全部', diff --git a/lib/v2/jinse/timeline.js b/lib/v2/jinse/timeline.js index 27441e43d7..004d77c4b3 100644 --- a/lib/v2/jinse/timeline.js +++ b/lib/v2/jinse/timeline.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category = '头条' } = ctx.params; diff --git a/lib/v2/jjwxc/author.js b/lib/v2/jjwxc/author.js index d659fb00b1..ac0588a57e 100644 --- a/lib/v2/jjwxc/author.js +++ b/lib/v2/jjwxc/author.js @@ -4,7 +4,7 @@ const iconv = require('iconv-lite'); import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { id } = ctx.params; diff --git a/lib/v2/jjwxc/book.js b/lib/v2/jjwxc/book.js index 1c7f8747a9..096a99107f 100644 --- a/lib/v2/jjwxc/book.js +++ b/lib/v2/jjwxc/book.js @@ -5,7 +5,7 @@ const iconv = require('iconv-lite'); import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { id } = ctx.params; diff --git a/lib/v2/jump/discount.js b/lib/v2/jump/discount.js index 9481071cb3..d0a1e5c5bd 100644 --- a/lib/v2/jump/discount.js +++ b/lib/v2/jump/discount.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const discountUrl = 'https://switch.jumpvg.com/jump/discount/find4Discount/5/v2'; // const detailUrl = 'https://switch.jumpvg.com/jump/game/detail'; diff --git a/lib/v2/kamen-rider-official/news.js b/lib/v2/kamen-rider-official/news.js index 43d78e434d..e47ae7e192 100644 --- a/lib/v2/kamen-rider-official/news.js +++ b/lib/v2/kamen-rider-official/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category } = ctx.params; diff --git a/lib/v2/kantarworldpanel/index.js b/lib/v2/kantarworldpanel/index.js index b14f4e1126..4596062fce 100644 --- a/lib/v2/kantarworldpanel/index.js +++ b/lib/v2/kantarworldpanel/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { region = 'cn-en', category = 'news' } = ctx.params; diff --git a/lib/v2/kcna/news.js b/lib/v2/kcna/news.js index fca07d92d4..c975180752 100644 --- a/lib/v2/kcna/news.js +++ b/lib/v2/kcna/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; const asyncPool = require('tiny-async-pool'); import { art } from '@/utils/render'; const { parseJucheDate, fixDesc, fetchPhoto, fetchVideo } = require('./utils'); -const path = require('path'); +import * as path from 'node:path'; const sanitizeHtml = require('sanitize-html'); module.exports = async (ctx) => { diff --git a/lib/v2/keep/user.js b/lib/v2/keep/user.js index 448f8e9e0d..d632608ee7 100644 --- a/lib/v2/keep/user.js +++ b/lib/v2/keep/user.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/kemono/index.js b/lib/v2/kemono/index.js index 87aaaecd4b..7986d1495c 100644 --- a/lib/v2/kemono/index.js +++ b/lib/v2/kemono/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 25; diff --git a/lib/v2/kepu/live.js b/lib/v2/kepu/live.js index 8230c43faf..8abdc7337a 100644 --- a/lib/v2/kepu/live.js +++ b/lib/v2/kepu/live.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; diff --git a/lib/v2/kyodonews/index.js b/lib/v2/kyodonews/index.js index 5fda5782f8..d075ffa398 100644 --- a/lib/v2/kyodonews/index.js +++ b/lib/v2/kyodonews/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const resolveRelativeLink = (link, baseUrl) => (link.startsWith('http') ? link : `${baseUrl}${link}`); diff --git a/lib/v2/lang/room.js b/lib/v2/lang/room.js index bd7a774306..9683e0ee2b 100644 --- a/lib/v2/lang/room.js +++ b/lib/v2/lang/room.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/lanqiao/utils.js b/lib/v2/lanqiao/utils.js index 9ca3d6ed22..99966426a2 100644 --- a/lib/v2/lanqiao/utils.js +++ b/lib/v2/lanqiao/utils.js @@ -1,5 +1,5 @@ import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const courseDesc = (picurl, desc) => art(path.join(__dirname, 'templates/courseDesc.art'), { diff --git a/lib/v2/learnku/topic.js b/lib/v2/learnku/topic.js index e0578f123b..a37828a8fe 100644 --- a/lib/v2/learnku/topic.js +++ b/lib/v2/learnku/topic.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; module.exports = async (ctx) => { diff --git a/lib/v2/leetcode/dailyquestion-cn.js b/lib/v2/leetcode/dailyquestion-cn.js index d6904873d6..37e81bb65f 100644 --- a/lib/v2/leetcode/dailyquestion-cn.js +++ b/lib/v2/leetcode/dailyquestion-cn.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const host = 'https://leetcode.cn'; diff --git a/lib/v2/leetcode/dailyquestion-en.js b/lib/v2/leetcode/dailyquestion-en.js index cbfd28fcb2..3c4e86572a 100644 --- a/lib/v2/leetcode/dailyquestion-en.js +++ b/lib/v2/leetcode/dailyquestion-en.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const host = 'https://leetcode.com'; diff --git a/lib/v2/leetcode/dailyquestion-solution-en.js b/lib/v2/leetcode/dailyquestion-solution-en.js index 1795bdf9a0..206f3ee0b1 100644 --- a/lib/v2/leetcode/dailyquestion-solution-en.js +++ b/lib/v2/leetcode/dailyquestion-solution-en.js @@ -5,7 +5,7 @@ const md = require('markdown-it')({ }); import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const baseurl = `https://leetcode.com`; const url = `${baseurl}/graphql/`; diff --git a/lib/v2/lfsyd/utils.js b/lib/v2/lfsyd/utils.js index 2558870eb7..04f2cb0355 100644 --- a/lib/v2/lfsyd/utils.js +++ b/lib/v2/lfsyd/utils.js @@ -1,7 +1,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import md5 from '@/utils/md5'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const rootUrl = 'https://www.iyingdi.com'; diff --git a/lib/v2/linkedin/cn/utils.js b/lib/v2/linkedin/cn/utils.js index 2dee7495d8..f806c88e66 100644 --- a/lib/v2/linkedin/cn/utils.js +++ b/lib/v2/linkedin/cn/utils.js @@ -1,6 +1,6 @@ import cache from '@/utils/cache'; const crypto = require('crypto'); -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import got from '@/utils/got'; const { parseAttr } = require('./renderer'); diff --git a/lib/v2/lkong/forum.js b/lib/v2/lkong/forum.js index 251f86d4c7..a066f81f7c 100644 --- a/lib/v2/lkong/forum.js +++ b/lib/v2/lkong/forum.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { viewForum, viewThread } = require('./query'); diff --git a/lib/v2/lkong/thread.js b/lib/v2/lkong/thread.js index fd90fd21a0..14299837d0 100644 --- a/lib/v2/lkong/thread.js +++ b/lib/v2/lkong/thread.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { viewThread, countReplies } = require('./query'); diff --git a/lib/v2/logclub/index.js b/lib/v2/logclub/index.js index 791586e304..0221853193 100644 --- a/lib/v2/logclub/index.js +++ b/lib/v2/logclub/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category = 'news' } = ctx.params; diff --git a/lib/v2/logclub/report.js b/lib/v2/logclub/report.js index 99cfd9087b..67bd4a961a 100644 --- a/lib/v2/logclub/report.js +++ b/lib/v2/logclub/report.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { id = 'Report' } = ctx.params; diff --git a/lib/v2/logonews/index.js b/lib/v2/logonews/index.js index 9bd40ddb4e..9ac1eb90a2 100644 --- a/lib/v2/logonews/index.js +++ b/lib/v2/logonews/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const params = ctx.path; diff --git a/lib/v2/loltw/news.js b/lib/v2/loltw/news.js index 76bd235936..34eba4f220 100644 --- a/lib/v2/loltw/news.js +++ b/lib/v2/loltw/news.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const category = ctx.req.param('category') ?? ''; diff --git a/lib/v2/lovelive-anime/news.js b/lib/v2/lovelive-anime/news.js index 018b6f2904..b35e2672d8 100644 --- a/lib/v2/lovelive-anime/news.js +++ b/lib/v2/lovelive-anime/news.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const renderDescription = (desc) => art(path.join(__dirname, 'templates/description.art'), desc); diff --git a/lib/v2/lovelive-anime/schedules.js b/lib/v2/lovelive-anime/schedules.js index 3bc79cc856..526f5f7121 100644 --- a/lib/v2/lovelive-anime/schedules.js +++ b/lib/v2/lovelive-anime/schedules.js @@ -1,5 +1,5 @@ import got from '@/utils/got'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const renderDescription = (desc) => art(path.join(__dirname, 'templates/scheduleDesc.art'), desc); const dayjs = require('dayjs'); diff --git a/lib/v2/lovelive-anime/topics.js b/lib/v2/lovelive-anime/topics.js index d25c8d4ec1..91eceaebd3 100644 --- a/lib/v2/lovelive-anime/topics.js +++ b/lib/v2/lovelive-anime/topics.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; const renderDescription = (desc) => art(path.join(__dirname, 'templates/description.art'), desc); diff --git a/lib/v2/lvv2/news.js b/lib/v2/lvv2/news.js index 5e3df5eead..f4918d400f 100644 --- a/lib/v2/lvv2/news.js +++ b/lib/v2/lvv2/news.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://lvv2.com'; diff --git a/lib/v2/lvv2/top.js b/lib/v2/lvv2/top.js index f462d79b46..d926f5e0b3 100644 --- a/lib/v2/lvv2/top.js +++ b/lib/v2/lvv2/top.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://lvv2.com'; diff --git a/lib/v2/lxixsxa/discography.js b/lib/v2/lxixsxa/discography.js index aa2ed23dd4..6bc2289ac4 100644 --- a/lib/v2/lxixsxa/discography.js +++ b/lib/v2/lxixsxa/discography.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { parseJSONP } = require('./jsonp-helper'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const api = 'https://www.sonymusic.co.jp/json/v2/artist/lisa/discography/start/0/count/-1'; diff --git a/lib/v2/lxixsxa/information.js b/lib/v2/lxixsxa/information.js index 9d1e5d0b8b..278f379061 100644 --- a/lib/v2/lxixsxa/information.js +++ b/lib/v2/lxixsxa/information.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { parseJSONP } = require('./jsonp-helper'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const api = 'https://www.sonymusic.co.jp/json/v2/artist/lisa/information/start/0/count/-1'; diff --git a/lib/v2/m4/index.js b/lib/v2/m4/index.js index 34a947bf7c..290ecb2ad5 100644 --- a/lib/v2/m4/index.js +++ b/lib/v2/m4/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { id = 'news', category = 'china' } = ctx.params; diff --git a/lib/v2/magazinelib/latest-magazine.js b/lib/v2/magazinelib/latest-magazine.js index 5372286fab..4e2747588f 100644 --- a/lib/v2/magazinelib/latest-magazine.js +++ b/lib/v2/magazinelib/latest-magazine.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const host = 'https://magazinelib.com'; module.exports = async (ctx) => { diff --git a/lib/v2/manhuagui/subscribe.js b/lib/v2/manhuagui/subscribe.js index 420b9ead90..fed877ec9d 100644 --- a/lib/v2/manhuagui/subscribe.js +++ b/lib/v2/manhuagui/subscribe.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseRelativeDate } from '@/utils/parse-date'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; const web_url = 'https://www.manhuagui.com/user/book/shelf/1'; diff --git a/lib/v2/mdpi/journal.js b/lib/v2/mdpi/journal.js index 8438a56b10..9a354e46a7 100644 --- a/lib/v2/mdpi/journal.js +++ b/lib/v2/mdpi/journal.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); diff --git a/lib/v2/metacritic/index.js b/lib/v2/metacritic/index.js index 7a088a1517..e0576686d8 100644 --- a/lib/v2/metacritic/index.js +++ b/lib/v2/metacritic/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { sorts, types } = require('./util'); diff --git a/lib/v2/meteor/utils.js b/lib/v2/meteor/utils.js index a8711d0eb9..995db1c64d 100644 --- a/lib/v2/meteor/utils.js +++ b/lib/v2/meteor/utils.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const baseUrl = 'https://meteor.today'; const getBoards = (tryGet) => diff --git a/lib/v2/mihoyo/bbs/follow-list.js b/lib/v2/mihoyo/bbs/follow-list.js index 7e51238497..c1acbcf06f 100644 --- a/lib/v2/mihoyo/bbs/follow-list.js +++ b/lib/v2/mihoyo/bbs/follow-list.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const cache = require('./cache'); const renderDescription = (description, images) => art(path.join(__dirname, '../templates/description.art'), { description, images }); diff --git a/lib/v2/mihoyo/bbs/utils.js b/lib/v2/mihoyo/bbs/utils.js index 1cad74e011..ba9e42ad35 100644 --- a/lib/v2/mihoyo/bbs/utils.js +++ b/lib/v2/mihoyo/bbs/utils.js @@ -1,5 +1,5 @@ import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const renderDescription = (description, images) => art(path.join(__dirname, '../templates/description.art'), { description, images }); diff --git a/lib/v2/mihoyo/ys/news.js b/lib/v2/mihoyo/ys/news.js index f428553429..84148af757 100644 --- a/lib/v2/mihoyo/ys/news.js +++ b/lib/v2/mihoyo/ys/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const categories = { latest: { diff --git a/lib/v2/mindmeister/example.js b/lib/v2/mindmeister/example.js index 15ef4994ba..3118cd7fa9 100644 --- a/lib/v2/mindmeister/example.js +++ b/lib/v2/mindmeister/example.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const baseUrl = 'https://www.mindmeister.com'; module.exports = async (ctx) => { diff --git a/lib/v2/mingpao/index.js b/lib/v2/mingpao/index.js index 4dd2686f64..6383638a8e 100644 --- a/lib/v2/mingpao/index.js +++ b/lib/v2/mingpao/index.js @@ -4,7 +4,7 @@ import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import logger from '@/utils/logger'; const renderFanBox = (media) => diff --git a/lib/v2/missav/new.js b/lib/v2/missav/new.js index c8cdc100a5..a90c323950 100644 --- a/lib/v2/missav/new.js +++ b/lib/v2/missav/new.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const baseUrl = 'https://missav.com'; diff --git a/lib/v2/misskey/utils.js b/lib/v2/misskey/utils.js index 546febb03d..4bb0999e4b 100644 --- a/lib/v2/misskey/utils.js +++ b/lib/v2/misskey/utils.js @@ -1,6 +1,6 @@ import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; const allowSiteList = ['misskey.io', 'madost.one', 'mk.nixnet.social']; diff --git a/lib/v2/mittrchina/index.js b/lib/v2/mittrchina/index.js index 7633be77c7..7a3454b0f3 100644 --- a/lib/v2/mittrchina/index.js +++ b/lib/v2/mittrchina/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const typeMap = { diff --git a/lib/v2/modelscope/community.js b/lib/v2/modelscope/community.js index be2377cba2..66bba2758e 100644 --- a/lib/v2/modelscope/community.js +++ b/lib/v2/modelscope/community.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; import got from '@/utils/got'; -const path = require('path'); +import * as path from 'node:path'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/modelscope/datasets.js b/lib/v2/modelscope/datasets.js index 877790a2e7..ac28bed7fc 100644 --- a/lib/v2/modelscope/datasets.js +++ b/lib/v2/modelscope/datasets.js @@ -4,7 +4,7 @@ const md = require('markdown-it')({ html: true, linkify: true, }); -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/modelscope/studios.js b/lib/v2/modelscope/studios.js index 27dfbc6e6b..f2eb2cc11d 100644 --- a/lib/v2/modelscope/studios.js +++ b/lib/v2/modelscope/studios.js @@ -4,7 +4,7 @@ const md = require('markdown-it')({ html: true, linkify: true, }); -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/modrinth/versions.js b/lib/v2/modrinth/versions.js index 385fa9f146..fa14f506ec 100644 --- a/lib/v2/modrinth/versions.js +++ b/lib/v2/modrinth/versions.js @@ -1,6 +1,6 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; import got from '@/utils/got'; diff --git a/lib/v2/mydrivers/index.js b/lib/v2/mydrivers/index.js index bffbd11320..461ab1ad42 100644 --- a/lib/v2/mydrivers/index.js +++ b/lib/v2/mydrivers/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { rootUrl, title, categories, convertToQueryString, getInfo, processItems } = require('./util'); diff --git a/lib/v2/myfigurecollection/activity.js b/lib/v2/myfigurecollection/activity.js index cec493a0bb..eb24af94ea 100644 --- a/lib/v2/myfigurecollection/activity.js +++ b/lib/v2/myfigurecollection/activity.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; module.exports = async (ctx) => { diff --git a/lib/v2/myfigurecollection/index.js b/lib/v2/myfigurecollection/index.js index 92e3fd2dc3..f0e3584a14 100644 --- a/lib/v2/myfigurecollection/index.js +++ b/lib/v2/myfigurecollection/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; const shortcuts = { diff --git a/lib/v2/mymusicsheet/usersheets.js b/lib/v2/mymusicsheet/usersheets.js index b978258bf6..9940776fee 100644 --- a/lib/v2/mymusicsheet/usersheets.js +++ b/lib/v2/mymusicsheet/usersheets.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const baseUrl = 'https://www.mymusicsheet.com'; diff --git a/lib/v2/natgeo/dailyphoto.js b/lib/v2/natgeo/dailyphoto.js index c3f96aae67..999149f4fb 100644 --- a/lib/v2/natgeo/dailyphoto.js +++ b/lib/v2/natgeo/dailyphoto.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; module.exports = async (ctx) => { diff --git a/lib/v2/nationalgeographic/latest-stories.js b/lib/v2/nationalgeographic/latest-stories.js index 642cb91629..3066088f95 100644 --- a/lib/v2/nationalgeographic/latest-stories.js +++ b/lib/v2/nationalgeographic/latest-stories.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const findNatgeo = ($) => JSON.parse( diff --git a/lib/v2/nautil/topics.js b/lib/v2/nautil/topics.js index b6587fb179..cf045af096 100644 --- a/lib/v2/nautil/topics.js +++ b/lib/v2/nautil/topics.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const baseUrl = 'https://nautil.us'; module.exports = async (ctx) => { diff --git a/lib/v2/nber/index.js b/lib/v2/nber/index.js index 34f647a7f1..6bb64b4746 100644 --- a/lib/v2/nber/index.js +++ b/lib/v2/nber/index.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; diff --git a/lib/v2/ncc-cma/cmdp.js b/lib/v2/ncc-cma/cmdp.js index d6c6b040f3..2c19efb084 100644 --- a/lib/v2/ncc-cma/cmdp.js +++ b/lib/v2/ncc-cma/cmdp.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const iconv = require('iconv-lite'); module.exports = async (ctx) => { diff --git a/lib/v2/netflav/index.js b/lib/v2/netflav/index.js index 21ff740e1d..64e8cf65b0 100644 --- a/lib/v2/netflav/index.js +++ b/lib/v2/netflav/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const baseUrl = 'https://netflav.com'; diff --git a/lib/v2/news/xhsxw.js b/lib/v2/news/xhsxw.js index db81ca001d..11c34fe7be 100644 --- a/lib/v2/news/xhsxw.js +++ b/lib/v2/news/xhsxw.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 100; diff --git a/lib/v2/newzmz/util.js b/lib/v2/newzmz/util.js index ce1a0ec96e..92f10746d6 100644 --- a/lib/v2/newzmz/util.js +++ b/lib/v2/newzmz/util.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://nzmz.xyz'; diff --git a/lib/v2/nhentai/util.js b/lib/v2/nhentai/util.js index f7befcaa54..664be586e4 100644 --- a/lib/v2/nhentai/util.js +++ b/lib/v2/nhentai/util.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const baseUrl = 'https://nhentai.net'; diff --git a/lib/v2/nhk/news-web-easy.js b/lib/v2/nhk/news-web-easy.js index 5365d0908f..9e8a81a21e 100644 --- a/lib/v2/nhk/news-web-easy.js +++ b/lib/v2/nhk/news-web-easy.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { data } = await got('https://www3.nhk.or.jp/news/easy/news-list.json'); diff --git a/lib/v2/nhk/news.js b/lib/v2/nhk/news.js index 9fe1041270..9c05a9e992 100644 --- a/lib/v2/nhk/news.js +++ b/lib/v2/nhk/news.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const baseUrl = 'https://www3.nhk.or.jp'; const apiUrl = 'https://nwapi.nhk.jp'; diff --git a/lib/v2/nikkei/news.js b/lib/v2/nikkei/news.js index 14fcbb57c1..72e4491560 100644 --- a/lib/v2/nikkei/news.js +++ b/lib/v2/nikkei/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const baseUrl = 'https://www.nikkei.com'; diff --git a/lib/v2/nintendo/direct.js b/lib/v2/nintendo/direct.js index b48e1e547d..a138370170 100644 --- a/lib/v2/nintendo/direct.js +++ b/lib/v2/nintendo/direct.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const response = await got('https://www.nintendo.com/nintendo-direct/archive/'); diff --git a/lib/v2/nintendo/eshop-hk.js b/lib/v2/nintendo/eshop-hk.js index 27881f8a07..83c8cc2116 100644 --- a/lib/v2/nintendo/eshop-hk.js +++ b/lib/v2/nintendo/eshop-hk.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const response = await got('https://www.nintendo.com.hk/data/json/switch_software.json'); diff --git a/lib/v2/nintendo/eshop-jp.js b/lib/v2/nintendo/eshop-jp.js index e7b8144069..e503e6ee33 100644 --- a/lib/v2/nintendo/eshop-jp.js +++ b/lib/v2/nintendo/eshop-jp.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const response = await got('https://search.nintendo.jp/nintendo_soft/search.json', { diff --git a/lib/v2/nintendo/eshop-us.js b/lib/v2/nintendo/eshop-us.js index 84ff899194..93dab3b65c 100644 --- a/lib/v2/nintendo/eshop-us.js +++ b/lib/v2/nintendo/eshop-us.js @@ -1,6 +1,6 @@ import { art } from '@/utils/render'; import got from '@/utils/got'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const response = await got.post('https://u3b6gr4ua3-dsn.algolia.net/1/indexes/store_game_en_us_release_des/query', { diff --git a/lib/v2/nintendo/utils.js b/lib/v2/nintendo/utils.js index 7fd436e407..df18e84456 100644 --- a/lib/v2/nintendo/utils.js +++ b/lib/v2/nintendo/utils.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; const { JSDOM } = require('jsdom'); import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const dayjs = require('dayjs'); const localizedFormat = require('dayjs/plugin/localizedFormat'); require('dayjs/locale/zh-cn'); diff --git a/lib/v2/nmtv/column.js b/lib/v2/nmtv/column.js index 0beb9a1501..189215aaab 100644 --- a/lib/v2/nmtv/column.js +++ b/lib/v2/nmtv/column.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id') ?? '877'; diff --git a/lib/v2/notefolio/search.js b/lib/v2/notefolio/search.js index 25ac07eb2e..9680f39405 100644 --- a/lib/v2/notefolio/search.js +++ b/lib/v2/notefolio/search.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; // 自订的 got import { parseDate } from '@/utils/parse-date'; const dayjs = require('dayjs'); -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; // 分类 diff --git a/lib/v2/npm/package.js b/lib/v2/npm/package.js index 9111e8aca5..d99078efaa 100644 --- a/lib/v2/npm/package.js +++ b/lib/v2/npm/package.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const name = ctx.request.url.split('package/')[1]; diff --git a/lib/v2/nytimes/daily-briefing-chinese.js b/lib/v2/nytimes/daily-briefing-chinese.js index 96e1f16de0..1f4e55f0b0 100644 --- a/lib/v2/nytimes/daily-briefing-chinese.js +++ b/lib/v2/nytimes/daily-briefing-chinese.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://www.nytimes.com'; diff --git a/lib/v2/oceanengine/arithmetic-index.js b/lib/v2/oceanengine/arithmetic-index.js index fa06d9a4c0..d59a35085b 100644 --- a/lib/v2/oceanengine/arithmetic-index.js +++ b/lib/v2/oceanengine/arithmetic-index.js @@ -3,7 +3,7 @@ const dayjs = require('dayjs'); import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; import puppeteer from '@/utils/puppeteer'; diff --git a/lib/v2/oeeee/app/channel.js b/lib/v2/oeeee/app/channel.js index 58de9d8ecc..84f0cafe9d 100644 --- a/lib/v2/oeeee/app/channel.js +++ b/lib/v2/oeeee/app/channel.js @@ -4,7 +4,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; const { parseArticle } = require('../utils'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id') ?? 50; diff --git a/lib/v2/oeeee/app/reporter.js b/lib/v2/oeeee/app/reporter.js index 0dc34aaf43..07713a26e9 100644 --- a/lib/v2/oeeee/app/reporter.js +++ b/lib/v2/oeeee/app/reporter.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; const { parseArticle } = require('../utils'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id') ?? 0; diff --git a/lib/v2/oeeee/web.js b/lib/v2/oeeee/web.js index ecd4da29ef..ce75735888 100644 --- a/lib/v2/oeeee/web.js +++ b/lib/v2/oeeee/web.js @@ -4,7 +4,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; const { parseArticle } = require('./utils'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const channel = ctx.req.param('channel') ?? 0; diff --git a/lib/v2/oncc/index.js b/lib/v2/oncc/index.js index b295095c69..a8b713666b 100644 --- a/lib/v2/oncc/index.js +++ b/lib/v2/oncc/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const rootUrl = 'https://hk.on.cc'; diff --git a/lib/v2/oncc/money18.js b/lib/v2/oncc/money18.js index 6034d27a69..28a25bc8c4 100644 --- a/lib/v2/oncc/money18.js +++ b/lib/v2/oncc/money18.js @@ -5,7 +5,7 @@ const dayjs = require('dayjs'); import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const sections = { exp: '新聞總覽', diff --git a/lib/v2/onet/news.js b/lib/v2/onet/news.js index 76d75de92d..1a87966b76 100644 --- a/lib/v2/onet/news.js +++ b/lib/v2/onet/news.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { parseArticleContent, parseMainImage } = require('./utils'); module.exports = async (ctx) => { diff --git a/lib/v2/onet/utils.js b/lib/v2/onet/utils.js index 061df7b39d..144e1a7a92 100644 --- a/lib/v2/onet/utils.js +++ b/lib/v2/onet/utils.js @@ -1,5 +1,5 @@ import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const parseMainImage = ($) => { const mainImage = $('figure.mainPhoto'); diff --git a/lib/v2/openai/common.js b/lib/v2/openai/common.js index e3b38cfc75..0696798dcb 100644 --- a/lib/v2/openai/common.js +++ b/lib/v2/openai/common.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const getApiUrl = async () => { const blogRootUrl = 'https://openai.com/blog'; diff --git a/lib/v2/orcid/index.js b/lib/v2/orcid/index.js index 1655f78825..ef4ea1eb6b 100644 --- a/lib/v2/orcid/index.js +++ b/lib/v2/orcid/index.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/oreno3d/main.js b/lib/v2/oreno3d/main.js index 7afdbd12c4..aa038c2c30 100644 --- a/lib/v2/oreno3d/main.js +++ b/lib/v2/oreno3d/main.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { load } from 'cheerio'; const get_sec_page_data = require('./get-sec-page-data'); diff --git a/lib/v2/oshwhub/explore.js b/lib/v2/oshwhub/explore.js index ed249c699c..7f2803ba7f 100644 --- a/lib/v2/oshwhub/explore.js +++ b/lib/v2/oshwhub/explore.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/otobanana/utils.js b/lib/v2/otobanana/utils.js index 9a263c2149..d57134792e 100644 --- a/lib/v2/otobanana/utils.js +++ b/lib/v2/otobanana/utils.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const domain = 'otobanana.com'; const apiBase = `https://api.${domain}`; diff --git a/lib/v2/oup/index.js b/lib/v2/oup/index.js index e7db46846d..5e30597b84 100644 --- a/lib/v2/oup/index.js +++ b/lib/v2/oup/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const rootUrl = 'https://academic.oup.com'; diff --git a/lib/v2/papers/index.js b/lib/v2/papers/index.js index 17e7c96bf1..39f7f3b5c5 100644 --- a/lib/v2/papers/index.js +++ b/lib/v2/papers/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category = 'arxiv/cs.CL' } = ctx.params; diff --git a/lib/v2/patagonia/new-arrivals.js b/lib/v2/patagonia/new-arrivals.js index bf548729c5..7e627d1ffd 100644 --- a/lib/v2/patagonia/new-arrivals.js +++ b/lib/v2/patagonia/new-arrivals.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.patagonia.com'; const categoryMap = { diff --git a/lib/v2/penguin-random-house/utils.js b/lib/v2/penguin-random-house/utils.js index 4918159b54..02c259d642 100644 --- a/lib/v2/penguin-random-house/utils.js +++ b/lib/v2/penguin-random-house/utils.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const parseBookInList = (element) => { diff --git a/lib/v2/picnob/user.js b/lib/v2/picnob/user.js index 5b1f02ed36..9ad876db59 100644 --- a/lib/v2/picnob/user.js +++ b/lib/v2/picnob/user.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { puppeteerGet } = require('./utils'); import puppeteer from '@/utils/puppeteer'; diff --git a/lib/v2/picuki/profile.js b/lib/v2/picuki/profile.js index 13580e6e13..fcb18737ed 100644 --- a/lib/v2/picuki/profile.js +++ b/lib/v2/picuki/profile.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; const chrono = require('chrono-node'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; const { puppeteerGet } = require('./utils'); import puppeteer from '@/utils/puppeteer'; diff --git a/lib/v2/pikabu/utils.js b/lib/v2/pikabu/utils.js index f9379ce9db..36f94f8b27 100644 --- a/lib/v2/pikabu/utils.js +++ b/lib/v2/pikabu/utils.js @@ -1,5 +1,5 @@ import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const baseUrl = 'https://pikabu.ru'; diff --git a/lib/v2/pixabay/search.js b/lib/v2/pixabay/search.js index 73f31a4cd5..3a724d20f6 100644 --- a/lib/v2/pixabay/search.js +++ b/lib/v2/pixabay/search.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { q, order = 'latest' } = ctx.params; diff --git a/lib/v2/pnas/index.js b/lib/v2/pnas/index.js index e4cbd5b6b8..48fa17b1c6 100644 --- a/lib/v2/pnas/index.js +++ b/lib/v2/pnas/index.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { setCookies } from '@/utils/puppeteer-utils'; const { CookieJar } = require('tough-cookie'); import logger from '@/utils/logger'; diff --git a/lib/v2/pornhub/utils.js b/lib/v2/pornhub/utils.js index a7944aefd4..fa75d833db 100644 --- a/lib/v2/pornhub/utils.js +++ b/lib/v2/pornhub/utils.js @@ -1,5 +1,5 @@ import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseRelativeDate } from '@/utils/parse-date'; const dayjs = require('dayjs'); diff --git a/lib/v2/producthunt/today.js b/lib/v2/producthunt/today.js index 2ed9815776..92a5907aa2 100644 --- a/lib/v2/producthunt/today.js +++ b/lib/v2/producthunt/today.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const response = await got('https://www.producthunt.com/'); diff --git a/lib/v2/ps/monthly-games.js b/lib/v2/ps/monthly-games.js index 8b48490688..5c83a1351c 100644 --- a/lib/v2/ps/monthly-games.js +++ b/lib/v2/ps/monthly-games.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; module.exports = async (ctx) => { diff --git a/lib/v2/pts/curations.js b/lib/v2/pts/curations.js index fdb468e3a2..4e6adc974f 100644 --- a/lib/v2/pts/curations.js +++ b/lib/v2/pts/curations.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://news.pts.org.tw'; diff --git a/lib/v2/pts/index.js b/lib/v2/pts/index.js index bf8758596d..d197d614b7 100644 --- a/lib/v2/pts/index.js +++ b/lib/v2/pts/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://news.pts.org.tw'; diff --git a/lib/v2/pts/live.js b/lib/v2/pts/live.js index 0f8e242dcb..2bfe62b841 100644 --- a/lib/v2/pts/live.js +++ b/lib/v2/pts/live.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/pts/projects.js b/lib/v2/pts/projects.js index bfe3b6c087..9fb4fd1f2a 100644 --- a/lib/v2/pts/projects.js +++ b/lib/v2/pts/projects.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://news.pts.org.tw'; diff --git a/lib/v2/pubmed/trending.js b/lib/v2/pubmed/trending.js index 2b285e62a3..2efa02d0a2 100644 --- a/lib/v2/pubmed/trending.js +++ b/lib/v2/pubmed/trending.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const filters = ctx.req.param('filters'); diff --git a/lib/v2/qidian/author.js b/lib/v2/qidian/author.js index 7a96d81c3f..f15d5d333b 100644 --- a/lib/v2/qidian/author.js +++ b/lib/v2/qidian/author.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import timezone from '@/utils/timezone'; module.exports = async (ctx) => { diff --git a/lib/v2/qoo-app/apps/comment.js b/lib/v2/qoo-app/apps/comment.js index b0a851e5b6..5988db7c42 100644 --- a/lib/v2/qoo-app/apps/comment.js +++ b/lib/v2/qoo-app/apps/comment.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { appsUrl } = require('../utils'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { id, lang = '' } = ctx.params; diff --git a/lib/v2/qoo-app/notes/note.js b/lib/v2/qoo-app/notes/note.js index 8d68a71276..70d54ce6f3 100644 --- a/lib/v2/qoo-app/notes/note.js +++ b/lib/v2/qoo-app/notes/note.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const { ssoUrl, notesUrl } = require('../utils'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { id } = ctx.params; diff --git a/lib/v2/qoo-app/user/app-comment.js b/lib/v2/qoo-app/user/app-comment.js index 641c10ea3f..1e3fb1e1c7 100644 --- a/lib/v2/qoo-app/user/app-comment.js +++ b/lib/v2/qoo-app/user/app-comment.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; const { userUrl, appsUrl } = require('../utils'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { uid, lang = '' } = ctx.params; diff --git a/lib/v2/qq/ac/utils.js b/lib/v2/qq/ac/utils.js index d6ebe69786..d27c6b31d8 100644 --- a/lib/v2/qq/ac/utils.js +++ b/lib/v2/qq/ac/utils.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://ac.qq.com'; const mobileRootUrl = 'https://m.ac.qq.com'; diff --git a/lib/v2/qq/fact/index.js b/lib/v2/qq/fact/index.js index 65e3e1b326..d33189cbdf 100644 --- a/lib/v2/qq/fact/index.js +++ b/lib/v2/qq/fact/index.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import { load } from 'cheerio'; const CryptoJS = require('crypto-js'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const getRequestToken = () => { const e = 'sgn51n6r6q97o6g3'; diff --git a/lib/v2/questmobile/report.js b/lib/v2/questmobile/report.js index e62d5444c8..4164327f03 100644 --- a/lib/v2/questmobile/report.js +++ b/lib/v2/questmobile/report.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; /** * Parses a tree array and returns an array of objects containing the key-value pairs. diff --git a/lib/v2/qweather/3days.js b/lib/v2/qweather/3days.js index a902351841..37b4349f5f 100644 --- a/lib/v2/qweather/3days.js +++ b/lib/v2/qweather/3days.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; const WEATHER_API = 'https://devapi.qweather.com/v7/weather/3d'; diff --git a/lib/v2/qweather/now.js b/lib/v2/qweather/now.js index 50b39152fc..dfbb471ce9 100644 --- a/lib/v2/qweather/now.js +++ b/lib/v2/qweather/now.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; const rootUrl = 'https://devapi.qweather.com/v7/weather/now?'; diff --git a/lib/v2/radio/album.js b/lib/v2/radio/album.js index be5984f98c..b290e44781 100644 --- a/lib/v2/radio/album.js +++ b/lib/v2/radio/album.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const CryptoJS = require('crypto-js'); module.exports = async (ctx) => { diff --git a/lib/v2/radio/index.js b/lib/v2/radio/index.js index f14beb0186..57a27331df 100644 --- a/lib/v2/radio/index.js +++ b/lib/v2/radio/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/radio/zhibo.js b/lib/v2/radio/zhibo.js index 233b4529b7..b277d59977 100644 --- a/lib/v2/radio/zhibo.js +++ b/lib/v2/radio/zhibo.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const CryptoJS = require('crypto-js'); module.exports = async (ctx) => { diff --git a/lib/v2/rawkuma/manga.js b/lib/v2/rawkuma/manga.js index bc27c67094..ea643f5254 100644 --- a/lib/v2/rawkuma/manga.js +++ b/lib/v2/rawkuma/manga.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { id } = ctx.params; diff --git a/lib/v2/readhub/index.js b/lib/v2/readhub/index.js index 2215753b96..6bcadcd63c 100644 --- a/lib/v2/readhub/index.js +++ b/lib/v2/readhub/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; const { rootUrl, apiTopicUrl, art, processItems } = require('./util'); diff --git a/lib/v2/readhub/util.js b/lib/v2/readhub/util.js index afb35e63d1..ee47b5c285 100644 --- a/lib/v2/readhub/util.js +++ b/lib/v2/readhub/util.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const dayjs = require('dayjs'); const domain = 'readhub.cn'; diff --git a/lib/v2/reuters/common.js b/lib/v2/reuters/common.js index 73cc145d5f..2efa76ca1a 100644 --- a/lib/v2/reuters/common.js +++ b/lib/v2/reuters/common.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const MUST_FETCH_BY_TOPICS = new Set(['authors']); diff --git a/lib/v2/routledge/book-series.js b/lib/v2/routledge/book-series.js index b7ff342324..75b0d8a4dd 100644 --- a/lib/v2/routledge/book-series.js +++ b/lib/v2/routledge/book-series.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { bookName, bookId } = ctx.params; diff --git a/lib/v2/rsc/journal.js b/lib/v2/rsc/journal.js index a35cf7e89e..144cbf6692 100644 --- a/lib/v2/rsc/journal.js +++ b/lib/v2/rsc/journal.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { id, category = 'allrecentarticles' } = ctx.params; diff --git a/lib/v2/saraba1st/digest.js b/lib/v2/saraba1st/digest.js index 365eca5257..034a3726b9 100644 --- a/lib/v2/saraba1st/digest.js +++ b/lib/v2/saraba1st/digest.js @@ -5,7 +5,7 @@ import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const tid = ctx.req.param('tid'); diff --git a/lib/v2/science/cover.js b/lib/v2/science/cover.js index c9f67867f7..ccdcb470b1 100644 --- a/lib/v2/science/cover.js +++ b/lib/v2/science/cover.js @@ -11,7 +11,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { baseUrl } = require('./utils'); module.exports = async (ctx) => { diff --git a/lib/v2/science/utils.js b/lib/v2/science/utils.js index 620d4f4b08..743cf652a9 100644 --- a/lib/v2/science/utils.js +++ b/lib/v2/science/utils.js @@ -1,6 +1,6 @@ import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://www.science.org'; diff --git a/lib/v2/sctv/programme.js b/lib/v2/sctv/programme.js index fad60e7cdd..51971cceb5 100644 --- a/lib/v2/sctv/programme.js +++ b/lib/v2/sctv/programme.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id') ?? '1'; diff --git a/lib/v2/sensortower/blog.js b/lib/v2/sensortower/blog.js index 7256a66fde..c83e35701f 100644 --- a/lib/v2/sensortower/blog.js +++ b/lib/v2/sensortower/blog.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const language = ctx.req.param('language') ?? ''; diff --git a/lib/v2/shcstheatre/programs.js b/lib/v2/shcstheatre/programs.js index b8efcace92..c039b55dac 100644 --- a/lib/v2/shcstheatre/programs.js +++ b/lib/v2/shcstheatre/programs.js @@ -4,7 +4,7 @@ import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const url = 'https://www.shcstheatre.com/Program/programList.aspx'; diff --git a/lib/v2/shiep/index.js b/lib/v2/shiep/index.js index 655b2685d9..7efcf075a8 100644 --- a/lib/v2/shiep/index.js +++ b/lib/v2/shiep/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; const dayjs = require('dayjs'); -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; const { config } = require('./config'); diff --git a/lib/v2/shmtu/portal.js b/lib/v2/shmtu/portal.js index e3c0d5000f..6b5efde719 100644 --- a/lib/v2/shmtu/portal.js +++ b/lib/v2/shmtu/portal.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const bootstrapHost = 'https://weixin.shmtu.edu.cn/dynamic/shmtuHttps'; diff --git a/lib/v2/shoac/recent-show.js b/lib/v2/shoac/recent-show.js index d72ea4e766..6908a1f52b 100644 --- a/lib/v2/shoac/recent-show.js +++ b/lib/v2/shoac/recent-show.js @@ -1,6 +1,6 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/shuiguopai/index.js b/lib/v2/shuiguopai/index.js index d98b22bfb5..66696ee973 100644 --- a/lib/v2/shuiguopai/index.js +++ b/lib/v2/shuiguopai/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://sgptv.vip'; diff --git a/lib/v2/simpleinfo/index.js b/lib/v2/simpleinfo/index.js index 167b5cafbb..8d276160db 100644 --- a/lib/v2/simpleinfo/index.js +++ b/lib/v2/simpleinfo/index.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import timezone from '@/utils/timezone'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/sina/utils.js b/lib/v2/sina/utils.js index dc95adac66..4cab47b66c 100644 --- a/lib/v2/sina/utils.js +++ b/lib/v2/sina/utils.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const getRollNewsList = (pageid, lid, limit) => got('https://feed.mix.sina.com.cn/api/roll/get', { diff --git a/lib/v2/sinchew/index.js b/lib/v2/sinchew/index.js index 51ee41444e..2543bacef1 100644 --- a/lib/v2/sinchew/index.js +++ b/lib/v2/sinchew/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://www.sinchew.com.my'; diff --git a/lib/v2/sjtu/tongqu/activity.js b/lib/v2/sjtu/tongqu/activity.js index 31ffe5445c..6522fa2df6 100644 --- a/lib/v2/sjtu/tongqu/activity.js +++ b/lib/v2/sjtu/tongqu/activity.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const urlRoot = 'https://tongqu.sjtu.edu.cn'; diff --git a/lib/v2/snowpeak/us-new-arrivals.js b/lib/v2/snowpeak/us-new-arrivals.js index 50e772085e..c45f1f1ebf 100644 --- a/lib/v2/snowpeak/us-new-arrivals.js +++ b/lib/v2/snowpeak/us-new-arrivals.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.snowpeak.com'; module.exports = async (ctx) => { diff --git a/lib/v2/sogou/search.js b/lib/v2/sogou/search.js index 10cb1998bb..ed6fb0ba02 100644 --- a/lib/v2/sogou/search.js +++ b/lib/v2/sogou/search.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; diff --git a/lib/v2/sohu/mp.js b/lib/v2/sohu/mp.js index 2fc8c886b4..324f643a8c 100644 --- a/lib/v2/sohu/mp.js +++ b/lib/v2/sohu/mp.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; module.exports = async (ctx) => { diff --git a/lib/v2/southcn/nfapp/column.js b/lib/v2/southcn/nfapp/column.js index dc637854e5..e3bea43ec2 100644 --- a/lib/v2/southcn/nfapp/column.js +++ b/lib/v2/southcn/nfapp/column.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { parseArticle } = require('./utils'); module.exports = async (ctx) => { diff --git a/lib/v2/southcn/nfapp/reporter.js b/lib/v2/southcn/nfapp/reporter.js index 9faf3bd2e7..90486ec1b0 100644 --- a/lib/v2/southcn/nfapp/reporter.js +++ b/lib/v2/southcn/nfapp/reporter.js @@ -4,7 +4,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; const { parseArticle } = require('./utils'); -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const reporterId = ctx.req.param('reporter'); diff --git a/lib/v2/springer/journal.js b/lib/v2/springer/journal.js index 8c541349b1..ba5b4fd1f9 100644 --- a/lib/v2/springer/journal.js +++ b/lib/v2/springer/journal.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const { CookieJar } = require('tough-cookie'); diff --git a/lib/v2/sse/inquire.js b/lib/v2/sse/inquire.js index 63c2375eb9..28d2ca9a2d 100644 --- a/lib/v2/sse/inquire.js +++ b/lib/v2/sse/inquire.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const refererUrl = 'https://www.sse.com.cn/disclosure/credibility/supervision/inquiries/'; diff --git a/lib/v2/sse/renewal.js b/lib/v2/sse/renewal.js index 4f309a5226..7e0777f666 100644 --- a/lib/v2/sse/renewal.js +++ b/lib/v2/sse/renewal.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const dayjs = require('dayjs'); const localizedFormat = require('dayjs/plugin/localizedFormat'); require('dayjs/locale/zh-cn'); diff --git a/lib/v2/ssm/news.js b/lib/v2/ssm/news.js index df9fb953de..2e5e170677 100644 --- a/lib/v2/ssm/news.js +++ b/lib/v2/ssm/news.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const rootUrl = `https://www.ssm.gov.mo`; diff --git a/lib/v2/stdaily/digitalpaper.js b/lib/v2/stdaily/digitalpaper.js index f2fc25c39b..530c2a4e90 100644 --- a/lib/v2/stdaily/digitalpaper.js +++ b/lib/v2/stdaily/digitalpaper.js @@ -1,4 +1,4 @@ -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/v2/storyfm/episodes.js b/lib/v2/storyfm/episodes.js index a6b1c93d3c..617fbc60ac 100644 --- a/lib/v2/storyfm/episodes.js +++ b/lib/v2/storyfm/episodes.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://storyfm.cn'; diff --git a/lib/v2/surfshark/blog.js b/lib/v2/surfshark/blog.js index ed65890255..4d8513c199 100644 --- a/lib/v2/surfshark/blog.js +++ b/lib/v2/surfshark/blog.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category } = ctx.params; diff --git a/lib/v2/swjtu/utils.js b/lib/v2/swjtu/utils.js index 82b69eab97..221de88770 100644 --- a/lib/v2/swjtu/utils.js +++ b/lib/v2/swjtu/utils.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; const renderDetail = (jobs) => art(path.join(__dirname, 'templates/job_detail.art'), { jobs }); const renderDesc = (intro) => diff --git a/lib/v2/szse/inquire.js b/lib/v2/szse/inquire.js index dccf72520f..fb45c47e30 100644 --- a/lib/v2/szse/inquire.js +++ b/lib/v2/szse/inquire.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const category = ctx.req.param('category') ?? '0'; diff --git a/lib/v2/szse/projectdynamic.js b/lib/v2/szse/projectdynamic.js index 77c57e6805..3a561238be 100644 --- a/lib/v2/szse/projectdynamic.js +++ b/lib/v2/szse/projectdynamic.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const typeMap = { diff --git a/lib/v2/taobao/zhongchou.js b/lib/v2/taobao/zhongchou.js index 2c7398f1ec..d2509892f0 100644 --- a/lib/v2/taobao/zhongchou.js +++ b/lib/v2/taobao/zhongchou.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { type = 'all' } = ctx.params; diff --git a/lib/v2/taptap/utils.js b/lib/v2/taptap/utils.js index 4c9e25bc9d..7818cb6ac5 100644 --- a/lib/v2/taptap/utils.js +++ b/lib/v2/taptap/utils.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; // Please do not change %26 to & diff --git a/lib/v2/telegram/channel.js b/lib/v2/telegram/channel.js index 2fd1e5cc7e..ef2c55cd2c 100644 --- a/lib/v2/telegram/channel.js +++ b/lib/v2/telegram/channel.js @@ -4,7 +4,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const querystring = require('querystring'); import { fallback, queryToBoolean } from '@/utils/readable-social'; diff --git a/lib/v2/tencent/news/author.js b/lib/v2/tencent/news/author.js index f48e6f4781..f462518536 100644 --- a/lib/v2/tencent/news/author.js +++ b/lib/v2/tencent/news/author.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const mid = ctx.req.param('mid'); diff --git a/lib/v2/tencent/news/coronavirus/data.js b/lib/v2/tencent/news/coronavirus/data.js index b91359b7c9..a9ecb2f392 100644 --- a/lib/v2/tencent/news/coronavirus/data.js +++ b/lib/v2/tencent/news/coronavirus/data.js @@ -1,7 +1,7 @@ const { getData } = require('./utils'); import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const province = ctx.req.param('province') || ''; diff --git a/lib/v2/tencent/news/coronavirus/total.js b/lib/v2/tencent/news/coronavirus/total.js index 908ecd2fd1..07d1ff3e36 100644 --- a/lib/v2/tencent/news/coronavirus/total.js +++ b/lib/v2/tencent/news/coronavirus/total.js @@ -1,7 +1,7 @@ const { getData } = require('./utils'); import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const title = '腾讯新闻 - 新型冠状病毒肺炎疫情实时追踪'; diff --git a/lib/v2/tesla/cx.js b/lib/v2/tesla/cx.js index 853a361c6d..8cf1cd602d 100644 --- a/lib/v2/tesla/cx.js +++ b/lib/v2/tesla/cx.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category, city } = ctx.params; diff --git a/lib/v2/tfc-taiwan/utils.js b/lib/v2/tfc-taiwan/utils.js index a30d7cfc11..abe76de5ae 100644 --- a/lib/v2/tfc-taiwan/utils.js +++ b/lib/v2/tfc-taiwan/utils.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const asyncPool = require('tiny-async-pool'); import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/theatlantic/utils.js b/lib/v2/theatlantic/utils.js index cef49a78fd..15a689667e 100644 --- a/lib/v2/theatlantic/utils.js +++ b/lib/v2/theatlantic/utils.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import randUserAgent from '@/utils/rand-user-agent'; const UA = randUserAgent({ browser: 'chrome', os: 'android', device: 'mobile' }); diff --git a/lib/v2/themoviedb/utils.js b/lib/v2/themoviedb/utils.js index 1604bcac22..5119d3695a 100644 --- a/lib/v2/themoviedb/utils.js +++ b/lib/v2/themoviedb/utils.js @@ -1,4 +1,4 @@ -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/thenewslens/index.js b/lib/v2/thenewslens/index.js index 894669afc2..b90cbafbf4 100644 --- a/lib/v2/thenewslens/index.js +++ b/lib/v2/thenewslens/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'https://www.thenewslens.com'; diff --git a/lib/v2/thepaper/factpaper.js b/lib/v2/thepaper/factpaper.js index df0e916981..1f768f7a06 100644 --- a/lib/v2/thepaper/factpaper.js +++ b/lib/v2/thepaper/factpaper.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const status = Number.parseInt(ctx.req.param('status') ?? '1'); diff --git a/lib/v2/thepaper/utils.js b/lib/v2/thepaper/utils.js index b489fadfce..fb1c9f53bf 100644 --- a/lib/v2/thepaper/utils.js +++ b/lib/v2/thepaper/utils.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const defaultRssItem = (item) => ({ title: item.name, diff --git a/lib/v2/thoughtco/index.js b/lib/v2/thoughtco/index.js index c468decf98..beb2d67b40 100644 --- a/lib/v2/thoughtco/index.js +++ b/lib/v2/thoughtco/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category = '' } = ctx.params; diff --git a/lib/v2/tiktok/user.js b/lib/v2/tiktok/user.js index b2d80478fd..ac840ab900 100644 --- a/lib/v2/tiktok/user.js +++ b/lib/v2/tiktok/user.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { queryToBoolean } from '@/utils/readable-social'; import puppeteer from '@/utils/puppeteer'; diff --git a/lib/v2/tingshuitz/shenzhen.js b/lib/v2/tingshuitz/shenzhen.js index 03561f6883..288b350a0e 100644 --- a/lib/v2/tingshuitz/shenzhen.js +++ b/lib/v2/tingshuitz/shenzhen.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const url = 'https://szgk.sz-water.com.cn/api/wechat/op/getStopWaterNotice'; diff --git a/lib/v2/tingtingfm/program.js b/lib/v2/tingtingfm/program.js index 5dcca5bade..2a529656c2 100644 --- a/lib/v2/tingtingfm/program.js +++ b/lib/v2/tingtingfm/program.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const { getClientVal, sign } = require('./utils'); diff --git a/lib/v2/tophub/list.js b/lib/v2/tophub/list.js index 39096af8fc..48b291ef4d 100644 --- a/lib/v2/tophub/list.js +++ b/lib/v2/tophub/list.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { config } from '@/config'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; module.exports = async (ctx) => { diff --git a/lib/v2/tradingview/blog.js b/lib/v2/tradingview/blog.js index de806dffa7..726a71c754 100644 --- a/lib/v2/tradingview/blog.js +++ b/lib/v2/tradingview/blog.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; const asyncPool = require('tiny-async-pool'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category = 'en' } = ctx.params; diff --git a/lib/v2/transcriptforest/index.js b/lib/v2/transcriptforest/index.js index b1a5f76ec8..6d4dc4c420 100644 --- a/lib/v2/transcriptforest/index.js +++ b/lib/v2/transcriptforest/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const bakeTimestamp = (seconds) => { const hours = Math.floor(seconds / 3600); diff --git a/lib/v2/trending/all-trending.js b/lib/v2/trending/all-trending.js index 639e6abd8e..594776e124 100644 --- a/lib/v2/trending/all-trending.js +++ b/lib/v2/trending/all-trending.js @@ -3,7 +3,7 @@ dayjs.extend(require('dayjs/plugin/utc')); dayjs.extend(require('dayjs/plugin/timezone')); import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; import md5 from '@/utils/md5'; diff --git a/lib/v2/tribalfootball/latest.js b/lib/v2/tribalfootball/latest.js index b23162fb69..e6b198c729 100644 --- a/lib/v2/tribalfootball/latest.js +++ b/lib/v2/tribalfootball/latest.js @@ -1,7 +1,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/v2/tvb/news.js b/lib/v2/tvb/news.js index 4b8228cff4..67b8da0734 100644 --- a/lib/v2/tvb/news.js +++ b/lib/v2/tvb/news.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const titles = { focus: { diff --git a/lib/v2/txrjy/fornumtopic.js b/lib/v2/txrjy/fornumtopic.js index 892c73c2d1..4df506b097 100644 --- a/lib/v2/txrjy/fornumtopic.js +++ b/lib/v2/txrjy/fornumtopic.js @@ -5,7 +5,7 @@ const iconv = require('iconv-lite'); import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://www.txrjy.com'; diff --git a/lib/v2/udn/breaking-news.js b/lib/v2/udn/breaking-news.js index 493640d16a..f125c4a177 100644 --- a/lib/v2/udn/breaking-news.js +++ b/lib/v2/udn/breaking-news.js @@ -4,7 +4,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const id = ctx.req.param('id'); diff --git a/lib/v2/uptimerobot/rss.js b/lib/v2/uptimerobot/rss.js index a1e223bee3..509381db9c 100644 --- a/lib/v2/uptimerobot/rss.js +++ b/lib/v2/uptimerobot/rss.js @@ -1,6 +1,6 @@ const Parser = require('rss-parser'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const dayjs = require('dayjs'); import { fallback, queryToBoolean } from '@/utils/readable-social'; diff --git a/lib/v2/urbandictionary/random.js b/lib/v2/urbandictionary/random.js index 34ca8da93e..2bb6d8f675 100644 --- a/lib/v2/urbandictionary/random.js +++ b/lib/v2/urbandictionary/random.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const baseUrl = 'https://www.urbandictionary.com'; diff --git a/lib/v2/utgd/category.js b/lib/v2/utgd/category.js index cfab4f3e4e..bb0bf22c3e 100644 --- a/lib/v2/utgd/category.js +++ b/lib/v2/utgd/category.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const md = require('markdown-it')({ html: true, }); diff --git a/lib/v2/utgd/timeline.js b/lib/v2/utgd/timeline.js index e64fe21fd0..c6704c03b1 100644 --- a/lib/v2/utgd/timeline.js +++ b/lib/v2/utgd/timeline.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const md = require('markdown-it')({ html: true, }); diff --git a/lib/v2/utgd/topic.js b/lib/v2/utgd/topic.js index a7e2152049..d30fc7f2e6 100644 --- a/lib/v2/utgd/topic.js +++ b/lib/v2/utgd/topic.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const md = require('markdown-it')({ html: true, }); diff --git a/lib/v2/vcb-s/category.js b/lib/v2/vcb-s/category.js index e7b26335f9..efd87f27eb 100644 --- a/lib/v2/vcb-s/category.js +++ b/lib/v2/vcb-s/category.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://vcb-s.com'; const cateAPIUrl = `${rootUrl}/wp-json/wp/v2/categories`; diff --git a/lib/v2/vcb-s/index.js b/lib/v2/vcb-s/index.js index bc223b81b1..f064a8fc03 100644 --- a/lib/v2/vcb-s/index.js +++ b/lib/v2/vcb-s/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://vcb-s.com'; const postsAPIUrl = `${rootUrl}/wp-json/wp/v2/posts`; diff --git a/lib/v2/vimeo/category.js b/lib/v2/vimeo/category.js index d5e2d5ab43..b12ad82481 100644 --- a/lib/v2/vimeo/category.js +++ b/lib/v2/vimeo/category.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category, staffpicks } = ctx.params; diff --git a/lib/v2/vimeo/channel.js b/lib/v2/vimeo/channel.js index 5b4c4ca282..62f952d293 100644 --- a/lib/v2/vimeo/channel.js +++ b/lib/v2/vimeo/channel.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const channel = ctx.req.param('channel'); diff --git a/lib/v2/vimeo/usr-videos.js b/lib/v2/vimeo/usr-videos.js index c7d3442051..6b00894ab9 100644 --- a/lib/v2/vimeo/usr-videos.js +++ b/lib/v2/vimeo/usr-videos.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const tokenresponse = await got({ diff --git a/lib/v2/wallpaperhub/index.js b/lib/v2/wallpaperhub/index.js index ef32ac2e79..8ec52c04e9 100644 --- a/lib/v2/wallpaperhub/index.js +++ b/lib/v2/wallpaperhub/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const link = 'https://wallpaperhub.app/api/v1/wallpapers/?limit=20&page=&query=&width=&height=&tags='; diff --git a/lib/v2/wallstreetcn/live.js b/lib/v2/wallstreetcn/live.js index 31fdd5d091..5b75d92ff0 100644 --- a/lib/v2/wallstreetcn/live.js +++ b/lib/v2/wallstreetcn/live.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const titles = { global: '要闻', diff --git a/lib/v2/warthunder/news.js b/lib/v2/warthunder/news.js index 64a16d881a..88b8bed7d5 100644 --- a/lib/v2/warthunder/news.js +++ b/lib/v2/warthunder/news.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/v2/weibo/search/hot.js b/lib/v2/weibo/search/hot.js index d7f239ac01..a12a3d1a75 100644 --- a/lib/v2/weibo/search/hot.js +++ b/lib/v2/weibo/search/hot.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; import { load } from 'cheerio'; -const path = require('path'); +import * as path from 'node:path'; // const weiboUtils = require('../utils'); // Default hide all picture diff --git a/lib/v2/whu/news.js b/lib/v2/whu/news.js index 1403e7ed1d..73aee31641 100644 --- a/lib/v2/whu/news.js +++ b/lib/v2/whu/news.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { domain, processMeta, getMeta, processItems } = require('./util'); diff --git a/lib/v2/whu/util.js b/lib/v2/whu/util.js index 64e66ff181..592d3694ff 100644 --- a/lib/v2/whu/util.js +++ b/lib/v2/whu/util.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const domain = 'whu.edu.cn'; diff --git a/lib/v2/winstall/update.js b/lib/v2/winstall/update.js index 6d0fc13364..8d7bb2a039 100644 --- a/lib/v2/winstall/update.js +++ b/lib/v2/winstall/update.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { config } from '@/config'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const baseUrl = 'https://winstall.app'; diff --git a/lib/v2/wise/pair.js b/lib/v2/wise/pair.js index ef4722d6c8..23abb19ad9 100644 --- a/lib/v2/wise/pair.js +++ b/lib/v2/wise/pair.js @@ -5,7 +5,7 @@ const dayjs = require('dayjs'); const customParseFormat = require('dayjs/plugin/customParseFormat'); dayjs.extend(customParseFormat); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const renderDesc = (content) => art(path.join(__dirname, 'templates/description.art'), content); module.exports = async (ctx) => { diff --git a/lib/v2/wmc-bj/publish.js b/lib/v2/wmc-bj/publish.js index 4ae2bc1ce1..576369b1b3 100644 --- a/lib/v2/wmc-bj/publish.js +++ b/lib/v2/wmc-bj/publish.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const { category = 'CRA-Reanalysis/2m-Temperature/6-hour/index.html' } = ctx.params; diff --git a/lib/v2/wnacg/index.js b/lib/v2/wnacg/index.js index d65ad6c99f..8e761ebdaf 100644 --- a/lib/v2/wnacg/index.js +++ b/lib/v2/wnacg/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const categories = { 1: '同人誌 漢化', diff --git a/lib/v2/wsj/utils.js b/lib/v2/wsj/utils.js index 5a73fcd95d..b89a37b8d7 100644 --- a/lib/v2/wsj/utils.js +++ b/lib/v2/wsj/utils.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import randUserAgent from '@/utils/rand-user-agent'; const UA = randUserAgent({ browser: 'chrome', os: 'android', device: 'mobile' }); diff --git a/lib/v2/x-mol/news.js b/lib/v2/x-mol/news.js index 2409ec000d..3948a409fe 100644 --- a/lib/v2/x-mol/news.js +++ b/lib/v2/x-mol/news.js @@ -5,7 +5,7 @@ const utils = require('./utils'); import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const tag = ctx.req.param('tag'); diff --git a/lib/v2/xiaomiyoupin/crowdfunding.js b/lib/v2/xiaomiyoupin/crowdfunding.js index da4ad24cc7..08ebbe3c26 100644 --- a/lib/v2/xiaomiyoupin/crowdfunding.js +++ b/lib/v2/xiaomiyoupin/crowdfunding.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const base_url = 'https://m.xiaomiyoupin.com'; module.exports = async (ctx) => { diff --git a/lib/v2/xiaomiyoupin/utils.js b/lib/v2/xiaomiyoupin/utils.js index a7e517031b..1f7d683e01 100644 --- a/lib/v2/xiaomiyoupin/utils.js +++ b/lib/v2/xiaomiyoupin/utils.js @@ -1,5 +1,5 @@ import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const parseModule = (floors, module_key) => floors.find((floor) => floor.module_key === module_key); diff --git a/lib/v2/xinpianchang/util.js b/lib/v2/xinpianchang/util.js index 188c379f73..f4177abe8f 100644 --- a/lib/v2/xinpianchang/util.js +++ b/lib/v2/xinpianchang/util.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const appKey = '61a2f329348b3bf77'; diff --git a/lib/v2/xjtu/job.js b/lib/v2/xjtu/job.js index 6986124202..155248e1b1 100644 --- a/lib/v2/xjtu/job.js +++ b/lib/v2/xjtu/job.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const baseUrl = 'https://job.xjtu.edu.cn'; diff --git a/lib/v2/xjtu/std.js b/lib/v2/xjtu/std.js index b9fac6b27f..9f4047faaf 100644 --- a/lib/v2/xjtu/std.js +++ b/lib/v2/xjtu/std.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const category = ctx.req.param('category') ?? ''; diff --git a/lib/v2/xkb/index.js b/lib/v2/xkb/index.js index f483debd07..b85975f443 100644 --- a/lib/v2/xkb/index.js +++ b/lib/v2/xkb/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const channel = ctx.req.param('channel') ?? 350; diff --git a/lib/v2/xueqiu/stock-comments.js b/lib/v2/xueqiu/stock-comments.js index abe481fbd5..4fe3960b00 100644 --- a/lib/v2/xueqiu/stock-comments.js +++ b/lib/v2/xueqiu/stock-comments.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const sanitizeHtml = require('sanitize-html'); diff --git a/lib/v2/xys/new.js b/lib/v2/xys/new.js index afb3790c80..affc1d214b 100644 --- a/lib/v2/xys/new.js +++ b/lib/v2/xys/new.js @@ -2,7 +2,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; const iconv = require('iconv-lite'); -const path = require('path'); +import * as path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/v2/xyzrank/index.js b/lib/v2/xyzrank/index.js index 0ccb94ed29..37c69a1c16 100644 --- a/lib/v2/xyzrank/index.js +++ b/lib/v2/xyzrank/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const category = ctx.req.param('category') ?? ''; diff --git a/lib/v2/yahoo/news/tw/utils.js b/lib/v2/yahoo/news/tw/utils.js index e6523c9a45..655df88307 100644 --- a/lib/v2/yahoo/news/tw/utils.js +++ b/lib/v2/yahoo/news/tw/utils.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -const path = require('path'); +import * as path from 'node:path'; import { art } from '@/utils/render'; const getArchive = async (region, limit, tag, providerId) => { diff --git a/lib/v2/ycwb/index.js b/lib/v2/ycwb/index.js index 8f781f6c90..7fe2b115e8 100644 --- a/lib/v2/ycwb/index.js +++ b/lib/v2/ycwb/index.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const node = ctx.req.param('node') ?? 1; diff --git a/lib/v2/yicai/dt.js b/lib/v2/yicai/dt.js index c33381dd80..2be8a948e1 100644 --- a/lib/v2/yicai/dt.js +++ b/lib/v2/yicai/dt.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const columns = { article: 2, diff --git a/lib/v2/yicai/utils.js b/lib/v2/yicai/utils.js index fe3da052d8..a386542018 100644 --- a/lib/v2/yicai/utils.js +++ b/lib/v2/yicai/utils.js @@ -3,7 +3,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://www.yicai.com'; diff --git a/lib/v2/ymgal/game.js b/lib/v2/ymgal/game.js index 822868cb00..13a3d21eec 100644 --- a/lib/v2/ymgal/game.js +++ b/lib/v2/ymgal/game.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.ymgal.games'; diff --git a/lib/v2/yoasobi-music/info.js b/lib/v2/yoasobi-music/info.js index fd85f04e96..24e2717145 100644 --- a/lib/v2/yoasobi-music/info.js +++ b/lib/v2/yoasobi-music/info.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { parseJSONP } = require('./jsonp-helper'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const category = ctx.req.param('category'); diff --git a/lib/v2/yoasobi-music/live.js b/lib/v2/yoasobi-music/live.js index aeb9e00c75..9827308626 100644 --- a/lib/v2/yoasobi-music/live.js +++ b/lib/v2/yoasobi-music/live.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { parseJSONP } = require('./jsonp-helper'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const ARTIST = 'YOASOBI', diff --git a/lib/v2/yoasobi-music/media.js b/lib/v2/yoasobi-music/media.js index 474c4fc530..080f889c9f 100644 --- a/lib/v2/yoasobi-music/media.js +++ b/lib/v2/yoasobi-music/media.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; const { parseJSONP } = require('./jsonp-helper'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const ARTIST = 'YOASOBI', diff --git a/lib/v2/youku/channel.js b/lib/v2/youku/channel.js index f68fd283b2..50233b393c 100644 --- a/lib/v2/youku/channel.js +++ b/lib/v2/youku/channel.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const channelId = ctx.req.param('channelId'); diff --git a/lib/v2/youtube/community.js b/lib/v2/youtube/community.js index 44dc366ffe..ff64af1b7e 100644 --- a/lib/v2/youtube/community.js +++ b/lib/v2/youtube/community.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { isYouTubeChannelId } = require('./utils'); module.exports = async (ctx) => { diff --git a/lib/v2/youtube/utils.js b/lib/v2/youtube/utils.js index bbeda71f42..0864c1b8d0 100644 --- a/lib/v2/youtube/utils.js +++ b/lib/v2/youtube/utils.js @@ -1,7 +1,7 @@ const { google } = require('googleapis'); const { OAuth2 } = google.auth; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { config } from '@/config'; let count = 0; diff --git a/lib/v2/yxdzqb/index.js b/lib/v2/yxdzqb/index.js index c30cda0fee..d84328d9ab 100644 --- a/lib/v2/yxdzqb/index.js +++ b/lib/v2/yxdzqb/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const host = 'https://www.yxdzqb.com'; diff --git a/lib/v2/zagg/new-arrivals.js b/lib/v2/zagg/new-arrivals.js index b607dc3793..bfb672effb 100644 --- a/lib/v2/zagg/new-arrivals.js +++ b/lib/v2/zagg/new-arrivals.js @@ -1,6 +1,6 @@ import got from '@/utils/got'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.zagg.com/en_us'; module.exports = async (ctx) => { diff --git a/lib/v2/zaobao/util.js b/lib/v2/zaobao/util.js index c14f2f3050..dd20a2619e 100644 --- a/lib/v2/zaobao/util.js +++ b/lib/v2/zaobao/util.js @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const { base32 } = require('rfc4648'); const baseUrl = 'https://www.zaobao.com'; diff --git a/lib/v2/zcool/discover.js b/lib/v2/zcool/discover.js index d016c06a96..5c7d0b6da8 100644 --- a/lib/v2/zcool/discover.js +++ b/lib/v2/zcool/discover.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const locations = require('./locations'); module.exports = async (ctx) => { diff --git a/lib/v2/zcool/utils.js b/lib/v2/zcool/utils.js index 4dc1f08a5b..ea3301503e 100644 --- a/lib/v2/zcool/utils.js +++ b/lib/v2/zcool/utils.js @@ -1,5 +1,5 @@ import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const extractArticle = (data) => data.props.pageProps.data.summary + data.props.pageProps.data.memo; diff --git a/lib/v2/zhangyoubao/index.js b/lib/v2/zhangyoubao/index.js index 3552a87781..c517d8994d 100644 --- a/lib/v2/zhangyoubao/index.js +++ b/lib/v2/zhangyoubao/index.js @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const category = ctx.req.param('category'); diff --git a/lib/v2/zhitongcaijing/index.js b/lib/v2/zhitongcaijing/index.js index 93fae33a46..250c517b49 100644 --- a/lib/v2/zhitongcaijing/index.js +++ b/lib/v2/zhitongcaijing/index.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const ids = { recommend: { diff --git a/lib/v2/zhiy/post.js b/lib/v2/zhiy/post.js index 39cdf1a16b..2ea2ddec8c 100644 --- a/lib/v2/zhiy/post.js +++ b/lib/v2/zhiy/post.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; const { baseUrl, fetchUserDate } = require('./utils'); import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const dayjs = require('dayjs'); module.exports = async (ctx) => { diff --git a/lib/v2/zhubai/top20.js b/lib/v2/zhubai/top20.js index bec737d8bd..a91173110e 100644 --- a/lib/v2/zhubai/top20.js +++ b/lib/v2/zhubai/top20.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const parseContent = (content) => art(path.join(__dirname, 'templates/description.art'), { diff --git a/lib/v2/zodgame/forum.js b/lib/v2/zodgame/forum.js index 49bd7a5483..1163120880 100644 --- a/lib/v2/zodgame/forum.js +++ b/lib/v2/zodgame/forum.js @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; const rootUrl = 'https://zodgame.xyz'; diff --git a/lib/v2/zuvio/utils.js b/lib/v2/zuvio/utils.js index 44d24886f3..a1edbc6877 100644 --- a/lib/v2/zuvio/utils.js +++ b/lib/v2/zuvio/utils.js @@ -1,5 +1,5 @@ import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; import got from '@/utils/got'; const token = diff --git a/lib/v2/zyshow/index.js b/lib/v2/zyshow/index.js index 51c93e1c71..70401dcbd8 100644 --- a/lib/v2/zyshow/index.js +++ b/lib/v2/zyshow/index.js @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -const path = require('path'); +import * as path from 'node:path'; module.exports = async (ctx) => { const rootUrl = 'http://www.zyshow.net';