From 0893debb07d775186351dd9ff74a73b2c597ba50 Mon Sep 17 00:00:00 2001 From: Tony Date: Thu, 4 Apr 2024 20:28:45 +0800 Subject: [PATCH 1/6] style(eslint): lint tsx (#15098) --- .puppeteerrc.cjs | 4 +- lib/middleware/template.tsx | 4 -- lib/registry.ts | 2 +- lib/routes/005/index.ts | 2 +- lib/routes/12306/index.ts | 2 +- lib/routes/141jav/index.ts | 2 +- lib/routes/141ppv/index.ts | 2 +- lib/routes/163/ds.ts | 2 +- lib/routes/163/exclusive.ts | 2 +- lib/routes/163/music/artist-songs.ts | 2 +- lib/routes/163/music/artist.ts | 2 +- lib/routes/163/music/djradio.ts | 2 +- lib/routes/163/music/playlist.ts | 2 +- lib/routes/163/music/userevents.ts | 2 +- lib/routes/163/music/userplaylist.ts | 2 +- lib/routes/163/music/userplayrecords.ts | 2 +- lib/routes/163/open/vip.ts | 2 +- lib/routes/163/utils.ts | 2 +- lib/routes/18comic/utils.ts | 2 +- lib/routes/1point3acres/offer.ts | 2 +- lib/routes/1point3acres/utils.ts | 2 +- lib/routes/1x/index.ts | 2 +- lib/routes/2048/index.ts | 2 +- lib/routes/3kns/index.ts | 2 +- lib/routes/4gamers/utils.ts | 2 +- lib/routes/4ksj/forum.ts | 2 +- lib/routes/500px/tribe-set.ts | 2 +- lib/routes/500px/user.ts | 2 +- lib/routes/56kog/util.ts | 2 +- lib/routes/591/list.ts | 2 +- lib/routes/78dm/index.ts | 2 +- lib/routes/7mmtv/index.ts | 2 +- lib/routes/8264/list.ts | 2 +- lib/routes/91porn/author.ts | 2 +- lib/routes/91porn/index.ts | 2 +- lib/routes/95mm/utils.ts | 2 +- lib/routes/abc/index.ts | 2 +- lib/routes/acs/journal.ts | 2 +- lib/routes/aeaweb/index.ts | 2 +- lib/routes/aeon/utils.ts | 2 +- lib/routes/aicaijing/index.ts | 2 +- lib/routes/aip/journal-pupp.ts | 3 +- lib/routes/aip/utils.ts | 2 +- lib/routes/aljazeera/index.ts | 2 +- lib/routes/amazon/kindle-software-updates.ts | 2 +- lib/routes/anquanke/vul.ts | 4 +- lib/routes/app-center/release.ts | 2 +- lib/routes/appstorrent/programs.ts | 2 +- lib/routes/aqara/post.ts | 2 +- lib/routes/arcteryx/new-arrivals.ts | 2 +- lib/routes/arcteryx/outlet.ts | 2 +- lib/routes/arcteryx/regear-new-arrivals.ts | 2 +- lib/routes/artstation/user.ts | 2 +- lib/routes/asiantolick/index.ts | 2 +- lib/routes/asus/bios.ts | 2 +- lib/routes/baidu/gushitong/index.ts | 2 +- lib/routes/baidu/search.ts | 2 +- lib/routes/baidu/tieba/forum.ts | 2 +- lib/routes/baidu/tieba/post.ts | 2 +- lib/routes/baidu/tieba/search.ts | 2 +- lib/routes/baidu/top.ts | 2 +- lib/routes/bandcamp/weekly.ts | 2 +- lib/routes/bangumi/online/online.ts | 2 +- lib/routes/bangumi/tv/calendar/_base.ts | 3 +- lib/routes/bangumi/tv/calendar/today.ts | 2 +- lib/routes/bangumi/tv/subject/comments.ts | 3 +- lib/routes/bangumi/tv/subject/ep.ts | 5 ++- .../bangumi/tv/subject/offcial-subject-api.ts | 3 +- lib/routes/baozimh/index.ts | 2 +- lib/routes/bdys/index.ts | 2 +- lib/routes/bgmlist/onair.ts | 2 +- lib/routes/bloomberg/utils.ts | 2 +- lib/routes/booru/mmda.ts | 2 +- lib/routes/bsky/posts.ts | 2 +- lib/routes/btzj/index.ts | 2 +- lib/routes/caai/utils.ts | 2 +- lib/routes/caareviews/utils.ts | 2 +- lib/routes/cahkms/index.ts | 2 +- lib/routes/caixin/database.ts | 2 +- lib/routes/caixin/latest.ts | 2 +- lib/routes/caixin/utils.ts | 2 +- lib/routes/cankaoxiaoxi/index.ts | 2 +- lib/routes/cartoonmad/comic.ts | 2 +- lib/routes/cbaigui/index.ts | 2 +- lib/routes/ccf/ccfcv/index.ts | 2 +- lib/routes/ccf/tfbd/utils.ts | 2 +- lib/routes/cctv/utils/mzzlbg.ts | 3 +- lib/routes/cctv/utils/news.ts | 5 ++- lib/routes/cctv/utils/xinwen1j1.ts | 3 +- lib/routes/cde/xxgk.ts | 2 +- lib/routes/cdzjryb/project-list.ts | 2 +- lib/routes/cebbank/all.ts | 2 +- lib/routes/cebbank/history.ts | 2 +- lib/routes/chaincatcher/home.ts | 2 +- lib/routes/changba/user.ts | 2 +- lib/routes/chaoxing/qk.ts | 2 +- lib/routes/chinadegrees/province.ts | 2 +- lib/routes/chuanliu/nice.ts | 2 +- lib/routes/cls/depth.ts | 2 +- lib/routes/cls/hot.ts | 2 +- lib/routes/cls/telegraph.ts | 2 +- lib/routes/cma/channel.ts | 2 +- lib/routes/cngal/entry.ts | 2 +- lib/routes/cngal/weekly.ts | 2 +- lib/routes/cnjxol/index.ts | 2 +- lib/routes/cnki/debut.ts | 2 +- lib/routes/cnki/utils.ts | 2 +- lib/routes/cntheory/paper.ts | 2 +- lib/routes/cntv/column.ts | 2 +- lib/routes/codeforces/contests.ts | 2 +- lib/routes/comicskingdom/index.ts | 2 +- lib/routes/coomer/utils.ts | 3 +- lib/routes/copymanga/comic.ts | 2 +- lib/routes/creative-comic/book.ts | 2 +- lib/routes/curius/links.ts | 2 +- lib/routes/cztv/daily.ts | 2 +- lib/routes/cztv/zjxwlb.ts | 2 +- lib/routes/damai/activity.ts | 2 +- lib/routes/dcfever/utils.ts | 2 +- lib/routes/deadline/posts.ts | 2 +- lib/routes/dedao/knowledge.ts | 2 +- lib/routes/dedao/user.ts | 2 +- lib/routes/diershoubing/news.ts | 2 +- lib/routes/discord/channel.ts | 2 +- lib/routes/dlnews/category.ts | 2 +- lib/routes/dlsite/utils.ts | 2 +- lib/routes/dn/news.ts | 2 +- lib/routes/douban/other/explore.ts | 2 +- lib/routes/douban/other/list.ts | 2 +- lib/routes/douban/other/recommended.ts | 2 +- lib/routes/douban/other/weekly-best.ts | 2 +- lib/routes/douyin/utils.ts | 2 +- lib/routes/douyu/group.ts | 2 +- lib/routes/douyu/post.ts | 2 +- lib/routes/dribbble/utils.ts | 2 +- lib/routes/duozhuayu/search.ts | 2 +- lib/routes/dushu/fuzhou/index.ts | 2 +- lib/routes/e-hentai/index.ts | 2 +- lib/routes/ecnu/contest.ts | 2 +- lib/routes/ehentai/ehapi.ts | 2 +- lib/routes/elsevier/issue.ts | 2 +- lib/routes/elsevier/journal.ts | 2 +- lib/routes/epicgames/index.ts | 2 +- lib/routes/eprice/rss.ts | 2 +- lib/routes/fansly/utils.ts | 2 +- lib/routes/fanxinzhui/index.ts | 2 +- lib/routes/farmatters/index.ts | 2 +- lib/routes/fastbull/news.ts | 2 +- lib/routes/feng/forum.ts | 2 +- lib/routes/ff14/ff14-global.ts | 2 +- lib/routes/ff14/ff14-zh.ts | 2 +- lib/routes/fffdm/manhua/manhua.ts | 2 +- lib/routes/fisher-spb/news.ts | 2 +- lib/routes/focustaiwan/index.ts | 2 +- lib/routes/followin/utils.ts | 2 +- lib/routes/foresightnews/util.ts | 2 +- lib/routes/fosshub/index.ts | 2 +- lib/routes/freecomputerbooks/index.ts | 2 +- lib/routes/furstar/utils.ts | 2 +- lib/routes/futunn/main.ts | 2 +- lib/routes/gameapps/index.ts | 2 +- lib/routes/gcores/radio.ts | 2 +- lib/routes/gelonghui/live.ts | 2 +- lib/routes/gettr/user.ts | 2 +- lib/routes/github/pulse.ts | 2 +- lib/routes/github/trending.ts | 2 +- lib/routes/gitpod/blog.ts | 2 +- lib/routes/gofans/index.ts | 2 +- lib/routes/google/fonts.ts | 2 +- lib/routes/google/news.ts | 2 +- lib/routes/google/search.ts | 2 +- lib/routes/gov/caac/cjwt.ts | 2 +- lib/routes/gov/cmse/fxrw.ts | 2 +- lib/routes/gov/csrc/news.ts | 2 +- lib/routes/gov/forestry/gjlckjdjt.ts | 2 +- lib/routes/gov/guangdong/tqyb/sncsyjxh.ts | 2 +- lib/routes/gov/guangdong/tqyb/tfxtq.ts | 2 +- lib/routes/gov/safe/util.ts | 2 +- lib/routes/gov/samr/xgzlyhd.ts | 2 +- lib/routes/gov/shanghai/rsj/ksxm.ts | 2 +- lib/routes/gov/shanghai/wgj/wgj.ts | 2 +- .../gov/sichuan/deyang/govpublicinfo.ts | 2 +- lib/routes/gov/sichuan/deyang/mztoday.ts | 2 +- lib/routes/gov/stats/index.ts | 2 +- lib/routes/guduodata/daily.ts | 2 +- lib/routes/gumroad/index.ts | 2 +- lib/routes/gzdaily/app.ts | 2 +- lib/routes/hafu/utils.ts | 5 ++- lib/routes/hashnode/blog.ts | 2 +- lib/routes/hebtv/nong-bo-shi-zai-xing-dong.ts | 2 +- lib/routes/hellogithub/index.ts | 2 +- lib/routes/hellogithub/report.ts | 2 +- lib/routes/hellogithub/volume.ts | 2 +- lib/routes/hk01/utils.ts | 2 +- lib/routes/hkej/index.ts | 2 +- lib/routes/hket/index.ts | 2 +- lib/routes/hostmonit/cloudflareyes.ts | 2 +- lib/routes/houxu/events.ts | 2 +- lib/routes/houxu/index.ts | 2 +- lib/routes/houxu/memory.ts | 2 +- lib/routes/hoyolab/news.ts | 2 +- lib/routes/hrbust/utils.ts | 2 +- lib/routes/hupu/all.ts | 2 +- lib/routes/hupu/bbs.ts | 2 +- lib/routes/huxiu/util.ts | 2 +- lib/routes/ianspriggs/index.ts | 2 +- lib/routes/idaily/index.ts | 2 +- lib/routes/ieee/earlyaccess.ts | 2 +- lib/routes/ieee/journal.ts | 2 +- lib/routes/ieee/recent.ts | 2 +- lib/routes/ifeng/news.ts | 2 +- lib/routes/ifeng/utils.ts | 2 +- lib/routes/ikea/cn/utils.ts | 2 +- lib/routes/ikea/gb/new.ts | 2 +- lib/routes/ikea/gb/offer.ts | 2 +- lib/routes/imiker/jinghua.ts | 2 +- lib/routes/informs/index.ts | 2 +- lib/routes/instagram/common-utils.ts | 2 +- lib/routes/instagram/web-api/utils.ts | 2 +- lib/routes/iqilu/program.ts | 2 +- lib/routes/iqiyi/album.ts | 2 +- lib/routes/iresearch/report.ts | 2 +- lib/routes/iresearch/weekly.ts | 2 +- lib/routes/itch/devlog.ts | 2 +- lib/routes/itch/index.ts | 2 +- lib/routes/iwara/subscriptions.ts | 2 +- lib/routes/ixigua/user-video.ts | 2 +- lib/routes/japanpost/track.ts | 2 +- lib/routes/javbus/index.ts | 2 +- lib/routes/javlibrary/utils.ts | 2 +- lib/routes/jd/price.ts | 2 +- lib/routes/jiemian/lists.ts | 2 +- lib/routes/jin10/index.ts | 2 +- lib/routes/jinse/catalogue.ts | 2 +- lib/routes/jinse/lives.ts | 2 +- lib/routes/jinse/timeline.ts | 2 +- lib/routes/jjwxc/author.ts | 2 +- lib/routes/jjwxc/book.ts | 2 +- lib/routes/jpxgmn/utils.ts | 2 +- lib/routes/jump/discount.ts | 2 +- lib/routes/kamen-rider-official/news.ts | 2 +- lib/routes/kantarworldpanel/index.ts | 2 +- lib/routes/kcna/news.ts | 2 +- lib/routes/keep/user.ts | 2 +- lib/routes/kemono/index.ts | 2 +- lib/routes/kepu/live.ts | 2 +- lib/routes/kyodonews/index.ts | 2 +- lib/routes/lang/room.ts | 2 +- lib/routes/lanqiao/utils.ts | 2 +- lib/routes/learnku/topic.ts | 2 +- lib/routes/leetcode/dailyquestion-cn.ts | 2 +- lib/routes/leetcode/dailyquestion-en.ts | 2 +- .../leetcode/dailyquestion-solution-en.ts | 2 +- lib/routes/lfsyd/utils.ts | 2 +- lib/routes/linkedin/cn/utils.ts | 2 +- lib/routes/lkong/forum.ts | 2 +- lib/routes/lkong/thread.ts | 2 +- lib/routes/logclub/index.ts | 2 +- lib/routes/logclub/report.ts | 2 +- lib/routes/logonews/index.ts | 2 +- lib/routes/loltw/news.ts | 2 +- lib/routes/lovelive-anime/news.ts | 2 +- lib/routes/lovelive-anime/schedules.ts | 2 +- lib/routes/lovelive-anime/topics.ts | 2 +- lib/routes/lvv2/news.ts | 2 +- lib/routes/lvv2/top.ts | 2 +- lib/routes/lxixsxa/discography.ts | 2 +- lib/routes/lxixsxa/information.ts | 2 +- lib/routes/m4/index.ts | 2 +- lib/routes/magazinelib/latest-magazine.ts | 2 +- lib/routes/manhuagui/subscribe.ts | 2 +- lib/routes/mdpi/journal.ts | 2 +- lib/routes/medium/parse-article.ts | 2 +- lib/routes/metacritic/index.ts | 2 +- lib/routes/metacritic/release.ts | 3 +- lib/routes/meteor/utils.ts | 2 +- lib/routes/mihoyo/bbs/follow-list.ts | 2 +- lib/routes/mihoyo/bbs/utils.ts | 2 +- lib/routes/mihoyo/ys/news.ts | 2 +- lib/routes/mindmeister/example.ts | 2 +- lib/routes/mingpao/index.ts | 2 +- lib/routes/missav/new.ts | 2 +- lib/routes/misskey/utils.ts | 2 +- lib/routes/mittrchina/index.ts | 2 +- lib/routes/modelscope/community.ts | 2 +- lib/routes/modelscope/datasets.ts | 2 +- lib/routes/modelscope/studios.ts | 2 +- lib/routes/modrinth/versions.ts | 2 +- lib/routes/mydrivers/index.ts | 2 +- lib/routes/myfigurecollection/activity.ts | 2 +- lib/routes/myfigurecollection/index.ts | 2 +- lib/routes/mymusicsheet/usersheets.ts | 2 +- lib/routes/natgeo/dailyphoto.ts | 2 +- .../nationalgeographic/latest-stories.ts | 2 +- lib/routes/nautil/topics.ts | 2 +- lib/routes/nber/index.ts | 2 +- lib/routes/ncc-cma/cmdp.ts | 2 +- lib/routes/netflav/index.ts | 2 +- lib/routes/news/xhsxw.ts | 2 +- lib/routes/newzmz/util.ts | 2 +- lib/routes/nhentai/util.ts | 2 +- lib/routes/nhk/news-web-easy.ts | 2 +- lib/routes/nhk/news.ts | 2 +- lib/routes/nikkei/news.ts | 2 +- lib/routes/nintendo/direct.ts | 2 +- lib/routes/nintendo/eshop-hk.ts | 2 +- lib/routes/nintendo/eshop-jp.ts | 2 +- lib/routes/nintendo/eshop-us.ts | 2 +- lib/routes/nintendo/utils.ts | 2 +- lib/routes/nlc/read.ts | 2 +- lib/routes/nmtv/column.ts | 2 +- lib/routes/notefolio/search.ts | 2 +- lib/routes/npm/package.ts | 2 +- lib/routes/nytimes/daily-briefing-chinese.ts | 2 +- lib/routes/oceanengine/arithmetic-index.ts | 4 +- lib/routes/oeeee/app/channel.ts | 2 +- lib/routes/oeeee/app/reporter.ts | 2 +- lib/routes/oeeee/web.ts | 2 +- lib/routes/oncc/index.ts | 2 +- lib/routes/oncc/money18.ts | 2 +- lib/routes/onet/news.ts | 2 +- lib/routes/onet/utils.ts | 2 +- lib/routes/openai/common.ts | 2 +- lib/routes/orcid/index.ts | 2 +- lib/routes/oreno3d/main.ts | 2 +- lib/routes/oshwhub/explore.ts | 2 +- lib/routes/otobanana/utils.ts | 2 +- lib/routes/oup/index.ts | 2 +- lib/routes/papers/index.ts | 2 +- lib/routes/patagonia/new-arrivals.ts | 2 +- lib/routes/penguin-random-house/utils.ts | 2 +- lib/routes/picnob/user.ts | 2 +- lib/routes/picuki/profile.ts | 2 +- lib/routes/pikabu/utils.ts | 2 +- lib/routes/pixabay/search.ts | 2 +- lib/routes/pnas/index.ts | 2 +- lib/routes/pornhub/utils.ts | 2 +- lib/routes/producthunt/today.ts | 2 +- lib/routes/ps/monthly-games.ts | 2 +- lib/routes/pts/curations.ts | 2 +- lib/routes/pts/index.ts | 2 +- lib/routes/pts/live.ts | 2 +- lib/routes/pts/projects.ts | 2 +- lib/routes/pubmed/trending.ts | 2 +- lib/routes/qidian/author.ts | 2 +- lib/routes/qoo-app/apps/comment.ts | 2 +- lib/routes/qoo-app/notes/note.ts | 2 +- lib/routes/qoo-app/user/app-comment.ts | 2 +- lib/routes/qq/ac/utils.ts | 2 +- lib/routes/qq/fact/index.ts | 2 +- lib/routes/questmobile/report.ts | 2 +- lib/routes/qweather/3days.ts | 2 +- lib/routes/qweather/now.ts | 2 +- lib/routes/radio/album.ts | 2 +- lib/routes/radio/index.ts | 2 +- lib/routes/radio/zhibo.ts | 2 +- lib/routes/rawkuma/manga.ts | 2 +- lib/routes/readhub/index.ts | 2 +- lib/routes/readhub/util.ts | 2 +- lib/routes/reuters/common.ts | 2 +- lib/routes/routledge/book-series.ts | 2 +- lib/routes/rsc/journal.ts | 2 +- lib/routes/ruancan/utils.ts | 3 +- lib/routes/saraba1st/digest.ts | 2 +- lib/routes/science/cover.ts | 2 +- lib/routes/science/utils.ts | 2 +- lib/routes/sctv/programme.ts | 2 +- lib/routes/sdu/extractor/index.ts | 3 +- lib/routes/sdu/extractor/sdrj.ts | 3 +- lib/routes/sdu/extractor/view.ts | 3 +- lib/routes/sdu/extractor/wh/jwc.ts | 3 +- lib/routes/sdu/extractor/wh/news.ts | 3 +- lib/routes/sensortower/blog.ts | 2 +- lib/routes/shcstheatre/programs.ts | 2 +- lib/routes/shiep/index.ts | 2 +- lib/routes/shmtu/portal.ts | 2 +- lib/routes/shoac/recent-show.ts | 2 +- lib/routes/shuiguopai/index.ts | 2 +- lib/routes/simpleinfo/index.ts | 2 +- lib/routes/sina/utils.ts | 2 +- lib/routes/sinchew/index.ts | 2 +- lib/routes/sjtu/seiee/utils.ts | 2 +- lib/routes/sjtu/tongqu/activity.ts | 2 +- lib/routes/snowpeak/us-new-arrivals.ts | 2 +- lib/routes/sobooks/utils.ts | 3 +- lib/routes/sogou/search.ts | 2 +- lib/routes/sohu/mp.ts | 2 +- lib/routes/southcn/nfapp/column.ts | 2 +- lib/routes/southcn/nfapp/reporter.ts | 2 +- lib/routes/springer/journal.ts | 2 +- lib/routes/sse/inquire.ts | 2 +- lib/routes/sse/renewal.ts | 2 +- lib/routes/ssm/news.ts | 2 +- lib/routes/stdaily/digitalpaper.ts | 2 +- lib/routes/storyfm/episodes.ts | 2 +- lib/routes/surfshark/blog.ts | 2 +- lib/routes/swjtu/utils.ts | 2 +- lib/routes/szse/inquire.ts | 2 +- lib/routes/szse/projectdynamic.ts | 2 +- lib/routes/taobao/zhongchou.ts | 2 +- lib/routes/taptap/utils.ts | 2 +- lib/routes/telegram/channel.ts | 2 +- lib/routes/tencent/news/author.ts | 2 +- lib/routes/tencent/news/coronavirus/data.ts | 2 +- lib/routes/tencent/news/coronavirus/total.ts | 2 +- lib/routes/tesla/cx.ts | 2 +- lib/routes/tfc-taiwan/utils.ts | 2 +- lib/routes/theatlantic/utils.ts | 2 +- lib/routes/themoviedb/api-key.ts | 3 +- lib/routes/themoviedb/utils.ts | 2 +- lib/routes/thenewslens/index.ts | 2 +- lib/routes/thepaper/factpaper.ts | 2 +- lib/routes/thepaper/utils.ts | 2 +- lib/routes/thoughtco/index.ts | 2 +- lib/routes/tiktok/user.ts | 2 +- lib/routes/tingshuitz/shenzhen.ts | 2 +- lib/routes/tingtingfm/program.ts | 2 +- lib/routes/tophub/list.ts | 2 +- lib/routes/tradingview/blog.ts | 2 +- lib/routes/transcriptforest/index.ts | 2 +- lib/routes/trending/all-trending.ts | 2 +- lib/routes/tribalfootball/latest.ts | 2 +- lib/routes/tvb/news.ts | 2 +- lib/routes/tvtropes/featured.ts | 2 +- .../twitter/api/developer-api/search.ts | 3 +- lib/routes/twitter/api/developer-api/user.ts | 3 +- lib/routes/twreporter/fetch-article.ts | 2 +- lib/routes/txrjy/fornumtopic.ts | 2 +- lib/routes/udn/breaking-news.ts | 2 +- lib/routes/uptimerobot/rss.ts | 2 +- lib/routes/urbandictionary/random.ts | 2 +- lib/routes/utgd/category.ts | 2 +- lib/routes/utgd/timeline.ts | 2 +- lib/routes/utgd/topic.ts | 2 +- lib/routes/vcb-s/category.ts | 2 +- lib/routes/vcb-s/index.ts | 2 +- lib/routes/vimeo/category.ts | 2 +- lib/routes/vimeo/channel.ts | 2 +- lib/routes/vimeo/usr-videos.ts | 2 +- lib/routes/wallpaperhub/index.ts | 2 +- lib/routes/wallstreetcn/live.ts | 2 +- lib/routes/warthunder/news.ts | 2 +- lib/routes/wechat/feeddd.ts | 15 ++++--- lib/routes/wechat/feeds.ts | 23 ---------- lib/routes/wechat/wxnmh.ts | 45 ------------------- lib/routes/weibo/search/hot.ts | 2 +- lib/routes/whu/news.ts | 2 +- lib/routes/whu/util.ts | 2 +- lib/routes/winstall/update.ts | 2 +- lib/routes/wise/pair.ts | 2 +- lib/routes/wmc-bj/publish.ts | 2 +- lib/routes/wnacg/index.ts | 2 +- lib/routes/wsj/utils.ts | 2 +- lib/routes/x-mol/news.ts | 2 +- lib/routes/xiaomiyoupin/crowdfunding.ts | 2 +- lib/routes/xiaomiyoupin/utils.ts | 2 +- lib/routes/xinpianchang/util.ts | 2 +- lib/routes/xjtu/job.ts | 2 +- lib/routes/xjtu/std.ts | 2 +- lib/routes/xkb/index.ts | 2 +- lib/routes/xueqiu/stock-comments.ts | 2 +- lib/routes/xys/new.ts | 2 +- lib/routes/xyzrank/index.ts | 2 +- lib/routes/yahoo/news/tw/utils.ts | 2 +- lib/routes/ycwb/index.ts | 2 +- lib/routes/yicai/dt.ts | 2 +- lib/routes/yicai/utils.ts | 2 +- lib/routes/ymgal/game.ts | 2 +- lib/routes/yoasobi-music/info.ts | 2 +- lib/routes/yoasobi-music/live.ts | 2 +- lib/routes/yoasobi-music/media.ts | 2 +- lib/routes/youku/channel.ts | 2 +- lib/routes/youtube/community.ts | 2 +- lib/routes/youtube/utils.ts | 2 +- lib/routes/yxdzqb/index.ts | 2 +- lib/routes/zagg/new-arrivals.ts | 2 +- lib/routes/zaobao/util.ts | 2 +- lib/routes/zcool/discover.ts | 2 +- lib/routes/zcool/utils.ts | 2 +- lib/routes/zhitongcaijing/index.ts | 2 +- lib/routes/zhiy/post.ts | 2 +- lib/routes/zhubai/top20.ts | 2 +- lib/routes/zodgame/forum.ts | 2 +- lib/routes/zuvio/utils.ts | 2 +- lib/routes/zyshow/index.ts | 2 +- lib/utils/helpers.ts | 2 +- lib/utils/logger.ts | 2 +- lib/utils/rand-user-agent.ts | 3 +- lib/utils/timezone.ts | 2 +- package.json | 6 +-- scripts/workflow/build-docs.ts | 2 +- scripts/workflow/build-routes.ts | 2 +- 492 files changed, 527 insertions(+), 574 deletions(-) delete mode 100644 lib/routes/wechat/feeds.ts delete mode 100644 lib/routes/wechat/wxnmh.ts diff --git a/.puppeteerrc.cjs b/.puppeteerrc.cjs index 06843b6b1575cc..a4e6d37234ef19 100644 --- a/.puppeteerrc.cjs +++ b/.puppeteerrc.cjs @@ -1,9 +1,9 @@ -const { join } = require('path'); +const path = require('path'); /** * @type {import("puppeteer").Configuration} */ module.exports = { // Changes the cache location for Puppeteer. - cacheDirectory: join(__dirname, 'node_modules', '.cache', 'puppeteer'), + cacheDirectory: path.join(__dirname, 'node_modules', '.cache', 'puppeteer'), }; diff --git a/lib/middleware/template.tsx b/lib/middleware/template.tsx index 85bc7cf39827e7..482f03ea9a1237 100644 --- a/lib/middleware/template.tsx +++ b/lib/middleware/template.tsx @@ -1,13 +1,9 @@ import { rss3Ums, json, RSS, Atom } from '@/utils/render'; -import * as path from 'node:path'; import { config } from '@/config'; import { collapseWhitespace, convertDateToISO8601 } from '@/utils/common-utils'; import type { MiddlewareHandler } from 'hono'; import { Data } from '@/types'; -import { getCurrentPath } from '@/utils/helpers'; -const __dirname = getCurrentPath(import.meta.url); - // Set RSS (minute) according to the availability of cache // * available: max(config.cache.routeExpire / 60, 1) // * unavailable: 1 diff --git a/lib/registry.ts b/lib/registry.ts index 7d20172e226406..e74012efbf8bad 100644 --- a/lib/registry.ts +++ b/lib/registry.ts @@ -1,7 +1,7 @@ import type { Namespace, Route } from '@/types'; import { directoryImport } from 'directory-import'; import { Hono, type Handler } from 'hono'; -import * as path from 'node:path'; +import path from 'node:path'; import { fileURLToPath } from 'node:url'; import { serveStatic } from '@hono/node-server/serve-static'; diff --git a/lib/routes/005/index.ts b/lib/routes/005/index.ts index 9b8c1ec34a312a..85f9f0d4548f0f 100644 --- a/lib/routes/005/index.ts +++ b/lib/routes/005/index.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const handler = async (ctx) => { const { category = 'zx' } = ctx.req.param(); diff --git a/lib/routes/12306/index.ts b/lib/routes/12306/index.ts index 9f3aaaab05a978..392af5db14769a 100644 --- a/lib/routes/12306/index.ts +++ b/lib/routes/12306/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; const rootUrl = 'https://kyfw.12306.cn'; diff --git a/lib/routes/141jav/index.ts b/lib/routes/141jav/index.ts index 3429652ae98014..85d9b1026dcd3d 100644 --- a/lib/routes/141jav/index.ts +++ b/lib/routes/141jav/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/{.*}?', diff --git a/lib/routes/141ppv/index.ts b/lib/routes/141ppv/index.ts index 64117f7b61c6b8..cf2d42c39914aa 100644 --- a/lib/routes/141ppv/index.ts +++ b/lib/routes/141ppv/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/{.*}?', diff --git a/lib/routes/163/ds.ts b/lib/routes/163/ds.ts index 7dd921a0e61547..befe94ab87b80c 100644 --- a/lib/routes/163/ds.ts +++ b/lib/routes/163/ds.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const root_url = 'https://inf.ds.163.com'; diff --git a/lib/routes/163/exclusive.ts b/lib/routes/163/exclusive.ts index 40d80b0f98956f..3a6a6ade0f007a 100644 --- a/lib/routes/163/exclusive.ts +++ b/lib/routes/163/exclusive.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const ids = { '': { diff --git a/lib/routes/163/music/artist-songs.ts b/lib/routes/163/music/artist-songs.ts index 4f82ba4573d28a..8c572ec703804d 100644 --- a/lib/routes/163/music/artist-songs.ts +++ b/lib/routes/163/music/artist-songs.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/music/artist/songs/:id', diff --git a/lib/routes/163/music/artist.ts b/lib/routes/163/music/artist.ts index 54f0946a16fc1f..c7c04ad12dfa39 100644 --- a/lib/routes/163/music/artist.ts +++ b/lib/routes/163/music/artist.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/music/artist/:id', diff --git a/lib/routes/163/music/djradio.ts b/lib/routes/163/music/djradio.ts index 985e2bbdff4ea4..c735a47e6823bc 100644 --- a/lib/routes/163/music/djradio.ts +++ b/lib/routes/163/music/djradio.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/music/djradio/:id', diff --git a/lib/routes/163/music/playlist.ts b/lib/routes/163/music/playlist.ts index ce6cd7347b458b..350321408902b5 100644 --- a/lib/routes/163/music/playlist.ts +++ b/lib/routes/163/music/playlist.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/music/playlist/:id', diff --git a/lib/routes/163/music/userevents.ts b/lib/routes/163/music/userevents.ts index 32ae7db5ae9428..7971cf011bc6e3 100644 --- a/lib/routes/163/music/userevents.ts +++ b/lib/routes/163/music/userevents.ts @@ -2,7 +2,7 @@ import { Route } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); -import * as path from 'node:path'; +import 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/routes/163/music/userplaylist.ts b/lib/routes/163/music/userplaylist.ts index 87fd929cb3b7f2..add9b08e648a96 100644 --- a/lib/routes/163/music/userplaylist.ts +++ b/lib/routes/163/music/userplaylist.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/music/user/playlist/:uid', diff --git a/lib/routes/163/music/userplayrecords.ts b/lib/routes/163/music/userplayrecords.ts index 78a90c630f0020..401a5c6cf4f320 100644 --- a/lib/routes/163/music/userplayrecords.ts +++ b/lib/routes/163/music/userplayrecords.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const headers = { cookie: config.ncm.cookies, diff --git a/lib/routes/163/open/vip.ts b/lib/routes/163/open/vip.ts index 38e2bb56673463..d30e5992d844da 100644 --- a/lib/routes/163/open/vip.ts +++ b/lib/routes/163/open/vip.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/open/vip', diff --git a/lib/routes/163/utils.ts b/lib/routes/163/utils.ts index e8ec28758b9a95..eab4f07629ed03 100644 --- a/lib/routes/163/utils.ts +++ b/lib/routes/163/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const parseDyArticle = (item, tryGet) => tryGet(item.link, async () => { diff --git a/lib/routes/18comic/utils.ts b/lib/routes/18comic/utils.ts index 4f11fdd2ba65d9..9c8829e6a4e3b4 100644 --- a/lib/routes/18comic/utils.ts +++ b/lib/routes/18comic/utils.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; const defaultDomain = 'jmcomic1.me'; diff --git a/lib/routes/1point3acres/offer.ts b/lib/routes/1point3acres/offer.ts index 5f634093a0a05c..6462d801336aa8 100644 --- a/lib/routes/1point3acres/offer.ts +++ b/lib/routes/1point3acres/offer.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/offer/:year?/:major?/:school?', diff --git a/lib/routes/1point3acres/utils.ts b/lib/routes/1point3acres/utils.ts index 7c13fcaeac3f0f..01ecb09b045569 100644 --- a/lib/routes/1point3acres/utils.ts +++ b/lib/routes/1point3acres/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import bbcode from 'bbcodejs'; const rootUrl = 'https://instant.1point3acres.com'; diff --git a/lib/routes/1x/index.ts b/lib/routes/1x/index.ts index f978ff551938e6..4d08f8a2698dba 100644 --- a/lib/routes/1x/index.ts +++ b/lib/routes/1x/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const handler = async (ctx) => { const { category = 'latest/awarded' } = ctx.req.param(); diff --git a/lib/routes/2048/index.ts b/lib/routes/2048/index.ts index 8674ab5bc8cdd7..f2e7752eb480df 100644 --- a/lib/routes/2048/index.ts +++ b/lib/routes/2048/index.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:id?', diff --git a/lib/routes/3kns/index.ts b/lib/routes/3kns/index.ts index 43ff51d69d693d..2167b3f66f6365 100644 --- a/lib/routes/3kns/index.ts +++ b/lib/routes/3kns/index.ts @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import { load } from 'cheerio'; import { Context } from 'hono'; -import * as path from 'node:path'; +import path from 'node:path'; const __dirname = getCurrentPath(import.meta.url); export const route: Route = { diff --git a/lib/routes/4gamers/utils.ts b/lib/routes/4gamers/utils.ts index 6aca523a0d8fd6..b9a2f2f5d35336 100644 --- a/lib/routes/4gamers/utils.ts +++ b/lib/routes/4gamers/utils.ts @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/4ksj/forum.ts b/lib/routes/4ksj/forum.ts index 94d9d33fbb355a..79c042020f91cf 100644 --- a/lib/routes/4ksj/forum.ts +++ b/lib/routes/4ksj/forum.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import iconv from 'iconv-lite'; export const route: Route = { diff --git a/lib/routes/500px/tribe-set.ts b/lib/routes/500px/tribe-set.ts index a53512e87abb1b..57d6f7f06bb92b 100644 --- a/lib/routes/500px/tribe-set.ts +++ b/lib/routes/500px/tribe-set.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { baseUrl, getTribeDetail, getTribeSets } from './utils'; diff --git a/lib/routes/500px/user.ts b/lib/routes/500px/user.ts index c1b526fa7a7a57..1a4a9686e80fc8 100644 --- a/lib/routes/500px/user.ts +++ b/lib/routes/500px/user.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; import { baseUrl, getUserInfoFromUsername, getUserInfoFromId, getUserWorks } from './utils'; export const route: Route = { diff --git a/lib/routes/56kog/util.ts b/lib/routes/56kog/util.ts index e37c0133da509f..7849211349755c 100644 --- a/lib/routes/56kog/util.ts +++ b/lib/routes/56kog/util.ts @@ -7,7 +7,7 @@ import iconv from 'iconv-lite'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://www.56kog.com'; diff --git a/lib/routes/591/list.ts b/lib/routes/591/list.ts index 6646a066d88cf8..4ba811bb8cb898 100644 --- a/lib/routes/591/list.ts +++ b/lib/routes/591/list.ts @@ -2,7 +2,7 @@ import { Route } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); -import * as path from 'node:path'; +import path from 'node:path'; import { CookieJar } from 'tough-cookie'; import { load } from 'cheerio'; diff --git a/lib/routes/78dm/index.ts b/lib/routes/78dm/index.ts index 6a8c20cd630fb6..490990fa1f888a 100644 --- a/lib/routes/78dm/index.ts +++ b/lib/routes/78dm/index.ts @@ -9,7 +9,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '*', diff --git a/lib/routes/7mmtv/index.ts b/lib/routes/7mmtv/index.ts index 7822aae034771e..c50d55e3b593f8 100644 --- a/lib/routes/7mmtv/index.ts +++ b/lib/routes/7mmtv/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:language?/:category?/:type?', diff --git a/lib/routes/8264/list.ts b/lib/routes/8264/list.ts index c652bfb488d57c..0206f67e4db95e 100644 --- a/lib/routes/8264/list.ts +++ b/lib/routes/8264/list.ts @@ -9,7 +9,7 @@ import iconv from 'iconv-lite'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/list/:id?', diff --git a/lib/routes/91porn/author.ts b/lib/routes/91porn/author.ts index 1f3d5c48988fe6..fb6837f35fb180 100644 --- a/lib/routes/91porn/author.ts +++ b/lib/routes/91porn/author.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { domainValidation } from './utils'; export const route: Route = { diff --git a/lib/routes/91porn/index.ts b/lib/routes/91porn/index.ts index b0f6a2d01fac43..e704db6ae970e6 100644 --- a/lib/routes/91porn/index.ts +++ b/lib/routes/91porn/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { domainValidation } from './utils'; export const route: Route = { diff --git a/lib/routes/95mm/utils.ts b/lib/routes/95mm/utils.ts index d45944f4dd6884..ae0de6936b91a7 100644 --- a/lib/routes/95mm/utils.ts +++ b/lib/routes/95mm/utils.ts @@ -5,7 +5,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://www.95mm.vip'; diff --git a/lib/routes/abc/index.ts b/lib/routes/abc/index.ts index ea5dd7992fc51d..bd3075455d2250 100644 --- a/lib/routes/abc/index.ts +++ b/lib/routes/abc/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:category{.+}?', diff --git a/lib/routes/acs/journal.ts b/lib/routes/acs/journal.ts index 142cd10240bd51..5da7ff54ea862f 100644 --- a/lib/routes/acs/journal.ts +++ b/lib/routes/acs/journal.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; import puppeteer from '@/utils/puppeteer'; diff --git a/lib/routes/aeaweb/index.ts b/lib/routes/aeaweb/index.ts index 1ae4d78352e8d2..5cf537e891c1a5 100644 --- a/lib/routes/aeaweb/index.ts +++ b/lib/routes/aeaweb/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:id', diff --git a/lib/routes/aeon/utils.ts b/lib/routes/aeon/utils.ts index 346ebe4df0bece..1cd3a9eee3e2b3 100644 --- a/lib/routes/aeon/utils.ts +++ b/lib/routes/aeon/utils.ts @@ -5,7 +5,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const getData = async (ctx, list) => { const items = await Promise.all( diff --git a/lib/routes/aicaijing/index.ts b/lib/routes/aicaijing/index.ts index 6c7e7519d0da31..6ee73998760501 100644 --- a/lib/routes/aicaijing/index.ts +++ b/lib/routes/aicaijing/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:category?/:id?', diff --git a/lib/routes/aip/journal-pupp.ts b/lib/routes/aip/journal-pupp.ts index aca60597bfdad8..9010c9182e3799 100644 --- a/lib/routes/aip/journal-pupp.ts +++ b/lib/routes/aip/journal-pupp.ts @@ -5,7 +5,7 @@ import { config } from '@/config'; import { isValidHost } from '@/utils/valid-host'; import puppeteer from '@/utils/puppeteer'; -export default async (ctx) => { +const handler = async (ctx) => { const pub = ctx.req.param('pub'); const jrn = ctx.req.param('jrn'); const host = `https://pubs.aip.org`; @@ -58,3 +58,4 @@ export default async (ctx) => { allowEmpty: true, }; }; +export default handler; diff --git a/lib/routes/aip/utils.ts b/lib/routes/aip/utils.ts index 151425ac70d3a6..54937840035540 100644 --- a/lib/routes/aip/utils.ts +++ b/lib/routes/aip/utils.ts @@ -1,7 +1,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const puppeteerGet = async (url, browser) => { diff --git a/lib/routes/aljazeera/index.ts b/lib/routes/aljazeera/index.ts index 1bf0fa10e1fc54..04b2c58917f281 100644 --- a/lib/routes/aljazeera/index.ts +++ b/lib/routes/aljazeera/index.ts @@ -8,7 +8,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const languages = { arabic: { diff --git a/lib/routes/amazon/kindle-software-updates.ts b/lib/routes/amazon/kindle-software-updates.ts index 4656772bd08633..ed497f0fd05799 100644 --- a/lib/routes/amazon/kindle-software-updates.ts +++ b/lib/routes/amazon/kindle-software-updates.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.amazon.com'; export const route: Route = { diff --git a/lib/routes/anquanke/vul.ts b/lib/routes/anquanke/vul.ts index f50bb86b79a773..0ccc466184400d 100644 --- a/lib/routes/anquanke/vul.ts +++ b/lib/routes/anquanke/vul.ts @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -export default async () => { +const handler = async () => { const url = 'https://www.anquanke.com'; const response = await got(`${url}/vul`); @@ -32,3 +32,5 @@ export default async () => { item: items, }; }; + +export default handler; diff --git a/lib/routes/app-center/release.ts b/lib/routes/app-center/release.ts index ca565507874073..e4b4370dab82db 100644 --- a/lib/routes/app-center/release.ts +++ b/lib/routes/app-center/release.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import MarkdownIt from 'markdown-it'; export const route: Route = { diff --git a/lib/routes/appstorrent/programs.ts b/lib/routes/appstorrent/programs.ts index ad9d40b86e35a9..1120e195faa1df 100644 --- a/lib/routes/appstorrent/programs.ts +++ b/lib/routes/appstorrent/programs.ts @@ -7,7 +7,7 @@ import { art } from '@/utils/render'; import { load } from 'cheerio'; import dayjs from 'dayjs'; import { Context } from 'hono'; -import * as path from 'node:path'; +import path from 'node:path'; const __dirname = getCurrentPath(import.meta.url); export const route: Route = { diff --git a/lib/routes/aqara/post.ts b/lib/routes/aqara/post.ts index ca35c1ea37451c..8154f97399c2ed 100644 --- a/lib/routes/aqara/post.ts +++ b/lib/routes/aqara/post.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '*', diff --git a/lib/routes/arcteryx/new-arrivals.ts b/lib/routes/arcteryx/new-arrivals.ts index c9b82feaae1216..15c2fb755e0bf4 100644 --- a/lib/routes/arcteryx/new-arrivals.ts +++ b/lib/routes/arcteryx/new-arrivals.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { generateRssData } from './utils'; export const route: Route = { diff --git a/lib/routes/arcteryx/outlet.ts b/lib/routes/arcteryx/outlet.ts index f448b7a96c4ac9..ac465a9f4cdf88 100644 --- a/lib/routes/arcteryx/outlet.ts +++ b/lib/routes/arcteryx/outlet.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { generateRssData } from './utils'; export const route: Route = { diff --git a/lib/routes/arcteryx/regear-new-arrivals.ts b/lib/routes/arcteryx/regear-new-arrivals.ts index 44446bf8b7a5ed..6227b1d8421293 100644 --- a/lib/routes/arcteryx/regear-new-arrivals.ts +++ b/lib/routes/arcteryx/regear-new-arrivals.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const host = 'https://www.regear.arcteryx.com'; function getUSDPrice(number) { diff --git a/lib/routes/artstation/user.ts b/lib/routes/artstation/user.ts index d638bfab031f48..7f31b768d71160 100644 --- a/lib/routes/artstation/user.ts +++ b/lib/routes/artstation/user.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { config } from '@/config'; diff --git a/lib/routes/asiantolick/index.ts b/lib/routes/asiantolick/index.ts index cb35d486bdd4c4..1da7355af2d7c8 100644 --- a/lib/routes/asiantolick/index.ts +++ b/lib/routes/asiantolick/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:category{.+}?', diff --git a/lib/routes/asus/bios.ts b/lib/routes/asus/bios.ts index b7f4984612fc5f..e82587ce2dd4e3 100644 --- a/lib/routes/asus/bios.ts +++ b/lib/routes/asus/bios.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import 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/routes/baidu/gushitong/index.ts b/lib/routes/baidu/gushitong/index.ts index 3b64b1dc23d573..c8bcd175e0a737 100644 --- a/lib/routes/baidu/gushitong/index.ts +++ b/lib/routes/baidu/gushitong/index.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const STATUS_MAP = { up: '上涨', diff --git a/lib/routes/baidu/search.ts b/lib/routes/baidu/search.ts index ab54056f3fb9a6..caf46980d62ddb 100644 --- a/lib/routes/baidu/search.ts +++ b/lib/routes/baidu/search.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import 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/routes/baidu/tieba/forum.ts b/lib/routes/baidu/tieba/forum.ts index bf4298918fce53..313c2a61bd955f 100644 --- a/lib/routes/baidu/tieba/forum.ts +++ b/lib/routes/baidu/tieba/forum.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: ['/tieba/forum/good/:kw/:cid?/:sortBy?', '/tieba/forum/:kw/:sortBy?'], diff --git a/lib/routes/baidu/tieba/post.ts b/lib/routes/baidu/tieba/post.ts index 7edadb8b7f7e17..f1aa2cef7402bc 100644 --- a/lib/routes/baidu/tieba/post.ts +++ b/lib/routes/baidu/tieba/post.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; /** * 获取最新的帖子回复(倒序查看) diff --git a/lib/routes/baidu/tieba/search.ts b/lib/routes/baidu/tieba/search.ts index a13a7b6e124563..2b0e57c2db6c56 100644 --- a/lib/routes/baidu/tieba/search.ts +++ b/lib/routes/baidu/tieba/search.ts @@ -8,7 +8,7 @@ import iconv from 'iconv-lite'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/tieba/search/:qw/:routeParams?', diff --git a/lib/routes/baidu/top.ts b/lib/routes/baidu/top.ts index 443e6e011a1983..1da3cdc20e4c57 100644 --- a/lib/routes/baidu/top.ts +++ b/lib/routes/baidu/top.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/top/:board?', diff --git a/lib/routes/bandcamp/weekly.ts b/lib/routes/bandcamp/weekly.ts index 9ac9df89cc9665..f070bc21e2d387 100644 --- a/lib/routes/bandcamp/weekly.ts +++ b/lib/routes/bandcamp/weekly.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/weekly', diff --git a/lib/routes/bangumi/online/online.ts b/lib/routes/bangumi/online/online.ts index fe0fcb9ae42305..02dcc058b404f9 100644 --- a/lib/routes/bangumi/online/online.ts +++ b/lib/routes/bangumi/online/online.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/online', diff --git a/lib/routes/bangumi/tv/calendar/_base.ts b/lib/routes/bangumi/tv/calendar/_base.ts index 6f4f9b33d07917..4e6bc8accf992f 100644 --- a/lib/routes/bangumi/tv/calendar/_base.ts +++ b/lib/routes/bangumi/tv/calendar/_base.ts @@ -1,7 +1,7 @@ import got from '@/utils/got'; import { config } from '@/config'; -export default (tryGet) => { +const getData = (tryGet) => { const bgmCalendarUrl = 'https://api.bgm.tv/calendar'; const bgmDataUrl = 'https://cdn.jsdelivr.net/npm/bangumi-data/dist/data.json'; @@ -35,3 +35,4 @@ export default (tryGet) => { ) ); }; +export default getData; diff --git a/lib/routes/bangumi/tv/calendar/today.ts b/lib/routes/bangumi/tv/calendar/today.ts index 569058dd1b20fa..a82807c2a95169 100644 --- a/lib/routes/bangumi/tv/calendar/today.ts +++ b/lib/routes/bangumi/tv/calendar/today.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import getData from './_base'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/tv/calendar/today', diff --git a/lib/routes/bangumi/tv/subject/comments.ts b/lib/routes/bangumi/tv/subject/comments.ts index 25f8628675c904..685a907c7c2d28 100644 --- a/lib/routes/bangumi/tv/subject/comments.ts +++ b/lib/routes/bangumi/tv/subject/comments.ts @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; -export default async (subjectID, minLength) => { +const getComments = async (subjectID, minLength) => { // bangumi.tv未提供获取“吐槽(comments)”的API,因此仍需要通过抓取网页来获取 const link = `https://bgm.tv/subject/${subjectID}/comments`; const { data: html } = await got(link); @@ -45,3 +45,4 @@ export default async (subjectID, minLength) => { })), }; }; +export default getComments; diff --git a/lib/routes/bangumi/tv/subject/ep.ts b/lib/routes/bangumi/tv/subject/ep.ts index 616c5f86664bcd..dcebbc3d12ff52 100644 --- a/lib/routes/bangumi/tv/subject/ep.ts +++ b/lib/routes/bangumi/tv/subject/ep.ts @@ -4,10 +4,10 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { getLocalName } from './utils'; -export default async (subjectID, showOriginalName) => { +const getEps = async (subjectID, showOriginalName) => { const url = `https://api.bgm.tv/subject/${subjectID}?responseGroup=large`; const { data: epsInfo } = await got(url); const activeEps = []; @@ -33,3 +33,4 @@ export default async (subjectID, showOriginalName) => { })), }; }; +export default getEps; diff --git a/lib/routes/bangumi/tv/subject/offcial-subject-api.ts b/lib/routes/bangumi/tv/subject/offcial-subject-api.ts index 3ee1847169bb52..be2b992ae3a1e9 100644 --- a/lib/routes/bangumi/tv/subject/offcial-subject-api.ts +++ b/lib/routes/bangumi/tv/subject/offcial-subject-api.ts @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { getLocalName } from './utils'; -export default (type) => { +const getFromAPI = (type) => { const mapping = { blog: { en: 'reviews', @@ -31,3 +31,4 @@ export default (type) => { }; }; }; +export default getFromAPI; diff --git a/lib/routes/baozimh/index.ts b/lib/routes/baozimh/index.ts index 6875279ebc08b8..1236bc8bdfd7a0 100644 --- a/lib/routes/baozimh/index.ts +++ b/lib/routes/baozimh/index.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://www.baozimh.com'; diff --git a/lib/routes/bdys/index.ts b/lib/routes/bdys/index.ts index a4b6daeff97716..981dbe0de3d38a 100644 --- a/lib/routes/bdys/index.ts +++ b/lib/routes/bdys/index.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import asyncPool from 'tiny-async-pool'; import { config } from '@/config'; diff --git a/lib/routes/bgmlist/onair.ts b/lib/routes/bgmlist/onair.ts index 10aba10d4de72c..e5c73f0f4422b5 100644 --- a/lib/routes/bgmlist/onair.ts +++ b/lib/routes/bgmlist/onair.ts @@ -3,7 +3,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/routes/bloomberg/utils.ts b/lib/routes/bloomberg/utils.ts index 0bcbbefc761696..377eef2219e54c 100644 --- a/lib/routes/bloomberg/utils.ts +++ b/lib/routes/bloomberg/utils.ts @@ -3,7 +3,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import asyncPool from 'tiny-async-pool'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/booru/mmda.ts b/lib/routes/booru/mmda.ts index 612373541159ad..f67d45f601ce0b 100644 --- a/lib/routes/booru/mmda.ts +++ b/lib/routes/booru/mmda.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import cache from '@/utils/cache'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/mmda/tags/:tags?', diff --git a/lib/routes/bsky/posts.ts b/lib/routes/bsky/posts.ts index 7a424176bcf482..f6ada0707d9478 100644 --- a/lib/routes/bsky/posts.ts +++ b/lib/routes/bsky/posts.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import { parseDate } from '@/utils/parse-date'; import { resolveHandle, getProfile, getAuthorFeed } from './utils'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/profile/:handle', diff --git a/lib/routes/btzj/index.ts b/lib/routes/btzj/index.ts index f597a3a890af3b..8d775f73cc430f 100644 --- a/lib/routes/btzj/index.ts +++ b/lib/routes/btzj/index.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; const allowDomain = new Set(['2btjia.com', '88btbtt.com', 'btbtt15.com', 'btbtt20.com']); diff --git a/lib/routes/caai/utils.ts b/lib/routes/caai/utils.ts index f5ebe650f3321a..ebf6671bf0faab 100644 --- a/lib/routes/caai/utils.ts +++ b/lib/routes/caai/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/caareviews/utils.ts b/lib/routes/caareviews/utils.ts index 0f1d938a0953ae..4fa9e223811103 100644 --- a/lib/routes/caareviews/utils.ts +++ b/lib/routes/caareviews/utils.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'http://www.caareviews.org'; diff --git a/lib/routes/cahkms/index.ts b/lib/routes/cahkms/index.ts index 02d8ddb48ad2c9..1e6f24b6a3057a 100644 --- a/lib/routes/cahkms/index.ts +++ b/lib/routes/cahkms/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const titles = { '01': '关于我们', diff --git a/lib/routes/caixin/database.ts b/lib/routes/caixin/database.ts index a9f01993bd6bde..a6a8f6bcdb0226 100644 --- a/lib/routes/caixin/database.ts +++ b/lib/routes/caixin/database.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/database', diff --git a/lib/routes/caixin/latest.ts b/lib/routes/caixin/latest.ts index a6ee03b5c014b5..0aac998f6c9220 100644 --- a/lib/routes/caixin/latest.ts +++ b/lib/routes/caixin/latest.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/latest', diff --git a/lib/routes/caixin/utils.ts b/lib/routes/caixin/utils.ts index 0b09d101a65b81..fca14c8761199c 100644 --- a/lib/routes/caixin/utils.ts +++ b/lib/routes/caixin/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const parseArticle = (item, tryGet) => /\.blog\.caixin\.com$/.test(new URL(item.link).hostname) diff --git a/lib/routes/cankaoxiaoxi/index.ts b/lib/routes/cankaoxiaoxi/index.ts index ed8d210e1173c7..4c94ee68346dbd 100644 --- a/lib/routes/cankaoxiaoxi/index.ts +++ b/lib/routes/cankaoxiaoxi/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: ['/column/:id?', '/:id?'], diff --git a/lib/routes/cartoonmad/comic.ts b/lib/routes/cartoonmad/comic.ts index fe2c4cb2f7ad84..89e055f6ec1cdb 100644 --- a/lib/routes/cartoonmad/comic.ts +++ b/lib/routes/cartoonmad/comic.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import iconv from 'iconv-lite'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const baseUrl = 'https://www.cartoonmad.com'; const KEY = '5e585'; diff --git a/lib/routes/cbaigui/index.ts b/lib/routes/cbaigui/index.ts index 7417c8e8a734f8..c9443ef6bcb59a 100644 --- a/lib/routes/cbaigui/index.ts +++ b/lib/routes/cbaigui/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { rootUrl, apiSlug, GetFilterId } from './utils'; diff --git a/lib/routes/ccf/ccfcv/index.ts b/lib/routes/ccf/ccfcv/index.ts index 3b49d94f53c4b4..38481ea07bb648 100644 --- a/lib/routes/ccf/ccfcv/index.ts +++ b/lib/routes/ccf/ccfcv/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://tc.ccf.org.cn'; diff --git a/lib/routes/ccf/tfbd/utils.ts b/lib/routes/ccf/tfbd/utils.ts index 25b13c0a79c1e7..207e5b772b5976 100644 --- a/lib/routes/ccf/tfbd/utils.ts +++ b/lib/routes/ccf/tfbd/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/cctv/utils/mzzlbg.ts b/lib/routes/cctv/utils/mzzlbg.ts index 0fa8d4805a2f2e..74a373b924134b 100644 --- a/lib/routes/cctv/utils/mzzlbg.ts +++ b/lib/routes/cctv/utils/mzzlbg.ts @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -export default async () => { +const getMzzlbg = async () => { const url = 'https://api.cntv.cn/video/videolistById?serviceId=cbox&vsid=C10354&em=01&p=1&n=50'; const response = await got({ @@ -39,3 +39,4 @@ export default async () => { item: resultItem, }; }; +export default getMzzlbg; diff --git a/lib/routes/cctv/utils/news.ts b/lib/routes/cctv/utils/news.ts index 425f82d1f5b668..69cbc407915e92 100644 --- a/lib/routes/cctv/utils/news.ts +++ b/lib/routes/cctv/utils/news.ts @@ -1,13 +1,13 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import randUserAgent from '@/utils/rand-user-agent'; const UA = randUserAgent({ browser: 'mobile safari', os: 'ios', device: 'mobile' }); -export default async (category) => { +const getNews = async (category) => { const url = `https://news.cctv.com/2019/07/gaiban/cmsdatainterface/page/${category}_1.jsonp`; const response = await got({ @@ -106,3 +106,4 @@ export default async (category) => { item: resultItem, }; }; +export default getNews; diff --git a/lib/routes/cctv/utils/xinwen1j1.ts b/lib/routes/cctv/utils/xinwen1j1.ts index 1dd41e8fba1a29..e68a40afa5c4d4 100644 --- a/lib/routes/cctv/utils/xinwen1j1.ts +++ b/lib/routes/cctv/utils/xinwen1j1.ts @@ -53,7 +53,7 @@ const ProcessFeed = (data) => return { ...single, ...other }; }) ); -export default async () => { +const xinwen1j1 = async () => { const baseUrl = 'https://api.cntv.cn/NewVideo/getVideoListByColumn?id=TOPC1451559066181661&n=20&sort=desc&p=1&mode=0&serviceId=tvcctv'; // 获取要处理的页面 const res = await got({ @@ -80,3 +80,4 @@ export default async () => { item: result, }; }; +export default xinwen1j1; diff --git a/lib/routes/cde/xxgk.ts b/lib/routes/cde/xxgk.ts index eba4a526c181b7..6504f56c9d27e4 100644 --- a/lib/routes/cde/xxgk.ts +++ b/lib/routes/cde/xxgk.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import utils from './utils'; const baseUrl = 'https://www.cde.org.cn'; diff --git a/lib/routes/cdzjryb/project-list.ts b/lib/routes/cdzjryb/project-list.ts index 2e2772bc4d02a0..9096e7c3565d5d 100644 --- a/lib/routes/cdzjryb/project-list.ts +++ b/lib/routes/cdzjryb/project-list.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/zw/projectList', diff --git a/lib/routes/cebbank/all.ts b/lib/routes/cebbank/all.ts index a0be100d09f794..d18477697975ed 100644 --- a/lib/routes/cebbank/all.ts +++ b/lib/routes/cebbank/all.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/cebbank/history.ts b/lib/routes/cebbank/history.ts index 36443fe2f80cd2..7b1d8404df713a 100644 --- a/lib/routes/cebbank/history.ts +++ b/lib/routes/cebbank/history.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import utils from './utils'; diff --git a/lib/routes/chaincatcher/home.ts b/lib/routes/chaincatcher/home.ts index c1ade0a554e1bc..ac15c18b783323 100644 --- a/lib/routes/chaincatcher/home.ts +++ b/lib/routes/chaincatcher/home.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://www.chaincatcher.com'; diff --git a/lib/routes/changba/user.ts b/lib/routes/changba/user.ts index 2609ddef0f5adb..db74c3e405fcbf 100644 --- a/lib/routes/changba/user.ts +++ b/lib/routes/changba/user.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import 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' }; export const route: Route = { diff --git a/lib/routes/chaoxing/qk.ts b/lib/routes/chaoxing/qk.ts index 8b892ab2284260..ce231c55285a30 100644 --- a/lib/routes/chaoxing/qk.ts +++ b/lib/routes/chaoxing/qk.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/qk/:id/:needContent?', diff --git a/lib/routes/chinadegrees/province.ts b/lib/routes/chinadegrees/province.ts index 7bfa1c89d2e78d..f37fb760d3024b 100644 --- a/lib/routes/chinadegrees/province.ts +++ b/lib/routes/chinadegrees/province.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; import puppeteer from '@/utils/puppeteer'; const baseUrl = 'http://www.chinadegrees.com.cn'; diff --git a/lib/routes/chuanliu/nice.ts b/lib/routes/chuanliu/nice.ts index 5e28e7a67b1716..a10502359f5a4f 100644 --- a/lib/routes/chuanliu/nice.ts +++ b/lib/routes/chuanliu/nice.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import MarkdownIt from 'markdown-it'; const md = MarkdownIt({ html: true, diff --git a/lib/routes/cls/depth.ts b/lib/routes/cls/depth.ts index ee509259d54fe1..c14f3d6aeda93d 100644 --- a/lib/routes/cls/depth.ts +++ b/lib/routes/cls/depth.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { rootUrl, getSearchParams } from './utils'; diff --git a/lib/routes/cls/hot.ts b/lib/routes/cls/hot.ts index d31471cbeb87c4..bd5356d98a9b0d 100644 --- a/lib/routes/cls/hot.ts +++ b/lib/routes/cls/hot.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { rootUrl, getSearchParams } from './utils'; diff --git a/lib/routes/cls/telegraph.ts b/lib/routes/cls/telegraph.ts index 75b96e319b8ee7..c5f1b2965e4c20 100644 --- a/lib/routes/cls/telegraph.ts +++ b/lib/routes/cls/telegraph.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { rootUrl, getSearchParams } from './utils'; diff --git a/lib/routes/cma/channel.ts b/lib/routes/cma/channel.ts index 04630c6a09d5f3..fe8944958e7112 100644 --- a/lib/routes/cma/channel.ts +++ b/lib/routes/cma/channel.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/channel/:id?', diff --git a/lib/routes/cngal/entry.ts b/lib/routes/cngal/entry.ts index 9b758a546d3cf9..71f7d1d1fdefc2 100644 --- a/lib/routes/cngal/entry.ts +++ b/lib/routes/cngal/entry.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/cngal/weekly.ts b/lib/routes/cngal/weekly.ts index 20b86b89f4bb7d..0ee1e8eb317e6a 100644 --- a/lib/routes/cngal/weekly.ts +++ b/lib/routes/cngal/weekly.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; export const route: Route = { diff --git a/lib/routes/cnjxol/index.ts b/lib/routes/cnjxol/index.ts index aa4734859de664..ef2fe0a714ad7e 100644 --- a/lib/routes/cnjxol/index.ts +++ b/lib/routes/cnjxol/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const categories = { jxrb: '嘉兴日报', diff --git a/lib/routes/cnki/debut.ts b/lib/routes/cnki/debut.ts index 60f57fe64d1768..ab8c1f67e2b2fe 100644 --- a/lib/routes/cnki/debut.ts +++ b/lib/routes/cnki/debut.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://chn.oversea.cnki.net'; diff --git a/lib/routes/cnki/utils.ts b/lib/routes/cnki/utils.ts index 0e7e2059058ae5..5b2e7dbe00f50b 100644 --- a/lib/routes/cnki/utils.ts +++ b/lib/routes/cnki/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const ProcessItem = async (item) => { const detailResponse = await got(item.link); diff --git a/lib/routes/cntheory/paper.ts b/lib/routes/cntheory/paper.ts index 5efc9034be584b..49dfa4f8f840e1 100644 --- a/lib/routes/cntheory/paper.ts +++ b/lib/routes/cntheory/paper.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/paper/:id?', diff --git a/lib/routes/cntv/column.ts b/lib/routes/cntv/column.ts index 1d5befa73d55a6..cf6da8dabb132a 100644 --- a/lib/routes/cntv/column.ts +++ b/lib/routes/cntv/column.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; export const route: Route = { diff --git a/lib/routes/codeforces/contests.ts b/lib/routes/codeforces/contests.ts index d126751c252514..b78317506ce1b9 100644 --- a/lib/routes/codeforces/contests.ts +++ b/lib/routes/codeforces/contests.ts @@ -3,7 +3,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import dayjs from 'dayjs'; diff --git a/lib/routes/comicskingdom/index.ts b/lib/routes/comicskingdom/index.ts index a4c57813151ba7..4f89fc61cd4e35 100644 --- a/lib/routes/comicskingdom/index.ts +++ b/lib/routes/comicskingdom/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:name', diff --git a/lib/routes/coomer/utils.ts b/lib/routes/coomer/utils.ts index 4d85cd4b56bb91..50483bea018590 100644 --- a/lib/routes/coomer/utils.ts +++ b/lib/routes/coomer/utils.ts @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -export default async (ctx, currentUrl) => { +const fetchItems = async (ctx, currentUrl) => { const rootUrl = 'https://coomer.party'; currentUrl = `${rootUrl}/${currentUrl}`; @@ -54,3 +54,4 @@ export default async (ctx, currentUrl) => { item: items, }; }; +export default fetchItems; diff --git a/lib/routes/copymanga/comic.ts b/lib/routes/copymanga/comic.ts index 66cdb0c658eb85..233b46435038cb 100644 --- a/lib/routes/copymanga/comic.ts +++ b/lib/routes/copymanga/comic.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; import asyncPool from 'tiny-async-pool'; diff --git a/lib/routes/creative-comic/book.ts b/lib/routes/creative-comic/book.ts index 516ae8b59d3bf4..e5e0359f2e8633 100644 --- a/lib/routes/creative-comic/book.ts +++ b/lib/routes/creative-comic/book.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { getUuid, getBook, getChapter, getChapters, getImgEncrypted, getImgKey, decrypt, getRealKey, siteHost } from './utils'; export const route: Route = { diff --git a/lib/routes/curius/links.ts b/lib/routes/curius/links.ts index c4efe0df08303e..8da7026977645e 100644 --- a/lib/routes/curius/links.ts +++ b/lib/routes/curius/links.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/links/:name', diff --git a/lib/routes/cztv/daily.ts b/lib/routes/cztv/daily.ts index 824f813c7c1594..16c89e445673fe 100644 --- a/lib/routes/cztv/daily.ts +++ b/lib/routes/cztv/daily.ts @@ -6,7 +6,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const renderDesc = (item) => art(path.join(__dirname, 'templates/daily.art'), item); diff --git a/lib/routes/cztv/zjxwlb.ts b/lib/routes/cztv/zjxwlb.ts index 0f270db4effd81..ce4d8543510ae4 100644 --- a/lib/routes/cztv/zjxwlb.ts +++ b/lib/routes/cztv/zjxwlb.ts @@ -6,7 +6,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const renderDesc = (item) => art(path.join(__dirname, 'templates/zjxwlb.art'), item); diff --git a/lib/routes/damai/activity.ts b/lib/routes/damai/activity.ts index 965d9e25cbdeac..ff26f7b209c683 100644 --- a/lib/routes/damai/activity.ts +++ b/lib/routes/damai/activity.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/activity/:city/:category/:subcategory/:keyword?', diff --git a/lib/routes/dcfever/utils.ts b/lib/routes/dcfever/utils.ts index 076ec28f6dff00..0ff4552ba27d20 100644 --- a/lib/routes/dcfever/utils.ts +++ b/lib/routes/dcfever/utils.ts @@ -5,7 +5,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const baseUrl = 'https://www.dcfever.com'; diff --git a/lib/routes/deadline/posts.ts b/lib/routes/deadline/posts.ts index c840f30a1f417e..a3c5a080863ba2 100644 --- a/lib/routes/deadline/posts.ts +++ b/lib/routes/deadline/posts.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/', diff --git a/lib/routes/dedao/knowledge.ts b/lib/routes/dedao/knowledge.ts index f80dbfcfad9e1c..68ad5bae13a1a4 100644 --- a/lib/routes/dedao/knowledge.ts +++ b/lib/routes/dedao/knowledge.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/knowledge/:topic?/:type?', diff --git a/lib/routes/dedao/user.ts b/lib/routes/dedao/user.ts index e2a0787b947090..7e8a41bee4ecf2 100644 --- a/lib/routes/dedao/user.ts +++ b/lib/routes/dedao/user.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const types = { 0: '动态', diff --git a/lib/routes/diershoubing/news.ts b/lib/routes/diershoubing/news.ts index f63df581a1d66f..1dfddc1938b23d 100644 --- a/lib/routes/diershoubing/news.ts +++ b/lib/routes/diershoubing/news.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const renderDesc = (data) => art(path.join(__dirname, 'templates/news.art'), data); export const route: Route = { diff --git a/lib/routes/discord/channel.ts b/lib/routes/discord/channel.ts index ed2ef1c2166610..8474b51a169146 100644 --- a/lib/routes/discord/channel.ts +++ b/lib/routes/discord/channel.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { baseUrl, getChannel, getChannelMessages, getGuild } from './discord-api'; export const route: Route = { diff --git a/lib/routes/dlnews/category.ts b/lib/routes/dlnews/category.ts index 39be45577a0109..fa703c05ef1a78 100644 --- a/lib/routes/dlnews/category.ts +++ b/lib/routes/dlnews/category.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { getData, getList } from './utils'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import asyncPool from 'tiny-async-pool'; const _website = 'dlnews'; diff --git a/lib/routes/dlsite/utils.ts b/lib/routes/dlsite/utils.ts index b89d3ef566d5d6..051091fbe34b27 100644 --- a/lib/routes/dlsite/utils.ts +++ b/lib/routes/dlsite/utils.ts @@ -8,7 +8,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import dayjs from 'dayjs'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://www.dlsite.com'; diff --git a/lib/routes/dn/news.ts b/lib/routes/dn/news.ts index 121aa1164c627d..92fb012705bbdc 100644 --- a/lib/routes/dn/news.ts +++ b/lib/routes/dn/news.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:language/news/:category?', diff --git a/lib/routes/douban/other/explore.ts b/lib/routes/douban/other/explore.ts index d1604bcff1a659..da20f2a5a7f29f 100644 --- a/lib/routes/douban/other/explore.ts +++ b/lib/routes/douban/other/explore.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/explore', diff --git a/lib/routes/douban/other/list.ts b/lib/routes/douban/other/list.ts index 88fc8645f4dd3c..79900b4b6d79bd 100644 --- a/lib/routes/douban/other/list.ts +++ b/lib/routes/douban/other/list.ts @@ -3,7 +3,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { fallback, queryToInteger } from '@/utils/readable-social'; diff --git a/lib/routes/douban/other/recommended.ts b/lib/routes/douban/other/recommended.ts index b5773e229964e6..974861cc8ab894 100644 --- a/lib/routes/douban/other/recommended.ts +++ b/lib/routes/douban/other/recommended.ts @@ -3,7 +3,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { fallback, queryToInteger } from '@/utils/readable-social'; diff --git a/lib/routes/douban/other/weekly-best.ts b/lib/routes/douban/other/weekly-best.ts index 05ef0bae138e6b..b2b35b1c5be830 100644 --- a/lib/routes/douban/other/weekly-best.ts +++ b/lib/routes/douban/other/weekly-best.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/movie/weekly/:type?', diff --git a/lib/routes/douyin/utils.ts b/lib/routes/douyin/utils.ts index 91e8d3dd332262..59e07ee1b70266 100644 --- a/lib/routes/douyin/utils.ts +++ b/lib/routes/douyin/utils.ts @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; -import * as path from 'node:path'; +import path from 'node:path'; import got from '@/utils/got'; import { load } from 'cheerio'; import logger from '@/utils/logger'; diff --git a/lib/routes/douyu/group.ts b/lib/routes/douyu/group.ts index 87b0260834c4ce..e46cabbc5f2eac 100644 --- a/lib/routes/douyu/group.ts +++ b/lib/routes/douyu/group.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/group/:id/:sort?', diff --git a/lib/routes/douyu/post.ts b/lib/routes/douyu/post.ts index b6276682e7f7b9..e208d539c3f82d 100644 --- a/lib/routes/douyu/post.ts +++ b/lib/routes/douyu/post.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/post/:id', diff --git a/lib/routes/dribbble/utils.ts b/lib/routes/dribbble/utils.ts index ef4bcd6601f75a..1f20f7d1b463ce 100644 --- a/lib/routes/dribbble/utils.ts +++ b/lib/routes/dribbble/utils.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; // Refactored function to load a link asynchronously async function loadContent(link) { diff --git a/lib/routes/duozhuayu/search.ts b/lib/routes/duozhuayu/search.ts index 564ecfcc8e35d9..84c7a22fd1eca9 100644 --- a/lib/routes/duozhuayu/search.ts +++ b/lib/routes/duozhuayu/search.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import aesjs from 'aes-js'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; export const route: Route = { diff --git a/lib/routes/dushu/fuzhou/index.ts b/lib/routes/dushu/fuzhou/index.ts index 7de41150d76f08..ab797f9d5d1335 100644 --- a/lib/routes/dushu/fuzhou/index.ts +++ b/lib/routes/dushu/fuzhou/index.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import 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/routes/e-hentai/index.ts b/lib/routes/e-hentai/index.ts index 15547dae4cfacc..c85075a22eef2a 100644 --- a/lib/routes/e-hentai/index.ts +++ b/lib/routes/e-hentai/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/ecnu/contest.ts b/lib/routes/ecnu/contest.ts index 2d931ac4c70683..ad0299f2166681 100644 --- a/lib/routes/ecnu/contest.ts +++ b/lib/routes/ecnu/contest.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/acm/contest/:category?', diff --git a/lib/routes/ehentai/ehapi.ts b/lib/routes/ehentai/ehapi.ts index 88334ddd25a506..55780330ab476c 100644 --- a/lib/routes/ehentai/ehapi.ts +++ b/lib/routes/ehentai/ehapi.ts @@ -2,7 +2,7 @@ import got from '@/utils/got'; import logger from '@/utils/logger'; import timezone from '@/utils/timezone'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; const headers = {}; diff --git a/lib/routes/elsevier/issue.ts b/lib/routes/elsevier/issue.ts index 4596cbd5e16f73..1ffe2628a1c661 100644 --- a/lib/routes/elsevier/issue.ts +++ b/lib/routes/elsevier/issue.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { CookieJar } from 'tough-cookie'; diff --git a/lib/routes/elsevier/journal.ts b/lib/routes/elsevier/journal.ts index 74896feb994e05..4c09769afc7e19 100644 --- a/lib/routes/elsevier/journal.ts +++ b/lib/routes/elsevier/journal.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { CookieJar } from 'tough-cookie'; diff --git a/lib/routes/epicgames/index.ts b/lib/routes/epicgames/index.ts index 5e54bf5a6e8a02..22c0bdebea056d 100644 --- a/lib/routes/epicgames/index.ts +++ b/lib/routes/epicgames/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import dayjs from 'dayjs'; export const route: Route = { diff --git a/lib/routes/eprice/rss.ts b/lib/routes/eprice/rss.ts index 1d4190821c2ad7..4facb99afad8fd 100644 --- a/lib/routes/eprice/rss.ts +++ b/lib/routes/eprice/rss.ts @@ -8,7 +8,7 @@ import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const allowRegion = new Set(['tw', 'hk']); export const route: Route = { diff --git a/lib/routes/fansly/utils.ts b/lib/routes/fansly/utils.ts index 58c908aa7e2283..b95c937671f362 100644 --- a/lib/routes/fansly/utils.ts +++ b/lib/routes/fansly/utils.ts @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const apiBaseUrl = 'https://apiv3.fansly.com'; diff --git a/lib/routes/fanxinzhui/index.ts b/lib/routes/fanxinzhui/index.ts index 554005210520a2..44a77a458cfd10 100644 --- a/lib/routes/fanxinzhui/index.ts +++ b/lib/routes/fanxinzhui/index.ts @@ -5,7 +5,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/', diff --git a/lib/routes/farmatters/index.ts b/lib/routes/farmatters/index.ts index 0c085fb1d24bf1..468df1521150f8 100644 --- a/lib/routes/farmatters/index.ts +++ b/lib/routes/farmatters/index.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import MarkdownIt from 'markdown-it'; const md = MarkdownIt({ html: true, diff --git a/lib/routes/fastbull/news.ts b/lib/routes/fastbull/news.ts index 9251027f1963c0..b010820569838a 100644 --- a/lib/routes/fastbull/news.ts +++ b/lib/routes/fastbull/news.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: ['/news', '/'], diff --git a/lib/routes/feng/forum.ts b/lib/routes/feng/forum.ts index be8af1c228d0e9..946e9f0b587fd3 100644 --- a/lib/routes/feng/forum.ts +++ b/lib/routes/feng/forum.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import { parseDate } from '@/utils/parse-date'; import { baseUrl, getForumMeta, getThreads, getThread } from './utils'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/forum/:id/:type?', diff --git a/lib/routes/ff14/ff14-global.ts b/lib/routes/ff14/ff14-global.ts index 666c061b6a6493..2d54646209a1ae 100644 --- a/lib/routes/ff14/ff14-global.ts +++ b/lib/routes/ff14/ff14-global.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; export const route: Route = { diff --git a/lib/routes/ff14/ff14-zh.ts b/lib/routes/ff14/ff14-zh.ts index f4d85a751b80d2..d6b34786e28b9a 100644 --- a/lib/routes/ff14/ff14-zh.ts +++ b/lib/routes/ff14/ff14-zh.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: ['/zh/:type?', '/ff14_zh/:type?'], diff --git a/lib/routes/fffdm/manhua/manhua.ts b/lib/routes/fffdm/manhua/manhua.ts index 98e37701ef16f9..4291d1c8cb609f 100644 --- a/lib/routes/fffdm/manhua/manhua.ts +++ b/lib/routes/fffdm/manhua/manhua.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; const domain = 'manhua.fffdm.com'; const host = `https://${domain}`; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const get_pic = async (url) => { diff --git a/lib/routes/fisher-spb/news.ts b/lib/routes/fisher-spb/news.ts index 7c58cd4022618f..732736d2e83c1e 100644 --- a/lib/routes/fisher-spb/news.ts +++ b/lib/routes/fisher-spb/news.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/news', diff --git a/lib/routes/focustaiwan/index.ts b/lib/routes/focustaiwan/index.ts index 403688d817fd86..bd8271bfa77e3c 100644 --- a/lib/routes/focustaiwan/index.ts +++ b/lib/routes/focustaiwan/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/followin/utils.ts b/lib/routes/followin/utils.ts index 5d0b0ffd7befc1..6a8875c8b5d45d 100644 --- a/lib/routes/followin/utils.ts +++ b/lib/routes/followin/utils.ts @@ -6,7 +6,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const apiUrl = 'https://api.followin.io'; const baseUrl = 'https://followin.io'; diff --git a/lib/routes/foresightnews/util.ts b/lib/routes/foresightnews/util.ts index 50c862a57aea94..f9d1f72411caa8 100644 --- a/lib/routes/foresightnews/util.ts +++ b/lib/routes/foresightnews/util.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import zlib from 'zlib'; const constants = { diff --git a/lib/routes/fosshub/index.ts b/lib/routes/fosshub/index.ts index 457f6af323e66f..5c8104d5530cfc 100644 --- a/lib/routes/fosshub/index.ts +++ b/lib/routes/fosshub/index.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:id', diff --git a/lib/routes/freecomputerbooks/index.ts b/lib/routes/freecomputerbooks/index.ts index 11cfc54e2f14a1..2b6643a03ea117 100644 --- a/lib/routes/freecomputerbooks/index.ts +++ b/lib/routes/freecomputerbooks/index.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import got from '@/utils/got'; import { art } from '@/utils/render'; diff --git a/lib/routes/furstar/utils.ts b/lib/routes/furstar/utils.ts index 87663fd2cead57..7c3583b71b4267 100644 --- a/lib/routes/furstar/utils.ts +++ b/lib/routes/furstar/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const base = 'https://furstar.jp'; diff --git a/lib/routes/futunn/main.ts b/lib/routes/futunn/main.ts index 3010de46f845e7..f5c553f9ef62e6 100644 --- a/lib/routes/futunn/main.ts +++ b/lib/routes/futunn/main.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: ['/highlights', '/main', '/'], diff --git a/lib/routes/gameapps/index.ts b/lib/routes/gameapps/index.ts index 28938342c2f72d..6aee2775ede713 100644 --- a/lib/routes/gameapps/index.ts +++ b/lib/routes/gameapps/index.ts @@ -8,7 +8,7 @@ import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/', diff --git a/lib/routes/gcores/radio.ts b/lib/routes/gcores/radio.ts index b31c6650b45a23..88a6eee013aac2 100644 --- a/lib/routes/gcores/radio.ts +++ b/lib/routes/gcores/radio.ts @@ -7,7 +7,7 @@ import { parseDate } from '@/utils/parse-date'; import { load } from 'cheerio'; import got from '@/utils/got'; import md5 from '@/utils/md5'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/radios/:category?', diff --git a/lib/routes/gelonghui/live.ts b/lib/routes/gelonghui/live.ts index fc3323a50509c9..f6f4567884610b 100644 --- a/lib/routes/gelonghui/live.ts +++ b/lib/routes/gelonghui/live.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const baseUrl = 'https://www.gelonghui.com'; diff --git a/lib/routes/gettr/user.ts b/lib/routes/gettr/user.ts index 123b40bc683fe4..a4ee40a3c3aa6a 100644 --- a/lib/routes/gettr/user.ts +++ b/lib/routes/gettr/user.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const actionMap = { pub_pst: 'Published a post: ', diff --git a/lib/routes/github/pulse.ts b/lib/routes/github/pulse.ts index f48179726b2439..12ed3c7890fe25 100644 --- a/lib/routes/github/pulse.ts +++ b/lib/routes/github/pulse.ts @@ -3,7 +3,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import got from '@/utils/got'; import md5 from '@/utils/md5'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/github/trending.ts b/lib/routes/github/trending.ts index fe2ec6cde144ff..4ec4313cb998dc 100644 --- a/lib/routes/github/trending.ts +++ b/lib/routes/github/trending.ts @@ -6,7 +6,7 @@ import { config } from '@/config'; import got from '@/utils/got'; import { art } from '@/utils/render'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/trending/:since/:language/:spoken_language?', diff --git a/lib/routes/gitpod/blog.ts b/lib/routes/gitpod/blog.ts index 8ccfc59b60467d..7f6984277cedea 100644 --- a/lib/routes/gitpod/blog.ts +++ b/lib/routes/gitpod/blog.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { rootUrl } from './utils'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/blog', diff --git a/lib/routes/gofans/index.ts b/lib/routes/gofans/index.ts index 413508e98d0a34..a1eb3cd7bca841 100644 --- a/lib/routes/gofans/index.ts +++ b/lib/routes/gofans/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:kind?', diff --git a/lib/routes/google/fonts.ts b/lib/routes/google/fonts.ts index 2ee8551da8682a..4b32499540c279 100644 --- a/lib/routes/google/fonts.ts +++ b/lib/routes/google/fonts.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const titleMap = { diff --git a/lib/routes/google/news.ts b/lib/routes/google/news.ts index facac761f56d14..39ba4b38bcf92d 100644 --- a/lib/routes/google/news.ts +++ b/lib/routes/google/news.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const baseUrl = 'https://news.google.com'; diff --git a/lib/routes/google/search.ts b/lib/routes/google/search.ts index d35666fd70d67a..85f27f02849f00 100644 --- a/lib/routes/google/search.ts +++ b/lib/routes/google/search.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import 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/routes/gov/caac/cjwt.ts b/lib/routes/gov/caac/cjwt.ts index b017bc0e5d3f19..fea65988ee8851 100644 --- a/lib/routes/gov/caac/cjwt.ts +++ b/lib/routes/gov/caac/cjwt.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/caac/cjwt/:category?', diff --git a/lib/routes/gov/cmse/fxrw.ts b/lib/routes/gov/cmse/fxrw.ts index f6ec62e4a95a6b..aef607f0c2572a 100644 --- a/lib/routes/gov/cmse/fxrw.ts +++ b/lib/routes/gov/cmse/fxrw.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/cmse/fxrw', diff --git a/lib/routes/gov/csrc/news.ts b/lib/routes/gov/csrc/news.ts index 51b2b6c34ec7e5..0d9f0f10a95afd 100644 --- a/lib/routes/gov/csrc/news.ts +++ b/lib/routes/gov/csrc/news.ts @@ -8,7 +8,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/csrc/news/:suffix{.+}?', diff --git a/lib/routes/gov/forestry/gjlckjdjt.ts b/lib/routes/gov/forestry/gjlckjdjt.ts index eebcf32880fba2..e7cd57e61f6b47 100644 --- a/lib/routes/gov/forestry/gjlckjdjt.ts +++ b/lib/routes/gov/forestry/gjlckjdjt.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/forestry/gjlckjdjt/:category?', diff --git a/lib/routes/gov/guangdong/tqyb/sncsyjxh.ts b/lib/routes/gov/guangdong/tqyb/sncsyjxh.ts index dc1508daceda02..0fb81e0b738671 100644 --- a/lib/routes/gov/guangdong/tqyb/sncsyjxh.ts +++ b/lib/routes/gov/guangdong/tqyb/sncsyjxh.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/gov/guangdong/tqyb/tfxtq.ts b/lib/routes/gov/guangdong/tqyb/tfxtq.ts index 0ade4040c115a7..8e8549d1199a29 100644 --- a/lib/routes/gov/guangdong/tqyb/tfxtq.ts +++ b/lib/routes/gov/guangdong/tqyb/tfxtq.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const rootUrl = 'http://www.tqyb.com.cn'; diff --git a/lib/routes/gov/safe/util.ts b/lib/routes/gov/safe/util.ts index 48b45347999cae..013d59e0c0aa9d 100644 --- a/lib/routes/gov/safe/util.ts +++ b/lib/routes/gov/safe/util.ts @@ -5,7 +5,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://www.safe.gov.cn'; diff --git a/lib/routes/gov/samr/xgzlyhd.ts b/lib/routes/gov/samr/xgzlyhd.ts index 4474b2ca3fc0da..9f9f7202dd2628 100644 --- a/lib/routes/gov/samr/xgzlyhd.ts +++ b/lib/routes/gov/samr/xgzlyhd.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://xgzlyhd.samr.gov.cn'; const apiUrl = new URL('gjjly/message/getMessageList', rootUrl).href; diff --git a/lib/routes/gov/shanghai/rsj/ksxm.ts b/lib/routes/gov/shanghai/rsj/ksxm.ts index 11cde4c4369dc5..5b9425158b63c9 100644 --- a/lib/routes/gov/shanghai/rsj/ksxm.ts +++ b/lib/routes/gov/shanghai/rsj/ksxm.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import iconv from 'iconv-lite'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'http://www.rsj.sh.gov.cn'; diff --git a/lib/routes/gov/shanghai/wgj/wgj.ts b/lib/routes/gov/shanghai/wgj/wgj.ts index 88640528fa054b..523aabf3e50cec 100644 --- a/lib/routes/gov/shanghai/wgj/wgj.ts +++ b/lib/routes/gov/shanghai/wgj/wgj.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/shanghai/wgj/:page?', diff --git a/lib/routes/gov/sichuan/deyang/govpublicinfo.ts b/lib/routes/gov/sichuan/deyang/govpublicinfo.ts index 0a43bb0ca954dc..79501dc07728d7 100644 --- a/lib/routes/gov/sichuan/deyang/govpublicinfo.ts +++ b/lib/routes/gov/sichuan/deyang/govpublicinfo.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import timezone from '@/utils/timezone'; // 各地区url信息 diff --git a/lib/routes/gov/sichuan/deyang/mztoday.ts b/lib/routes/gov/sichuan/deyang/mztoday.ts index a3ee825fd4c9ba..65a55dbc044595 100644 --- a/lib/routes/gov/sichuan/deyang/mztoday.ts +++ b/lib/routes/gov/sichuan/deyang/mztoday.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import timezone from '@/utils/timezone'; const rootUrl = 'http://www.mztoday.gov.cn'; diff --git a/lib/routes/gov/stats/index.ts b/lib/routes/gov/stats/index.ts index 7bfea3eb8e3cd0..8533961ca7c1dd 100644 --- a/lib/routes/gov/stats/index.ts +++ b/lib/routes/gov/stats/index.ts @@ -9,7 +9,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/stats/*', diff --git a/lib/routes/guduodata/daily.ts b/lib/routes/guduodata/daily.ts index 326aee2d3bd373..86d4fbedee3e65 100644 --- a/lib/routes/guduodata/daily.ts +++ b/lib/routes/guduodata/daily.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import dayjs from 'dayjs'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const host = 'http://data.guduodata.com'; diff --git a/lib/routes/gumroad/index.ts b/lib/routes/gumroad/index.ts index 0a9006e4a8723e..321cba95b3b1cf 100644 --- a/lib/routes/gumroad/index.ts +++ b/lib/routes/gumroad/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; export const route: Route = { diff --git a/lib/routes/gzdaily/app.ts b/lib/routes/gzdaily/app.ts index 05e135a9d06e3b..528f78aefd69d2 100644 --- a/lib/routes/gzdaily/app.ts +++ b/lib/routes/gzdaily/app.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/app/:column?', diff --git a/lib/routes/hafu/utils.ts b/lib/routes/hafu/utils.ts index fc6ab58876b1f9..c8ee1bedd63251 100644 --- a/lib/routes/hafu/utils.ts +++ b/lib/routes/hafu/utils.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import 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 }, @@ -17,7 +17,7 @@ const typeMap = { // Number of get articles let limit = 10; -export default async (ctx, type) => { +const parseList = async (ctx, type) => { const link = typeMap[type].url; const title = typeMap[type].title; @@ -33,6 +33,7 @@ export default async (ctx, type) => { resultList, }; }; +export default parseList; async function tryGetFullText(href, link, type) { let articleData = ''; diff --git a/lib/routes/hashnode/blog.ts b/lib/routes/hashnode/blog.ts index fd7ab51b51c5d7..6d4d32ac56ae94 100644 --- a/lib/routes/hashnode/blog.ts +++ b/lib/routes/hashnode/blog.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const baseApiUrl = 'https://api.hashnode.com'; diff --git a/lib/routes/hebtv/nong-bo-shi-zai-xing-dong.ts b/lib/routes/hebtv/nong-bo-shi-zai-xing-dong.ts index 82c9b2418fb217..e722d893c4ab92 100644 --- a/lib/routes/hebtv/nong-bo-shi-zai-xing-dong.ts +++ b/lib/routes/hebtv/nong-bo-shi-zai-xing-dong.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import 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/routes/hellogithub/index.ts b/lib/routes/hellogithub/index.ts index 7fe7b6b6c7bdeb..7050f35d50fbec 100644 --- a/lib/routes/hellogithub/index.ts +++ b/lib/routes/hellogithub/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const sorts = { hot: '热门', diff --git a/lib/routes/hellogithub/report.ts b/lib/routes/hellogithub/report.ts index 8b9398fa7244c5..9b9e77ccdea5ec 100644 --- a/lib/routes/hellogithub/report.ts +++ b/lib/routes/hellogithub/report.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const types = { tiobe: '编程语言', diff --git a/lib/routes/hellogithub/volume.ts b/lib/routes/hellogithub/volume.ts index 85a9ae5f3c1539..8f675c7f622375 100644 --- a/lib/routes/hellogithub/volume.ts +++ b/lib/routes/hellogithub/volume.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import MarkdownIt from 'markdown-it'; const md = MarkdownIt({ html: true, diff --git a/lib/routes/hk01/utils.ts b/lib/routes/hk01/utils.ts index ab73b1680ad54e..a4efa60334a0b9 100644 --- a/lib/routes/hk01/utils.ts +++ b/lib/routes/hk01/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://hk01.com'; const apiRootUrl = 'https://web-data.api.hk01.com'; diff --git a/lib/routes/hkej/index.ts b/lib/routes/hkej/index.ts index 86473a8a183f76..e4b23fcccfc7e4 100644 --- a/lib/routes/hkej/index.ts +++ b/lib/routes/hkej/index.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { CookieJar } from 'tough-cookie'; const cookieJar = new CookieJar(); diff --git a/lib/routes/hket/index.ts b/lib/routes/hket/index.ts index 3b0222c3b48086..d6b1724f98b6e5 100644 --- a/lib/routes/hket/index.ts +++ b/lib/routes/hket/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const urlMap = { diff --git a/lib/routes/hostmonit/cloudflareyes.ts b/lib/routes/hostmonit/cloudflareyes.ts index eaa89d8eaca087..7800b3383a7070 100644 --- a/lib/routes/hostmonit/cloudflareyes.ts +++ b/lib/routes/hostmonit/cloudflareyes.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const lines = { CM: '中国移动', diff --git a/lib/routes/houxu/events.ts b/lib/routes/houxu/events.ts index 4a63ad97fbf105..5ac31cafc0ff2d 100644 --- a/lib/routes/houxu/events.ts +++ b/lib/routes/houxu/events.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/events', diff --git a/lib/routes/houxu/index.ts b/lib/routes/houxu/index.ts index 00a4331a538ace..1b1d4c0152a343 100644 --- a/lib/routes/houxu/index.ts +++ b/lib/routes/houxu/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: ['/featured', '/index', '/'], diff --git a/lib/routes/houxu/memory.ts b/lib/routes/houxu/memory.ts index c4513121483305..11c3c5c4344209 100644 --- a/lib/routes/houxu/memory.ts +++ b/lib/routes/houxu/memory.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/memory', diff --git a/lib/routes/hoyolab/news.ts b/lib/routes/hoyolab/news.ts index 72a1a6838991e8..7c38b721712fee 100644 --- a/lib/routes/hoyolab/news.ts +++ b/lib/routes/hoyolab/news.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import logger from '@/utils/logger'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { HOST, NEW_LIST, OFFICIAL_PAGE_TYPE, POST_FULL, LINK, PUBLIC_IMG, PRIVATE_IMG } from './constant'; import { getI18nGameInfo, getI18nType } from './utils'; diff --git a/lib/routes/hrbust/utils.ts b/lib/routes/hrbust/utils.ts index 814b0a552b9793..f78ad868fbfdc4 100644 --- a/lib/routes/hrbust/utils.ts +++ b/lib/routes/hrbust/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/hupu/all.ts b/lib/routes/hupu/all.ts index e01c7a9ae3731c..1f343b85179a46 100644 --- a/lib/routes/hupu/all.ts +++ b/lib/routes/hupu/all.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/all/:id?', diff --git a/lib/routes/hupu/bbs.ts b/lib/routes/hupu/bbs.ts index 9f0eb4ed6eb6ef..c2ff2e453b76c5 100644 --- a/lib/routes/hupu/bbs.ts +++ b/lib/routes/hupu/bbs.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: ['/bbs/:id?/:order?', '/bxj/:id?/:order?'], diff --git a/lib/routes/huxiu/util.ts b/lib/routes/huxiu/util.ts index 76a8868a04bb54..216865a44d1eda 100644 --- a/lib/routes/huxiu/util.ts +++ b/lib/routes/huxiu/util.ts @@ -5,7 +5,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import CryptoJS from 'crypto-js'; const domain = 'huxiu.com'; diff --git a/lib/routes/ianspriggs/index.ts b/lib/routes/ianspriggs/index.ts index 0f263300e3dfc6..d973da7f1bf274 100644 --- a/lib/routes/ianspriggs/index.ts +++ b/lib/routes/ianspriggs/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:category?', diff --git a/lib/routes/idaily/index.ts b/lib/routes/idaily/index.ts index 7a5ee6849ebf5b..f3a0d59c61fa80 100644 --- a/lib/routes/idaily/index.ts +++ b/lib/routes/idaily/index.ts @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); diff --git a/lib/routes/ieee/earlyaccess.ts b/lib/routes/ieee/earlyaccess.ts index b8692ccbce838c..9f18bc0b02d974 100644 --- a/lib/routes/ieee/earlyaccess.ts +++ b/lib/routes/ieee/earlyaccess.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { CookieJar } from 'tough-cookie'; diff --git a/lib/routes/ieee/journal.ts b/lib/routes/ieee/journal.ts index a90a5533bc4151..f8e38085b9aa6c 100644 --- a/lib/routes/ieee/journal.ts +++ b/lib/routes/ieee/journal.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { CookieJar } from 'tough-cookie'; diff --git a/lib/routes/ieee/recent.ts b/lib/routes/ieee/recent.ts index 0b848ea92e65ad..b5f75bc7eef528 100644 --- a/lib/routes/ieee/recent.ts +++ b/lib/routes/ieee/recent.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { CookieJar } from 'tough-cookie'; diff --git a/lib/routes/ifeng/news.ts b/lib/routes/ifeng/news.ts index b69703d353cddf..515da98683e30f 100644 --- a/lib/routes/ifeng/news.ts +++ b/lib/routes/ifeng/news.ts @@ -9,7 +9,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/news/*', diff --git a/lib/routes/ifeng/utils.ts b/lib/routes/ifeng/utils.ts index e9668fb4eaf528..9e7e084f3c57f1 100644 --- a/lib/routes/ifeng/utils.ts +++ b/lib/routes/ifeng/utils.ts @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const extractDoc = (data) => data diff --git a/lib/routes/ikea/cn/utils.ts b/lib/routes/ikea/cn/utils.ts index 28fa4993aef444..deef19138fd134 100644 --- a/lib/routes/ikea/cn/utils.ts +++ b/lib/routes/ikea/cn/utils.ts @@ -3,7 +3,7 @@ const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; import md5 from '@/utils/md5'; -import * as path from 'node:path'; +import path from 'node:path'; const generateRequestHeaders = () => { const now = Math.round(Date.now() / 1000); diff --git a/lib/routes/ikea/gb/new.ts b/lib/routes/ikea/gb/new.ts index ceb8181533aee0..cc67adc9d716a3 100644 --- a/lib/routes/ikea/gb/new.ts +++ b/lib/routes/ikea/gb/new.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/gb/new', diff --git a/lib/routes/ikea/gb/offer.ts b/lib/routes/ikea/gb/offer.ts index 13cc9c80de28b9..1032596d1dd4ae 100644 --- a/lib/routes/ikea/gb/offer.ts +++ b/lib/routes/ikea/gb/offer.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/gb/offer', diff --git a/lib/routes/imiker/jinghua.ts b/lib/routes/imiker/jinghua.ts index eacdc87cea59c4..2a4ad34fc2b217 100644 --- a/lib/routes/imiker/jinghua.ts +++ b/lib/routes/imiker/jinghua.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/ask/jinghua', diff --git a/lib/routes/informs/index.ts b/lib/routes/informs/index.ts index 6da9342187c63f..73f5ab7ea7efea 100644 --- a/lib/routes/informs/index.ts +++ b/lib/routes/informs/index.ts @@ -7,7 +7,7 @@ import { config } from '@/config'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const rootUrl = 'https://pubsonline.informs.org'; diff --git a/lib/routes/instagram/common-utils.ts b/lib/routes/instagram/common-utils.ts index ec7caa325ca63d..d0a25b9c850fe3 100644 --- a/lib/routes/instagram/common-utils.ts +++ b/lib/routes/instagram/common-utils.ts @@ -3,7 +3,7 @@ const __dirname = getCurrentPath(import.meta.url); import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const renderItems = (items) => items.map((item) => { diff --git a/lib/routes/instagram/web-api/utils.ts b/lib/routes/instagram/web-api/utils.ts index f08820dcb27add..f2ddaa003badff 100644 --- a/lib/routes/instagram/web-api/utils.ts +++ b/lib/routes/instagram/web-api/utils.ts @@ -5,7 +5,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const baseUrl = 'https://www.instagram.com'; const COOKIE_URL = 'https://instagram.com'; diff --git a/lib/routes/iqilu/program.ts b/lib/routes/iqilu/program.ts index cf8c16e9d26018..5e0046baa38187 100644 --- a/lib/routes/iqilu/program.ts +++ b/lib/routes/iqilu/program.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/v/:category{.+}?', diff --git a/lib/routes/iqiyi/album.ts b/lib/routes/iqiyi/album.ts index 3ebb6eda4f380a..460e25a2b4eee0 100644 --- a/lib/routes/iqiyi/album.ts +++ b/lib/routes/iqiyi/album.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/album/:id', diff --git a/lib/routes/iresearch/report.ts b/lib/routes/iresearch/report.ts index 4a81794d89f792..094875ddf891cc 100644 --- a/lib/routes/iresearch/report.ts +++ b/lib/routes/iresearch/report.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/iresearch/weekly.ts b/lib/routes/iresearch/weekly.ts index bc1d63d8783063..c267f3e6865f17 100644 --- a/lib/routes/iresearch/weekly.ts +++ b/lib/routes/iresearch/weekly.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/weekly/:category?', diff --git a/lib/routes/itch/devlog.ts b/lib/routes/itch/devlog.ts index 8d98e73827d960..62c2dcb3c5ed48 100644 --- a/lib/routes/itch/devlog.ts +++ b/lib/routes/itch/devlog.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; export const route: Route = { diff --git a/lib/routes/itch/index.ts b/lib/routes/itch/index.ts index ba40ceb41f8d9a..24eace8abc30cb 100644 --- a/lib/routes/itch/index.ts +++ b/lib/routes/itch/index.ts @@ -7,7 +7,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '*', diff --git a/lib/routes/iwara/subscriptions.ts b/lib/routes/iwara/subscriptions.ts index a845e7dd467024..629d6fec4ac048 100644 --- a/lib/routes/iwara/subscriptions.ts +++ b/lib/routes/iwara/subscriptions.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; import MarkdownIt from 'markdown-it'; const md = MarkdownIt({ html: true, diff --git a/lib/routes/ixigua/user-video.ts b/lib/routes/ixigua/user-video.ts index f06bfac6286d08..c1dd8cc965c399 100644 --- a/lib/routes/ixigua/user-video.ts +++ b/lib/routes/ixigua/user-video.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const host = 'https://www.ixigua.com'; diff --git a/lib/routes/japanpost/track.ts b/lib/routes/japanpost/track.ts index 7e169b8fb5a057..7b2906f55163a8 100644 --- a/lib/routes/japanpost/track.ts +++ b/lib/routes/japanpost/track.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import utils from './utils'; let baseTitle = '日本郵便'; diff --git a/lib/routes/javbus/index.ts b/lib/routes/javbus/index.ts index 3cf880d063c7e0..9567e6fe739dd1 100644 --- a/lib/routes/javbus/index.ts +++ b/lib/routes/javbus/index.ts @@ -8,7 +8,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; const toSize = (raw) => { diff --git a/lib/routes/javlibrary/utils.ts b/lib/routes/javlibrary/utils.ts index 79a89713233f20..666fa1ee4afaca 100644 --- a/lib/routes/javlibrary/utils.ts +++ b/lib/routes/javlibrary/utils.ts @@ -5,7 +5,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://www.javlibrary.com'; const defaultMode = '1'; diff --git a/lib/routes/jd/price.ts b/lib/routes/jd/price.ts index a5469e2943c440..9a78c18e9b8730 100644 --- a/lib/routes/jd/price.ts +++ b/lib/routes/jd/price.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/price/:id', diff --git a/lib/routes/jiemian/lists.ts b/lib/routes/jiemian/lists.ts index 0e7861fc71f0f3..a92bf991915b84 100644 --- a/lib/routes/jiemian/lists.ts +++ b/lib/routes/jiemian/lists.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:category{.+}?', diff --git a/lib/routes/jin10/index.ts b/lib/routes/jin10/index.ts index 699bd4c1672d1f..939ddb98f7fd9c 100644 --- a/lib/routes/jin10/index.ts +++ b/lib/routes/jin10/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; export const route: Route = { diff --git a/lib/routes/jinse/catalogue.ts b/lib/routes/jinse/catalogue.ts index 36db60756014b4..3fadc032736d4c 100644 --- a/lib/routes/jinse/catalogue.ts +++ b/lib/routes/jinse/catalogue.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const categories = { zhengce: '政策', diff --git a/lib/routes/jinse/lives.ts b/lib/routes/jinse/lives.ts index b29c5dcc584714..ed2cb67a493d19 100644 --- a/lib/routes/jinse/lives.ts +++ b/lib/routes/jinse/lives.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const categories = { 0: '全部', diff --git a/lib/routes/jinse/timeline.ts b/lib/routes/jinse/timeline.ts index d1fc3ea0233918..ff7532a332b8c1 100644 --- a/lib/routes/jinse/timeline.ts +++ b/lib/routes/jinse/timeline.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/timeline/:category?', diff --git a/lib/routes/jjwxc/author.ts b/lib/routes/jjwxc/author.ts index f1ce2d1f52936d..5cbf9751feb568 100644 --- a/lib/routes/jjwxc/author.ts +++ b/lib/routes/jjwxc/author.ts @@ -8,7 +8,7 @@ import iconv from 'iconv-lite'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/author/:id?', diff --git a/lib/routes/jjwxc/book.ts b/lib/routes/jjwxc/book.ts index e82bc67f05ff81..dcfa370563ae9b 100644 --- a/lib/routes/jjwxc/book.ts +++ b/lib/routes/jjwxc/book.ts @@ -9,7 +9,7 @@ import iconv from 'iconv-lite'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/book/:id?', diff --git a/lib/routes/jpxgmn/utils.ts b/lib/routes/jpxgmn/utils.ts index d03d52f44c1fdd..3efb133c3bc275 100644 --- a/lib/routes/jpxgmn/utils.ts +++ b/lib/routes/jpxgmn/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; const originUrl = 'http://www.jpxgmn.com'; diff --git a/lib/routes/jump/discount.ts b/lib/routes/jump/discount.ts index 533961ea7d74b0..301595cdf5f386 100644 --- a/lib/routes/jump/discount.ts +++ b/lib/routes/jump/discount.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import 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/routes/kamen-rider-official/news.ts b/lib/routes/kamen-rider-official/news.ts index 7a3d3786dc5102..164d6add590630 100644 --- a/lib/routes/kamen-rider-official/news.ts +++ b/lib/routes/kamen-rider-official/news.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/news/:category?', diff --git a/lib/routes/kantarworldpanel/index.ts b/lib/routes/kantarworldpanel/index.ts index cd6bf7412de061..9b9e378c6117da 100644 --- a/lib/routes/kantarworldpanel/index.ts +++ b/lib/routes/kantarworldpanel/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:region?/:category{.+}?', diff --git a/lib/routes/kcna/news.ts b/lib/routes/kcna/news.ts index 1514ae582587bd..66bc4493974e79 100644 --- a/lib/routes/kcna/news.ts +++ b/lib/routes/kcna/news.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import asyncPool from 'tiny-async-pool'; import { art } from '@/utils/render'; import { parseJucheDate, fixDesc, fetchPhoto, fetchVideo } from './utils'; -import * as path from 'node:path'; +import path from 'node:path'; import sanitizeHtml from 'sanitize-html'; export const route: Route = { diff --git a/lib/routes/keep/user.ts b/lib/routes/keep/user.ts index 4a8b86ed31f156..fa2fc31efb6e99 100644 --- a/lib/routes/keep/user.ts +++ b/lib/routes/keep/user.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/user/:id', diff --git a/lib/routes/kemono/index.ts b/lib/routes/kemono/index.ts index 16ecf3be620366..326bb2b5bb675d 100644 --- a/lib/routes/kemono/index.ts +++ b/lib/routes/kemono/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:source?/:id?', diff --git a/lib/routes/kepu/live.ts b/lib/routes/kepu/live.ts index 586d9c4b1f38a4..dfbe66206f8519 100644 --- a/lib/routes/kepu/live.ts +++ b/lib/routes/kepu/live.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/live', diff --git a/lib/routes/kyodonews/index.ts b/lib/routes/kyodonews/index.ts index afbf71156fd556..5e71ddee8b4b38 100644 --- a/lib/routes/kyodonews/index.ts +++ b/lib/routes/kyodonews/index.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const resolveRelativeLink = (link, baseUrl) => (link.startsWith('http') ? link : `${baseUrl}${link}`); diff --git a/lib/routes/lang/room.ts b/lib/routes/lang/room.ts index d5f46bd80d9aec..d368cdd960850e 100644 --- a/lib/routes/lang/room.ts +++ b/lib/routes/lang/room.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/live/room/:id', diff --git a/lib/routes/lanqiao/utils.ts b/lib/routes/lanqiao/utils.ts index 1e289f22fbf5e7..71cb3e6b62a465 100644 --- a/lib/routes/lanqiao/utils.ts +++ b/lib/routes/lanqiao/utils.ts @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const courseDesc = (picurl, desc) => art(path.join(__dirname, 'templates/courseDesc.art'), { diff --git a/lib/routes/learnku/topic.ts b/lib/routes/learnku/topic.ts index ad6da0de363574..12654175fabd95 100644 --- a/lib/routes/learnku/topic.ts +++ b/lib/routes/learnku/topic.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; export const route: Route = { diff --git a/lib/routes/leetcode/dailyquestion-cn.ts b/lib/routes/leetcode/dailyquestion-cn.ts index 29fd9d1fb0c487..66b018673f9af9 100644 --- a/lib/routes/leetcode/dailyquestion-cn.ts +++ b/lib/routes/leetcode/dailyquestion-cn.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const host = 'https://leetcode.cn'; diff --git a/lib/routes/leetcode/dailyquestion-en.ts b/lib/routes/leetcode/dailyquestion-en.ts index a02345535c3f47..3243aef2fab63d 100644 --- a/lib/routes/leetcode/dailyquestion-en.ts +++ b/lib/routes/leetcode/dailyquestion-en.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const host = 'https://leetcode.com'; diff --git a/lib/routes/leetcode/dailyquestion-solution-en.ts b/lib/routes/leetcode/dailyquestion-solution-en.ts index 33dcd08fe8aa05..3405ec68945b4d 100644 --- a/lib/routes/leetcode/dailyquestion-solution-en.ts +++ b/lib/routes/leetcode/dailyquestion-solution-en.ts @@ -7,7 +7,7 @@ const md = MarkdownIt({ }); import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/dailyquestion/solution/en', radar: [ diff --git a/lib/routes/lfsyd/utils.ts b/lib/routes/lfsyd/utils.ts index 75dd8a12aebf44..df89c42dda6746 100644 --- a/lib/routes/lfsyd/utils.ts +++ b/lib/routes/lfsyd/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import { load } from 'cheerio'; import got from '@/utils/got'; import md5 from '@/utils/md5'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const rootUrl = 'https://www.iyingdi.com'; diff --git a/lib/routes/linkedin/cn/utils.ts b/lib/routes/linkedin/cn/utils.ts index 4da23a8520c4be..0b62b133b927c6 100644 --- a/lib/routes/linkedin/cn/utils.ts +++ b/lib/routes/linkedin/cn/utils.ts @@ -3,7 +3,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import crypto from 'crypto'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import got from '@/utils/got'; import { parseAttr } from './renderer'; diff --git a/lib/routes/lkong/forum.ts b/lib/routes/lkong/forum.ts index 8a3c5c240c5541..0d811fe1785bb2 100644 --- a/lib/routes/lkong/forum.ts +++ b/lib/routes/lkong/forum.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { viewForum, viewThread } from './query'; diff --git a/lib/routes/lkong/thread.ts b/lib/routes/lkong/thread.ts index 3a5e7657acdbf6..2905f5e079cc14 100644 --- a/lib/routes/lkong/thread.ts +++ b/lib/routes/lkong/thread.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { viewThread, countReplies } from './query'; diff --git a/lib/routes/logclub/index.ts b/lib/routes/logclub/index.ts index 16661d1de1c595..45b2d3669e2b3d 100644 --- a/lib/routes/logclub/index.ts +++ b/lib/routes/logclub/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:category{.+}?', diff --git a/lib/routes/logclub/report.ts b/lib/routes/logclub/report.ts index 0959d46bb99dff..6a2e708d828002 100644 --- a/lib/routes/logclub/report.ts +++ b/lib/routes/logclub/report.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: ['/lc_report/:id?', '/report/:id?'], diff --git a/lib/routes/logonews/index.ts b/lib/routes/logonews/index.ts index e2b411b0860b12..bc234e7ca8eea7 100644 --- a/lib/routes/logonews/index.ts +++ b/lib/routes/logonews/index.ts @@ -8,7 +8,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: ['/work/tags/:tag', '/tag/:tag', '*'], diff --git a/lib/routes/loltw/news.ts b/lib/routes/loltw/news.ts index 5a1bc43700a025..35e405f2786449 100644 --- a/lib/routes/loltw/news.ts +++ b/lib/routes/loltw/news.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/news/:category?', diff --git a/lib/routes/lovelive-anime/news.ts b/lib/routes/lovelive-anime/news.ts index f37d23bae11556..a5fe06a03893e9 100644 --- a/lib/routes/lovelive-anime/news.ts +++ b/lib/routes/lovelive-anime/news.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const renderDescription = (desc) => art(path.join(__dirname, 'templates/description.art'), desc); diff --git a/lib/routes/lovelive-anime/schedules.ts b/lib/routes/lovelive-anime/schedules.ts index e76a0fe1664e1f..0e8b5fce24a452 100644 --- a/lib/routes/lovelive-anime/schedules.ts +++ b/lib/routes/lovelive-anime/schedules.ts @@ -3,7 +3,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const renderDescription = (desc) => art(path.join(__dirname, 'templates/scheduleDesc.art'), desc); import dayjs from 'dayjs'; diff --git a/lib/routes/lovelive-anime/topics.ts b/lib/routes/lovelive-anime/topics.ts index a6e009e735f5e0..67de791dba732d 100644 --- a/lib/routes/lovelive-anime/topics.ts +++ b/lib/routes/lovelive-anime/topics.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import 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/routes/lvv2/news.ts b/lib/routes/lvv2/news.ts index 55c59bd76f8dc7..9328eee16b7f74 100644 --- a/lib/routes/lvv2/news.ts +++ b/lib/routes/lvv2/news.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://lvv2.com'; diff --git a/lib/routes/lvv2/top.ts b/lib/routes/lvv2/top.ts index 9afd943b788ce1..fd42254408892c 100644 --- a/lib/routes/lvv2/top.ts +++ b/lib/routes/lvv2/top.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://lvv2.com'; diff --git a/lib/routes/lxixsxa/discography.ts b/lib/routes/lxixsxa/discography.ts index cfdd6d60c3f010..2999199baa196a 100644 --- a/lib/routes/lxixsxa/discography.ts +++ b/lib/routes/lxixsxa/discography.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { parseJSONP } from './jsonp-helper'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/disco', diff --git a/lib/routes/lxixsxa/information.ts b/lib/routes/lxixsxa/information.ts index a3dc602bed0c65..74a205c6265ca6 100644 --- a/lib/routes/lxixsxa/information.ts +++ b/lib/routes/lxixsxa/information.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { parseJSONP } from './jsonp-helper'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/info', diff --git a/lib/routes/m4/index.ts b/lib/routes/m4/index.ts index 6cb2fc8d6dc3f6..fe684e5fad1da7 100644 --- a/lib/routes/m4/index.ts +++ b/lib/routes/m4/index.ts @@ -9,7 +9,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:id?/:category{.+}?', diff --git a/lib/routes/magazinelib/latest-magazine.ts b/lib/routes/magazinelib/latest-magazine.ts index abdbb0519ddbe4..192821d129c6cb 100644 --- a/lib/routes/magazinelib/latest-magazine.ts +++ b/lib/routes/magazinelib/latest-magazine.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const host = 'https://magazinelib.com'; export const route: Route = { diff --git a/lib/routes/manhuagui/subscribe.ts b/lib/routes/manhuagui/subscribe.ts index 7e94c6477030af..e0679b29dbef53 100644 --- a/lib/routes/manhuagui/subscribe.ts +++ b/lib/routes/manhuagui/subscribe.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { parseRelativeDate } from '@/utils/parse-date'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; const web_url = 'https://www.manhuagui.com/user/book/shelf/1'; diff --git a/lib/routes/mdpi/journal.ts b/lib/routes/mdpi/journal.ts index 12767a78796526..b1621c376d34ef 100644 --- a/lib/routes/mdpi/journal.ts +++ b/lib/routes/mdpi/journal.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { CookieJar } from 'tough-cookie'; diff --git a/lib/routes/medium/parse-article.ts b/lib/routes/medium/parse-article.ts index e1cafce048ce34..450eead6d9ac6c 100644 --- a/lib/routes/medium/parse-article.ts +++ b/lib/routes/medium/parse-article.ts @@ -46,7 +46,7 @@ async function parse(url, cookie = '') { }; } -export default function (ctx, url) { +export default function parseArticle(ctx, url) { return cache.tryGet(`medium:article:${url}`, async () => { const { title, author, publishedTime, html } = await parse(url, config.medium.articleCookie); diff --git a/lib/routes/metacritic/index.ts b/lib/routes/metacritic/index.ts index 6dcac3344e89f7..bc20e9c9da2ec2 100644 --- a/lib/routes/metacritic/index.ts +++ b/lib/routes/metacritic/index.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { sorts, types } from './util'; diff --git a/lib/routes/metacritic/release.ts b/lib/routes/metacritic/release.ts index 7f4b0170fb3b49..2fc2d2dad176d4 100644 --- a/lib/routes/metacritic/release.ts +++ b/lib/routes/metacritic/release.ts @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { toTitleCase } from '@/utils/common-utils'; import { load } from 'cheerio'; -export default async (ctx) => { +const handler = async (ctx) => { let type = 'new-releases'; let title = 'New Releases'; @@ -51,3 +51,4 @@ export default async (ctx) => { })), }; }; +export default handler; diff --git a/lib/routes/meteor/utils.ts b/lib/routes/meteor/utils.ts index b8a5fdf64ec646..121fad2918990b 100644 --- a/lib/routes/meteor/utils.ts +++ b/lib/routes/meteor/utils.ts @@ -3,7 +3,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const baseUrl = 'https://meteor.today'; const getBoards = (tryGet) => diff --git a/lib/routes/mihoyo/bbs/follow-list.ts b/lib/routes/mihoyo/bbs/follow-list.ts index 7d6587ffd3c238..c1c6c33cadd87f 100644 --- a/lib/routes/mihoyo/bbs/follow-list.ts +++ b/lib/routes/mihoyo/bbs/follow-list.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import cache from './cache'; const renderDescription = (description, images) => art(path.join(__dirname, '../templates/description.art'), { description, images }); diff --git a/lib/routes/mihoyo/bbs/utils.ts b/lib/routes/mihoyo/bbs/utils.ts index e6cad4ab25ae8e..1e7a36781611a1 100644 --- a/lib/routes/mihoyo/bbs/utils.ts +++ b/lib/routes/mihoyo/bbs/utils.ts @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; -import * as path from 'node:path'; +import 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/routes/mihoyo/ys/news.ts b/lib/routes/mihoyo/ys/news.ts index fc60ae2728ecd5..4ae1226b4ca6f7 100644 --- a/lib/routes/mihoyo/ys/news.ts +++ b/lib/routes/mihoyo/ys/news.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const categories = { latest: { diff --git a/lib/routes/mindmeister/example.ts b/lib/routes/mindmeister/example.ts index 67d76c4d371602..e83bbc69a25a01 100644 --- a/lib/routes/mindmeister/example.ts +++ b/lib/routes/mindmeister/example.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const baseUrl = 'https://www.mindmeister.com'; export const route: Route = { diff --git a/lib/routes/mingpao/index.ts b/lib/routes/mingpao/index.ts index f24b9b82f38eb0..23447ef577db12 100644 --- a/lib/routes/mingpao/index.ts +++ b/lib/routes/mingpao/index.ts @@ -8,7 +8,7 @@ import parser from '@/utils/rss-parser'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import logger from '@/utils/logger'; const renderFanBox = (media) => diff --git a/lib/routes/missav/new.ts b/lib/routes/missav/new.ts index d916f87d002c04..d9e720deee3b5d 100644 --- a/lib/routes/missav/new.ts +++ b/lib/routes/missav/new.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/new', diff --git a/lib/routes/misskey/utils.ts b/lib/routes/misskey/utils.ts index fdcc6dd36794ad..4c8bcfdf0f2ba7 100644 --- a/lib/routes/misskey/utils.ts +++ b/lib/routes/misskey/utils.ts @@ -3,7 +3,7 @@ const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; const allowSiteList = ['misskey.io', 'madost.one', 'mk.nixnet.social']; diff --git a/lib/routes/mittrchina/index.ts b/lib/routes/mittrchina/index.ts index e1828b015010ba..2fcfb22fe87f1b 100644 --- a/lib/routes/mittrchina/index.ts +++ b/lib/routes/mittrchina/index.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:type?', diff --git a/lib/routes/modelscope/community.ts b/lib/routes/modelscope/community.ts index 34d10b78f6df24..c48c92dc77597c 100644 --- a/lib/routes/modelscope/community.ts +++ b/lib/routes/modelscope/community.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import { load } from 'cheerio'; import got from '@/utils/got'; -import * as path from 'node:path'; +import path from 'node:path'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/modelscope/datasets.ts b/lib/routes/modelscope/datasets.ts index 59c1803668c80b..47a265ff953148 100644 --- a/lib/routes/modelscope/datasets.ts +++ b/lib/routes/modelscope/datasets.ts @@ -9,7 +9,7 @@ const md = MarkdownIt({ html: true, linkify: true, }); -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/modelscope/studios.ts b/lib/routes/modelscope/studios.ts index c2fa6f1379d3a2..72382c3890631a 100644 --- a/lib/routes/modelscope/studios.ts +++ b/lib/routes/modelscope/studios.ts @@ -9,7 +9,7 @@ const md = MarkdownIt({ html: true, linkify: true, }); -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/modrinth/versions.ts b/lib/routes/modrinth/versions.ts index 57e5673b5132ac..41d0bd44fb2026 100644 --- a/lib/routes/modrinth/versions.ts +++ b/lib/routes/modrinth/versions.ts @@ -2,7 +2,7 @@ import { Route } from '@/types'; import { getCurrentPath } from '@/utils/helpers'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; import got from '@/utils/got'; import MarkdownIt from 'markdown-it'; diff --git a/lib/routes/mydrivers/index.ts b/lib/routes/mydrivers/index.ts index d9fabae918142b..843e5b65380f8a 100644 --- a/lib/routes/mydrivers/index.ts +++ b/lib/routes/mydrivers/index.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { rootUrl, title, categories, convertToQueryString, getInfo, processItems } from './util'; diff --git a/lib/routes/myfigurecollection/activity.ts b/lib/routes/myfigurecollection/activity.ts index 16c9163e234d9c..30d45321f7de5e 100644 --- a/lib/routes/myfigurecollection/activity.ts +++ b/lib/routes/myfigurecollection/activity.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; export const route: Route = { diff --git a/lib/routes/myfigurecollection/index.ts b/lib/routes/myfigurecollection/index.ts index 5491acddae5843..034a2052834e37 100644 --- a/lib/routes/myfigurecollection/index.ts +++ b/lib/routes/myfigurecollection/index.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { isValidHost } from '@/utils/valid-host'; const shortcuts = { diff --git a/lib/routes/mymusicsheet/usersheets.ts b/lib/routes/mymusicsheet/usersheets.ts index 77cd7c1df3cd31..50a2b8febd4513 100644 --- a/lib/routes/mymusicsheet/usersheets.ts +++ b/lib/routes/mymusicsheet/usersheets.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/user/sheets/:username/:iso?/:freeOnly?', diff --git a/lib/routes/natgeo/dailyphoto.ts b/lib/routes/natgeo/dailyphoto.ts index abe3c29be1938c..cca15714b29675 100644 --- a/lib/routes/natgeo/dailyphoto.ts +++ b/lib/routes/natgeo/dailyphoto.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; export const route: Route = { diff --git a/lib/routes/nationalgeographic/latest-stories.ts b/lib/routes/nationalgeographic/latest-stories.ts index a9b5bf945e61a7..77608ebd338e81 100644 --- a/lib/routes/nationalgeographic/latest-stories.ts +++ b/lib/routes/nationalgeographic/latest-stories.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const findNatgeo = ($) => JSON.parse( diff --git a/lib/routes/nautil/topics.ts b/lib/routes/nautil/topics.ts index cf14b898842f2a..116ee9c1add915 100644 --- a/lib/routes/nautil/topics.ts +++ b/lib/routes/nautil/topics.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const baseUrl = 'https://nautil.us'; export const route: Route = { diff --git a/lib/routes/nber/index.ts b/lib/routes/nber/index.ts index af7d3065c5bc2f..bcd5bfc74b9a66 100644 --- a/lib/routes/nber/index.ts +++ b/lib/routes/nber/index.ts @@ -6,7 +6,7 @@ import { getSubPath } from '@/utils/common-utils'; import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; diff --git a/lib/routes/ncc-cma/cmdp.ts b/lib/routes/ncc-cma/cmdp.ts index 3f297f448d4381..62a14b523e4f07 100644 --- a/lib/routes/ncc-cma/cmdp.ts +++ b/lib/routes/ncc-cma/cmdp.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import iconv from 'iconv-lite'; export const route: Route = { diff --git a/lib/routes/netflav/index.ts b/lib/routes/netflav/index.ts index 20382f26c3248c..e6eeffca12114f 100644 --- a/lib/routes/netflav/index.ts +++ b/lib/routes/netflav/index.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/', diff --git a/lib/routes/news/xhsxw.ts b/lib/routes/news/xhsxw.ts index 3ce94ba16fbd3a..9866e0c2aa76ec 100644 --- a/lib/routes/news/xhsxw.ts +++ b/lib/routes/news/xhsxw.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: ['/xhsxw', '/whxw'], diff --git a/lib/routes/newzmz/util.ts b/lib/routes/newzmz/util.ts index d3e95ebcbdddc7..3d301187ffaab7 100644 --- a/lib/routes/newzmz/util.ts +++ b/lib/routes/newzmz/util.ts @@ -5,7 +5,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://nzmz.xyz'; diff --git a/lib/routes/nhentai/util.ts b/lib/routes/nhentai/util.ts index b1329a29f158ba..bd1b3f0e7c5031 100644 --- a/lib/routes/nhentai/util.ts +++ b/lib/routes/nhentai/util.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const baseUrl = 'https://nhentai.net'; diff --git a/lib/routes/nhk/news-web-easy.ts b/lib/routes/nhk/news-web-easy.ts index a7cb035ee9d91b..682aede4174b27 100644 --- a/lib/routes/nhk/news-web-easy.ts +++ b/lib/routes/nhk/news-web-easy.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/news_web_easy', diff --git a/lib/routes/nhk/news.ts b/lib/routes/nhk/news.ts index 4bbf5099a7ff0e..1747220a113f64 100644 --- a/lib/routes/nhk/news.ts +++ b/lib/routes/nhk/news.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const baseUrl = 'https://www3.nhk.or.jp'; const apiUrl = 'https://nwapi.nhk.jp'; diff --git a/lib/routes/nikkei/news.ts b/lib/routes/nikkei/news.ts index e42700d26a3aab..6d3fb1c2e7dfbf 100644 --- a/lib/routes/nikkei/news.ts +++ b/lib/routes/nikkei/news.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:category/:article_type?', diff --git a/lib/routes/nintendo/direct.ts b/lib/routes/nintendo/direct.ts index fc8c794a33424a..ae8c7067ab0cd2 100644 --- a/lib/routes/nintendo/direct.ts +++ b/lib/routes/nintendo/direct.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/direct', diff --git a/lib/routes/nintendo/eshop-hk.ts b/lib/routes/nintendo/eshop-hk.ts index fa3515ba0c525c..5679f927b2e942 100644 --- a/lib/routes/nintendo/eshop-hk.ts +++ b/lib/routes/nintendo/eshop-hk.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/eshop/hk', diff --git a/lib/routes/nintendo/eshop-jp.ts b/lib/routes/nintendo/eshop-jp.ts index c34c02d3534f1c..4147d8fad820ff 100644 --- a/lib/routes/nintendo/eshop-jp.ts +++ b/lib/routes/nintendo/eshop-jp.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/eshop/jp', diff --git a/lib/routes/nintendo/eshop-us.ts b/lib/routes/nintendo/eshop-us.ts index 35181e6d56f2cd..828fc4c4e16230 100644 --- a/lib/routes/nintendo/eshop-us.ts +++ b/lib/routes/nintendo/eshop-us.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; import got from '@/utils/got'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/eshop/us', diff --git a/lib/routes/nintendo/utils.ts b/lib/routes/nintendo/utils.ts index 3918f63231fa9d..7fa07bdddf23b5 100644 --- a/lib/routes/nintendo/utils.ts +++ b/lib/routes/nintendo/utils.ts @@ -6,7 +6,7 @@ import { load } from 'cheerio'; import { JSDOM } from 'jsdom'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import dayjs from 'dayjs'; import localizedFormat from 'dayjs/plugin/localizedFormat'; import 'dayjs/locale/zh-cn'; diff --git a/lib/routes/nlc/read.ts b/lib/routes/nlc/read.ts index ecc536df7de699..a7430d10e8de41 100644 --- a/lib/routes/nlc/read.ts +++ b/lib/routes/nlc/read.ts @@ -2,7 +2,7 @@ import { Route } from '@/types'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/read/:type?', diff --git a/lib/routes/nmtv/column.ts b/lib/routes/nmtv/column.ts index 11ac0d096cbe49..9521802aef00d6 100644 --- a/lib/routes/nmtv/column.ts +++ b/lib/routes/nmtv/column.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/column/:id?', diff --git a/lib/routes/notefolio/search.ts b/lib/routes/notefolio/search.ts index a851594ee08eb0..6114db87408084 100644 --- a/lib/routes/notefolio/search.ts +++ b/lib/routes/notefolio/search.ts @@ -6,7 +6,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; // 自订的 got import { parseDate } from '@/utils/parse-date'; import dayjs from 'dayjs'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; // 分类 diff --git a/lib/routes/npm/package.ts b/lib/routes/npm/package.ts index b9df3b328fc29d..06191502475d66 100644 --- a/lib/routes/npm/package.ts +++ b/lib/routes/npm/package.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: 'package/:name{(@[a-z0-9-~][a-z0-9-._~]*/)?[a-z0-9-~][a-z0-9-._~]*}', diff --git a/lib/routes/nytimes/daily-briefing-chinese.ts b/lib/routes/nytimes/daily-briefing-chinese.ts index 31afb6f7a8c3d2..14e229e4c81171 100644 --- a/lib/routes/nytimes/daily-briefing-chinese.ts +++ b/lib/routes/nytimes/daily-briefing-chinese.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/daily_briefing_chinese', diff --git a/lib/routes/oceanengine/arithmetic-index.ts b/lib/routes/oceanengine/arithmetic-index.ts index e2f93287193c56..2f082f00af7197 100644 --- a/lib/routes/oceanengine/arithmetic-index.ts +++ b/lib/routes/oceanengine/arithmetic-index.ts @@ -7,7 +7,7 @@ import dayjs from 'dayjs'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; import puppeteer from '@/utils/puppeteer'; import { createDecipheriv } from 'node:crypto'; @@ -43,7 +43,7 @@ const getMultiKeywordHotTrend = async (page, keyword, start_date, end_date, app_ }); return p; } - return Promise.all([queryData()]).then((result) => result); + return Promise.resolve(queryData()).then((result) => result); }, e); return res[0]; }; diff --git a/lib/routes/oeeee/app/channel.ts b/lib/routes/oeeee/app/channel.ts index 125ebcafaead38..d08281ea85aa5c 100644 --- a/lib/routes/oeeee/app/channel.ts +++ b/lib/routes/oeeee/app/channel.ts @@ -8,7 +8,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { parseArticle } from '../utils'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/app/channel/:id', diff --git a/lib/routes/oeeee/app/reporter.ts b/lib/routes/oeeee/app/reporter.ts index 11b01b943fc624..66e5f5d0e381e3 100644 --- a/lib/routes/oeeee/app/reporter.ts +++ b/lib/routes/oeeee/app/reporter.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseArticle } from '../utils'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/app/reporter/:id', diff --git a/lib/routes/oeeee/web.ts b/lib/routes/oeeee/web.ts index 527efbeb4272f2..522a38ba20300c 100644 --- a/lib/routes/oeeee/web.ts +++ b/lib/routes/oeeee/web.ts @@ -8,7 +8,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { parseArticle } from './utils'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/web/:channel', diff --git a/lib/routes/oncc/index.ts b/lib/routes/oncc/index.ts index 1ed636f9f5c2ef..5e4d2d6b8d6991 100644 --- a/lib/routes/oncc/index.ts +++ b/lib/routes/oncc/index.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const rootUrl = 'https://hk.on.cc'; diff --git a/lib/routes/oncc/money18.ts b/lib/routes/oncc/money18.ts index 421e60f2fc62cf..134981847cfcb2 100644 --- a/lib/routes/oncc/money18.ts +++ b/lib/routes/oncc/money18.ts @@ -9,7 +9,7 @@ import dayjs from 'dayjs'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const sections = { exp: '新聞總覽', diff --git a/lib/routes/onet/news.ts b/lib/routes/onet/news.ts index 00bd0550001789..ee2630e8009792 100644 --- a/lib/routes/onet/news.ts +++ b/lib/routes/onet/news.ts @@ -8,7 +8,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseArticleContent, parseMainImage } from './utils'; export const route: Route = { diff --git a/lib/routes/onet/utils.ts b/lib/routes/onet/utils.ts index b6f0b91b06dfb2..c33597d2001a18 100644 --- a/lib/routes/onet/utils.ts +++ b/lib/routes/onet/utils.ts @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const parseMainImage = ($) => { const mainImage = $('figure.mainPhoto'); diff --git a/lib/routes/openai/common.ts b/lib/routes/openai/common.ts index c4d99929c0af10..fe73a141a61cde 100644 --- a/lib/routes/openai/common.ts +++ b/lib/routes/openai/common.ts @@ -5,7 +5,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const getApiUrl = async () => { const blogRootUrl = 'https://openai.com/blog'; diff --git a/lib/routes/orcid/index.ts b/lib/routes/orcid/index.ts index d26e88af501b83..678db278006d4d 100644 --- a/lib/routes/orcid/index.ts +++ b/lib/routes/orcid/index.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:id', diff --git a/lib/routes/oreno3d/main.ts b/lib/routes/oreno3d/main.ts index d16ae84ab2b17d..33ecf7aaa4b42c 100644 --- a/lib/routes/oreno3d/main.ts +++ b/lib/routes/oreno3d/main.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { load } from 'cheerio'; import get_sec_page_data from './get-sec-page-data'; diff --git a/lib/routes/oshwhub/explore.ts b/lib/routes/oshwhub/explore.ts index 1d9a41dd1a030c..a962b81c88b7e0 100644 --- a/lib/routes/oshwhub/explore.ts +++ b/lib/routes/oshwhub/explore.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/otobanana/utils.ts b/lib/routes/otobanana/utils.ts index fcbc04bf7794b4..b27a02aaf71244 100644 --- a/lib/routes/otobanana/utils.ts +++ b/lib/routes/otobanana/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const domain = 'otobanana.com'; const apiBase = `https://api.${domain}`; diff --git a/lib/routes/oup/index.ts b/lib/routes/oup/index.ts index dc52746eef726d..b4c056e476009b 100644 --- a/lib/routes/oup/index.ts +++ b/lib/routes/oup/index.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const rootUrl = 'https://academic.oup.com'; diff --git a/lib/routes/papers/index.ts b/lib/routes/papers/index.ts index 244788624146c4..80b6e7a56aa598 100644 --- a/lib/routes/papers/index.ts +++ b/lib/routes/papers/index.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:category{.+}?', diff --git a/lib/routes/patagonia/new-arrivals.ts b/lib/routes/patagonia/new-arrivals.ts index 8bf6a8e777af39..a5768bfc1cf181 100644 --- a/lib/routes/patagonia/new-arrivals.ts +++ b/lib/routes/patagonia/new-arrivals.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.patagonia.com'; const categoryMap = { diff --git a/lib/routes/penguin-random-house/utils.ts b/lib/routes/penguin-random-house/utils.ts index 7e35d9328e130e..9e8c1b45d0eeab 100644 --- a/lib/routes/penguin-random-house/utils.ts +++ b/lib/routes/penguin-random-house/utils.ts @@ -5,7 +5,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const parseBookInList = (element) => { diff --git a/lib/routes/picnob/user.ts b/lib/routes/picnob/user.ts index 8bf9b63995e88a..c64d1761630753 100644 --- a/lib/routes/picnob/user.ts +++ b/lib/routes/picnob/user.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { puppeteerGet } from './utils'; import puppeteer from '@/utils/puppeteer'; diff --git a/lib/routes/picuki/profile.ts b/lib/routes/picuki/profile.ts index b6c8b22a09aa49..98ca59f3c3fdc9 100644 --- a/lib/routes/picuki/profile.ts +++ b/lib/routes/picuki/profile.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import { load } from 'cheerio'; import * as chrono from 'chrono-node'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; import { puppeteerGet } from './utils'; import puppeteer from '@/utils/puppeteer'; diff --git a/lib/routes/pikabu/utils.ts b/lib/routes/pikabu/utils.ts index 0ab26058ea2c7c..1173c01b5e3e98 100644 --- a/lib/routes/pikabu/utils.ts +++ b/lib/routes/pikabu/utils.ts @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const baseUrl = 'https://pikabu.ru'; diff --git a/lib/routes/pixabay/search.ts b/lib/routes/pixabay/search.ts index a18ceac2a1719e..6e0a378f3bec05 100644 --- a/lib/routes/pixabay/search.ts +++ b/lib/routes/pixabay/search.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/search/:q/:order?', diff --git a/lib/routes/pnas/index.ts b/lib/routes/pnas/index.ts index 25c6de1f3d8a7a..735b01ad80005a 100644 --- a/lib/routes/pnas/index.ts +++ b/lib/routes/pnas/index.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { setCookies } from '@/utils/puppeteer-utils'; import { CookieJar } from 'tough-cookie'; import logger from '@/utils/logger'; diff --git a/lib/routes/pornhub/utils.ts b/lib/routes/pornhub/utils.ts index 6112bfc1afde7d..b3b8c68e4e85c8 100644 --- a/lib/routes/pornhub/utils.ts +++ b/lib/routes/pornhub/utils.ts @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseRelativeDate } from '@/utils/parse-date'; import dayjs from 'dayjs'; diff --git a/lib/routes/producthunt/today.ts b/lib/routes/producthunt/today.ts index 2554976a7a8621..e33fd0fa9ce5fc 100644 --- a/lib/routes/producthunt/today.ts +++ b/lib/routes/producthunt/today.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/today', diff --git a/lib/routes/ps/monthly-games.ts b/lib/routes/ps/monthly-games.ts index 066c16b23d7c44..a3c583fc16decc 100644 --- a/lib/routes/ps/monthly-games.ts +++ b/lib/routes/ps/monthly-games.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; export const route: Route = { diff --git a/lib/routes/pts/curations.ts b/lib/routes/pts/curations.ts index 3557f3c8f474c5..07b8a00cc4b6fc 100644 --- a/lib/routes/pts/curations.ts +++ b/lib/routes/pts/curations.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/curations', diff --git a/lib/routes/pts/index.ts b/lib/routes/pts/index.ts index c98290cbe29477..9a52bd5aa70f5a 100644 --- a/lib/routes/pts/index.ts +++ b/lib/routes/pts/index.ts @@ -9,7 +9,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '*', diff --git a/lib/routes/pts/live.ts b/lib/routes/pts/live.ts index fb2eaa54c8116b..26cbd184d18f8f 100644 --- a/lib/routes/pts/live.ts +++ b/lib/routes/pts/live.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/live/:id', diff --git a/lib/routes/pts/projects.ts b/lib/routes/pts/projects.ts index 583e480abdaa4c..012f5dc3ddef7e 100644 --- a/lib/routes/pts/projects.ts +++ b/lib/routes/pts/projects.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/projects', diff --git a/lib/routes/pubmed/trending.ts b/lib/routes/pubmed/trending.ts index ea176d27d6ecc1..274bd76a0f1256 100644 --- a/lib/routes/pubmed/trending.ts +++ b/lib/routes/pubmed/trending.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/trending/:filters?', diff --git a/lib/routes/qidian/author.ts b/lib/routes/qidian/author.ts index bef7e0af07f930..cb21a69d6ae995 100644 --- a/lib/routes/qidian/author.ts +++ b/lib/routes/qidian/author.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import timezone from '@/utils/timezone'; export const route: Route = { diff --git a/lib/routes/qoo-app/apps/comment.ts b/lib/routes/qoo-app/apps/comment.ts index 5c5fbf62a90908..9ca645da860fb6 100644 --- a/lib/routes/qoo-app/apps/comment.ts +++ b/lib/routes/qoo-app/apps/comment.ts @@ -8,7 +8,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { appsUrl } from '../utils'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/apps/:lang?/comment/:id', diff --git a/lib/routes/qoo-app/notes/note.ts b/lib/routes/qoo-app/notes/note.ts index f0181f3abf9df7..d4eaf7feb765d7 100644 --- a/lib/routes/qoo-app/notes/note.ts +++ b/lib/routes/qoo-app/notes/note.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { ssoUrl, notesUrl } from '../utils'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/notes/:lang?/note/:id', diff --git a/lib/routes/qoo-app/user/app-comment.ts b/lib/routes/qoo-app/user/app-comment.ts index 415b4ec96f5831..2034bb2272b92c 100644 --- a/lib/routes/qoo-app/user/app-comment.ts +++ b/lib/routes/qoo-app/user/app-comment.ts @@ -8,7 +8,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { userUrl, appsUrl } from '../utils'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/user/:lang?/appComment/:uid', diff --git a/lib/routes/qq/ac/utils.ts b/lib/routes/qq/ac/utils.ts index 1db52c7b917ff3..ae2aa424586d76 100644 --- a/lib/routes/qq/ac/utils.ts +++ b/lib/routes/qq/ac/utils.ts @@ -5,7 +5,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://ac.qq.com'; const mobileRootUrl = 'https://m.ac.qq.com'; diff --git a/lib/routes/qq/fact/index.ts b/lib/routes/qq/fact/index.ts index d9273105e11247..00c0dc6775091d 100644 --- a/lib/routes/qq/fact/index.ts +++ b/lib/routes/qq/fact/index.ts @@ -8,7 +8,7 @@ import { parseDate } from '@/utils/parse-date'; import { load } from 'cheerio'; import CryptoJS from 'crypto-js'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const getRequestToken = () => { const e = 'sgn51n6r6q97o6g3'; diff --git a/lib/routes/questmobile/report.ts b/lib/routes/questmobile/report.ts index 4d0181a4f589d4..75f07bb97f8491 100644 --- a/lib/routes/questmobile/report.ts +++ b/lib/routes/questmobile/report.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; /** * Parses a tree array and returns an array of objects containing the key-value pairs. diff --git a/lib/routes/qweather/3days.ts b/lib/routes/qweather/3days.ts index cd8134ae2a2e9a..31f674fabfeb37 100644 --- a/lib/routes/qweather/3days.ts +++ b/lib/routes/qweather/3days.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; const WEATHER_API = 'https://devapi.qweather.com/v7/weather/3d'; diff --git a/lib/routes/qweather/now.ts b/lib/routes/qweather/now.ts index db57d3a086d374..c73e227b53bd9c 100644 --- a/lib/routes/qweather/now.ts +++ b/lib/routes/qweather/now.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import 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/routes/radio/album.ts b/lib/routes/radio/album.ts index bcd726fee62363..985ff8b27a92d0 100644 --- a/lib/routes/radio/album.ts +++ b/lib/routes/radio/album.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import CryptoJS from 'crypto-js'; export const route: Route = { diff --git a/lib/routes/radio/index.ts b/lib/routes/radio/index.ts index b9b7b4471b04ea..348acada8b624e 100644 --- a/lib/routes/radio/index.ts +++ b/lib/routes/radio/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:id', diff --git a/lib/routes/radio/zhibo.ts b/lib/routes/radio/zhibo.ts index 1e7da15baf9a46..7a20c7bc423ae2 100644 --- a/lib/routes/radio/zhibo.ts +++ b/lib/routes/radio/zhibo.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import CryptoJS from 'crypto-js'; export const route: Route = { diff --git a/lib/routes/rawkuma/manga.ts b/lib/routes/rawkuma/manga.ts index cc44a2a919d500..1b8d71c8564ffb 100644 --- a/lib/routes/rawkuma/manga.ts +++ b/lib/routes/rawkuma/manga.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/manga/:id', diff --git a/lib/routes/readhub/index.ts b/lib/routes/readhub/index.ts index 1b154fd3322fa9..f78073e546b5a0 100644 --- a/lib/routes/readhub/index.ts +++ b/lib/routes/readhub/index.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; import { rootUrl, apiTopicUrl, art, processItems } from './util'; diff --git a/lib/routes/readhub/util.ts b/lib/routes/readhub/util.ts index 584f6e5ad2baab..9aabb38d4a1567 100644 --- a/lib/routes/readhub/util.ts +++ b/lib/routes/readhub/util.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import dayjs from 'dayjs'; const domain = 'readhub.cn'; diff --git a/lib/routes/reuters/common.ts b/lib/routes/reuters/common.ts index 916d94d0f6f2ad..e567df6dca4457 100644 --- a/lib/routes/reuters/common.ts +++ b/lib/routes/reuters/common.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:category/:topic?', diff --git a/lib/routes/routledge/book-series.ts b/lib/routes/routledge/book-series.ts index 720ccc9e8975ca..61f462a016db42 100644 --- a/lib/routes/routledge/book-series.ts +++ b/lib/routes/routledge/book-series.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:bookName/book-series/:bookId', diff --git a/lib/routes/rsc/journal.ts b/lib/routes/rsc/journal.ts index ff590b82ddf523..6afa2eabf5a54d 100644 --- a/lib/routes/rsc/journal.ts +++ b/lib/routes/rsc/journal.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/journal/:id/:category?', diff --git a/lib/routes/ruancan/utils.ts b/lib/routes/ruancan/utils.ts index 07f85acd951ddb..75eaeb13358c1a 100644 --- a/lib/routes/ruancan/utils.ts +++ b/lib/routes/ruancan/utils.ts @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -export default async (ctx, currentUrl) => { +const fetchFeed = async (ctx, currentUrl) => { const rootUrl = 'https://www.ruancan.com'; currentUrl = `${rootUrl}${currentUrl}`; @@ -65,3 +65,4 @@ export default async (ctx, currentUrl) => { item: items, }; }; +export default fetchFeed; diff --git a/lib/routes/saraba1st/digest.ts b/lib/routes/saraba1st/digest.ts index 4aeefd11157a31..56acfd5b6388fa 100644 --- a/lib/routes/saraba1st/digest.ts +++ b/lib/routes/saraba1st/digest.ts @@ -9,7 +9,7 @@ import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/digest/:tid', diff --git a/lib/routes/science/cover.ts b/lib/routes/science/cover.ts index 7962750f5695f2..732d84efa8865f 100644 --- a/lib/routes/science/cover.ts +++ b/lib/routes/science/cover.ts @@ -15,7 +15,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { baseUrl } from './utils'; export const route: Route = { diff --git a/lib/routes/science/utils.ts b/lib/routes/science/utils.ts index 811cb9c9dbcaac..686e9b47b4b17d 100644 --- a/lib/routes/science/utils.ts +++ b/lib/routes/science/utils.ts @@ -3,7 +3,7 @@ const __dirname = getCurrentPath(import.meta.url); import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; const baseUrl = 'https://www.science.org'; diff --git a/lib/routes/sctv/programme.ts b/lib/routes/sctv/programme.ts index b9b5b2ff76cb33..3a9dc1143320fb 100644 --- a/lib/routes/sctv/programme.ts +++ b/lib/routes/sctv/programme.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/programme/:id?/:limit?/:isFull?', diff --git a/lib/routes/sdu/extractor/index.ts b/lib/routes/sdu/extractor/index.ts index b84e4297decce7..8e58211f545594 100644 --- a/lib/routes/sdu/extractor/index.ts +++ b/lib/routes/sdu/extractor/index.ts @@ -3,7 +3,7 @@ import view from './view'; import sdrj from './sdrj'; import jwc from './wh/jwc'; -export default (link) => { +const index = (link) => { if (link.startsWith('https://xinwen.wh.sdu.edu.cn/')) { return news(link); } @@ -18,3 +18,4 @@ export default (link) => { } return {}; }; +export default index; diff --git a/lib/routes/sdu/extractor/sdrj.ts b/lib/routes/sdu/extractor/sdrj.ts index 6c9460d93c85f9..3cacd0eb6a8ed4 100644 --- a/lib/routes/sdu/extractor/sdrj.ts +++ b/lib/routes/sdu/extractor/sdrj.ts @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -export default (link) => +const sdrj = (link) => cache.tryGet(link, async () => { let content, author, exactDate; try { @@ -20,3 +20,4 @@ export default (link) => return { description: content, author, exactDate }; } }); +export default sdrj; diff --git a/lib/routes/sdu/extractor/view.ts b/lib/routes/sdu/extractor/view.ts index 7bde1bc4a0449e..bcf0118bd8d7d3 100644 --- a/lib/routes/sdu/extractor/view.ts +++ b/lib/routes/sdu/extractor/view.ts @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -export default (link) => +const view = (link) => cache.tryGet(link, async () => { let content, author, exactDate; try { @@ -20,3 +20,4 @@ export default (link) => return { description: content, author, exactDate }; } }); +export default view; diff --git a/lib/routes/sdu/extractor/wh/jwc.ts b/lib/routes/sdu/extractor/wh/jwc.ts index 1d9db782786bc3..27a322685f879b 100644 --- a/lib/routes/sdu/extractor/wh/jwc.ts +++ b/lib/routes/sdu/extractor/wh/jwc.ts @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -export default (link) => +const jwc = (link) => cache.tryGet(link, async () => { let content, exactDate; try { @@ -23,3 +23,4 @@ export default (link) => return { description: content, exactDate }; } }); +export default jwc; diff --git a/lib/routes/sdu/extractor/wh/news.ts b/lib/routes/sdu/extractor/wh/news.ts index f81e074fc9b54d..4fcda62285c091 100644 --- a/lib/routes/sdu/extractor/wh/news.ts +++ b/lib/routes/sdu/extractor/wh/news.ts @@ -4,7 +4,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -export default (link) => +const news = (link) => cache.tryGet(link, async () => { let content, author, exactDate; try { @@ -20,3 +20,4 @@ export default (link) => return { description: content, author, exactDate }; } }); +export default news; diff --git a/lib/routes/sensortower/blog.ts b/lib/routes/sensortower/blog.ts index 520ff84cb7b7a0..7bc1a161270b4b 100644 --- a/lib/routes/sensortower/blog.ts +++ b/lib/routes/sensortower/blog.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/blog/:language?', diff --git a/lib/routes/shcstheatre/programs.ts b/lib/routes/shcstheatre/programs.ts index 3c91393c2c400b..57fc8ff3083d60 100644 --- a/lib/routes/shcstheatre/programs.ts +++ b/lib/routes/shcstheatre/programs.ts @@ -8,7 +8,7 @@ import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/programs', diff --git a/lib/routes/shiep/index.ts b/lib/routes/shiep/index.ts index 7120b26a34dce7..4c783ee548d00a 100644 --- a/lib/routes/shiep/index.ts +++ b/lib/routes/shiep/index.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import dayjs from 'dayjs'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import { config } from './config'; diff --git a/lib/routes/shmtu/portal.ts b/lib/routes/shmtu/portal.ts index ab527a2cae5b44..fd37cf69238575 100644 --- a/lib/routes/shmtu/portal.ts +++ b/lib/routes/shmtu/portal.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const bootstrapHost = 'https://weixin.shmtu.edu.cn/dynamic/shmtuHttps'; diff --git a/lib/routes/shoac/recent-show.ts b/lib/routes/shoac/recent-show.ts index 243b370ca95751..5416a88fdeca44 100644 --- a/lib/routes/shoac/recent-show.ts +++ b/lib/routes/shoac/recent-show.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/shuiguopai/index.ts b/lib/routes/shuiguopai/index.ts index 155e506bebdef4..1e2faa9a392007 100644 --- a/lib/routes/shuiguopai/index.ts +++ b/lib/routes/shuiguopai/index.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/', diff --git a/lib/routes/simpleinfo/index.ts b/lib/routes/simpleinfo/index.ts index 7708d68b3c527e..265ad771fefc4e 100644 --- a/lib/routes/simpleinfo/index.ts +++ b/lib/routes/simpleinfo/index.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import timezone from '@/utils/timezone'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/sina/utils.ts b/lib/routes/sina/utils.ts index ee7c19cc5b372d..e1280dabcbbe71 100644 --- a/lib/routes/sina/utils.ts +++ b/lib/routes/sina/utils.ts @@ -6,7 +6,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const getRollNewsList = (pageid, lid, limit) => got('https://feed.mix.sina.com.cn/api/roll/get', { diff --git a/lib/routes/sinchew/index.ts b/lib/routes/sinchew/index.ts index 6e20e589ac8a59..f4c1726ffffb20 100644 --- a/lib/routes/sinchew/index.ts +++ b/lib/routes/sinchew/index.ts @@ -9,7 +9,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '*', diff --git a/lib/routes/sjtu/seiee/utils.ts b/lib/routes/sjtu/seiee/utils.ts index 2ba1d9fd971257..9cd5394beab4a7 100644 --- a/lib/routes/sjtu/seiee/utils.ts +++ b/lib/routes/sjtu/seiee/utils.ts @@ -5,7 +5,7 @@ import { parseDate } from '@/utils/parse-date'; const host = 'https://bjwb.seiee.sjtu.edu.cn'; -export default function (meta, extract) { +export default function workerFactory(meta, extract) { return async (ctx) => { const { title, local, author } = meta(ctx); diff --git a/lib/routes/sjtu/tongqu/activity.ts b/lib/routes/sjtu/tongqu/activity.ts index 912301ec40bf67..e730610683ccab 100644 --- a/lib/routes/sjtu/tongqu/activity.ts +++ b/lib/routes/sjtu/tongqu/activity.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const urlRoot = 'https://tongqu.sjtu.edu.cn'; diff --git a/lib/routes/snowpeak/us-new-arrivals.ts b/lib/routes/snowpeak/us-new-arrivals.ts index e3134ecee2f66b..9ebb56f2c3b97a 100644 --- a/lib/routes/snowpeak/us-new-arrivals.ts +++ b/lib/routes/snowpeak/us-new-arrivals.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.snowpeak.com'; export const route: Route = { diff --git a/lib/routes/sobooks/utils.ts b/lib/routes/sobooks/utils.ts index b3b6fe60371b4f..9fb9620c417aab 100644 --- a/lib/routes/sobooks/utils.ts +++ b/lib/routes/sobooks/utils.ts @@ -3,7 +3,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -export default async (ctx, currentUrl) => { +const utils = async (ctx, currentUrl) => { const rootUrl = 'https://www.sobooks.net'; currentUrl = `${rootUrl}/${currentUrl}`; const response = await got({ @@ -49,3 +49,4 @@ export default async (ctx, currentUrl) => { item: items, }; }; +export default utils; diff --git a/lib/routes/sogou/search.ts b/lib/routes/sogou/search.ts index 98de3fca05c801..96ff94c63b5df3 100644 --- a/lib/routes/sogou/search.ts +++ b/lib/routes/sogou/search.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; diff --git a/lib/routes/sohu/mp.ts b/lib/routes/sohu/mp.ts index 5a198eefcc3ec2..8a6ca2f05c6123 100644 --- a/lib/routes/sohu/mp.ts +++ b/lib/routes/sohu/mp.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; export const route: Route = { diff --git a/lib/routes/southcn/nfapp/column.ts b/lib/routes/southcn/nfapp/column.ts index d044a5e60250c9..0833e8f960d81c 100644 --- a/lib/routes/southcn/nfapp/column.ts +++ b/lib/routes/southcn/nfapp/column.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseArticle } from './utils'; export const route: Route = { diff --git a/lib/routes/southcn/nfapp/reporter.ts b/lib/routes/southcn/nfapp/reporter.ts index eb5cc62bd5aed1..4adb4401d59525 100644 --- a/lib/routes/southcn/nfapp/reporter.ts +++ b/lib/routes/southcn/nfapp/reporter.ts @@ -8,7 +8,7 @@ import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; import { parseArticle } from './utils'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/nfapp/reporter/:reporter', diff --git a/lib/routes/springer/journal.ts b/lib/routes/springer/journal.ts index 452a5ac7bf0ebe..6a6a24284438cc 100644 --- a/lib/routes/springer/journal.ts +++ b/lib/routes/springer/journal.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { CookieJar } from 'tough-cookie'; diff --git a/lib/routes/sse/inquire.ts b/lib/routes/sse/inquire.ts index 0e2a812a52b68b..43882c2c37de5d 100644 --- a/lib/routes/sse/inquire.ts +++ b/lib/routes/sse/inquire.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/inquire', diff --git a/lib/routes/sse/renewal.ts b/lib/routes/sse/renewal.ts index 77d296c7e7f635..ab3d6150c08133 100644 --- a/lib/routes/sse/renewal.ts +++ b/lib/routes/sse/renewal.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import dayjs from 'dayjs'; import localizedFormat from 'dayjs/plugin/localizedFormat'; import 'dayjs/locale/zh-cn'; diff --git a/lib/routes/ssm/news.ts b/lib/routes/ssm/news.ts index 4f1bf58e542663..d2da91ffd9bc92 100644 --- a/lib/routes/ssm/news.ts +++ b/lib/routes/ssm/news.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const rootUrl = `https://www.ssm.gov.mo`; diff --git a/lib/routes/stdaily/digitalpaper.ts b/lib/routes/stdaily/digitalpaper.ts index b35f2fe2b84493..edc2389f12f0f0 100644 --- a/lib/routes/stdaily/digitalpaper.ts +++ b/lib/routes/stdaily/digitalpaper.ts @@ -3,7 +3,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import got from '@/utils/got'; import { load } from 'cheerio'; diff --git a/lib/routes/storyfm/episodes.ts b/lib/routes/storyfm/episodes.ts index 43f43cbb5b3604..d5bad3cf6c1918 100644 --- a/lib/routes/storyfm/episodes.ts +++ b/lib/routes/storyfm/episodes.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/episodes', diff --git a/lib/routes/surfshark/blog.ts b/lib/routes/surfshark/blog.ts index c908a62aa65195..ce381b04a9b3d5 100644 --- a/lib/routes/surfshark/blog.ts +++ b/lib/routes/surfshark/blog.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/blog/:category{.+}?', diff --git a/lib/routes/swjtu/utils.ts b/lib/routes/swjtu/utils.ts index c7598fbbed1d0b..e6ed5e47326bce 100644 --- a/lib/routes/swjtu/utils.ts +++ b/lib/routes/swjtu/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; const renderDetail = (jobs) => art(path.join(__dirname, 'templates/job_detail.art'), { jobs }); const renderDesc = (intro) => diff --git a/lib/routes/szse/inquire.ts b/lib/routes/szse/inquire.ts index 5832a40f303c3e..7d105d467a61a5 100644 --- a/lib/routes/szse/inquire.ts +++ b/lib/routes/szse/inquire.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/inquire/:category?/:select?/:keyword?', diff --git a/lib/routes/szse/projectdynamic.ts b/lib/routes/szse/projectdynamic.ts index 1ed5ac60bad1ae..116db6a196d7dc 100644 --- a/lib/routes/szse/projectdynamic.ts +++ b/lib/routes/szse/projectdynamic.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/projectdynamic/:type?/:stage?/:status?', diff --git a/lib/routes/taobao/zhongchou.ts b/lib/routes/taobao/zhongchou.ts index 15d4af9b3fd27c..2e92886bf0ec28 100644 --- a/lib/routes/taobao/zhongchou.ts +++ b/lib/routes/taobao/zhongchou.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/zhongchou/:type?', diff --git a/lib/routes/taptap/utils.ts b/lib/routes/taptap/utils.ts index 6f10b14d61c3d3..9c7ff36f88471d 100644 --- a/lib/routes/taptap/utils.ts +++ b/lib/routes/taptap/utils.ts @@ -3,7 +3,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; // Please do not change %26 to & diff --git a/lib/routes/telegram/channel.ts b/lib/routes/telegram/channel.ts index edee2f823f37aa..306c40cdbb2006 100644 --- a/lib/routes/telegram/channel.ts +++ b/lib/routes/telegram/channel.ts @@ -8,7 +8,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import querystring from 'querystring'; import { fallback, queryToBoolean } from '@/utils/readable-social'; import tglibchannel from './tglib/channel'; diff --git a/lib/routes/tencent/news/author.ts b/lib/routes/tencent/news/author.ts index 2e1008a6c4e863..c0bd95a0a19a7b 100644 --- a/lib/routes/tencent/news/author.ts +++ b/lib/routes/tencent/news/author.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { config } from '@/config'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/news/author/:mid', diff --git a/lib/routes/tencent/news/coronavirus/data.ts b/lib/routes/tencent/news/coronavirus/data.ts index 26970366572a54..8b08bb410f6497 100644 --- a/lib/routes/tencent/news/coronavirus/data.ts +++ b/lib/routes/tencent/news/coronavirus/data.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import { getData } from './utils'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/news/coronavirus/data/:province?/:city?', diff --git a/lib/routes/tencent/news/coronavirus/total.ts b/lib/routes/tencent/news/coronavirus/total.ts index 9a7a8a91b882ec..acacede888a536 100644 --- a/lib/routes/tencent/news/coronavirus/total.ts +++ b/lib/routes/tencent/news/coronavirus/total.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import { getData } from './utils'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/news/coronavirus/total', diff --git a/lib/routes/tesla/cx.ts b/lib/routes/tesla/cx.ts index 4644cdc722bc00..63e1c83ad2cfbc 100644 --- a/lib/routes/tesla/cx.ts +++ b/lib/routes/tesla/cx.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/cx/:category?/:city?', diff --git a/lib/routes/tfc-taiwan/utils.ts b/lib/routes/tfc-taiwan/utils.ts index 81abe1ce567988..e2900bde4974bb 100644 --- a/lib/routes/tfc-taiwan/utils.ts +++ b/lib/routes/tfc-taiwan/utils.ts @@ -3,7 +3,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import asyncPool from 'tiny-async-pool'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/theatlantic/utils.ts b/lib/routes/theatlantic/utils.ts index 1b58534bb44686..f0dc4c2da9b079 100644 --- a/lib/routes/theatlantic/utils.ts +++ b/lib/routes/theatlantic/utils.ts @@ -6,7 +6,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import randUserAgent from '@/utils/rand-user-agent'; const UA = randUserAgent({ browser: 'chrome', os: 'android', device: 'mobile' }); diff --git a/lib/routes/themoviedb/api-key.ts b/lib/routes/themoviedb/api-key.ts index 7fb32ddf3ab273..3589105ce92796 100644 --- a/lib/routes/themoviedb/api-key.ts +++ b/lib/routes/themoviedb/api-key.ts @@ -20,4 +20,5 @@ const KEYS = [ '09ad8ace66eec34302943272db0e8d2c', ]; -export default () => KEYS[Math.floor(Math.random() * KEYS.length)]; +const keys = () => KEYS[Math.floor(Math.random() * KEYS.length)]; +export default keys; diff --git a/lib/routes/themoviedb/utils.ts b/lib/routes/themoviedb/utils.ts index d9740a39cdb948..d586870e988b9a 100644 --- a/lib/routes/themoviedb/utils.ts +++ b/lib/routes/themoviedb/utils.ts @@ -1,7 +1,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/thenewslens/index.ts b/lib/routes/thenewslens/index.ts index 6d75446046af49..73fc3b1332c9a3 100644 --- a/lib/routes/thenewslens/index.ts +++ b/lib/routes/thenewslens/index.ts @@ -8,7 +8,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '*', diff --git a/lib/routes/thepaper/factpaper.ts b/lib/routes/thepaper/factpaper.ts index 14bd34d6df0485..44639088b07e04 100644 --- a/lib/routes/thepaper/factpaper.ts +++ b/lib/routes/thepaper/factpaper.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/factpaper/:status?', diff --git a/lib/routes/thepaper/utils.ts b/lib/routes/thepaper/utils.ts index ae28586a909521..177f3ea247f2d3 100644 --- a/lib/routes/thepaper/utils.ts +++ b/lib/routes/thepaper/utils.ts @@ -6,7 +6,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const defaultRssItem = (item) => ({ title: item.name, diff --git a/lib/routes/thoughtco/index.ts b/lib/routes/thoughtco/index.ts index 17c1dbe7f54efe..bea5e6cc57caa2 100644 --- a/lib/routes/thoughtco/index.ts +++ b/lib/routes/thoughtco/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:category?', diff --git a/lib/routes/tiktok/user.ts b/lib/routes/tiktok/user.ts index 4c0e713ecc1d62..5fac463f237074 100644 --- a/lib/routes/tiktok/user.ts +++ b/lib/routes/tiktok/user.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { queryToBoolean } from '@/utils/readable-social'; import puppeteer from '@/utils/puppeteer'; diff --git a/lib/routes/tingshuitz/shenzhen.ts b/lib/routes/tingshuitz/shenzhen.ts index 47aee57a4be3f4..8d7609ba564a89 100644 --- a/lib/routes/tingshuitz/shenzhen.ts +++ b/lib/routes/tingshuitz/shenzhen.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/shenzhen', diff --git a/lib/routes/tingtingfm/program.ts b/lib/routes/tingtingfm/program.ts index 633c4ccbc611e9..d39fcdeb665315 100644 --- a/lib/routes/tingtingfm/program.ts +++ b/lib/routes/tingtingfm/program.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { getClientVal, sign } from './utils'; diff --git a/lib/routes/tophub/list.ts b/lib/routes/tophub/list.ts index 669e96be7ad2d3..975c21e79333aa 100644 --- a/lib/routes/tophub/list.ts +++ b/lib/routes/tophub/list.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { config } from '@/config'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; export const route: Route = { diff --git a/lib/routes/tradingview/blog.ts b/lib/routes/tradingview/blog.ts index 61acfa12b7a48e..622dd83dc37298 100644 --- a/lib/routes/tradingview/blog.ts +++ b/lib/routes/tradingview/blog.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import asyncPool from 'tiny-async-pool'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/blog/:category{.+}?', diff --git a/lib/routes/transcriptforest/index.ts b/lib/routes/transcriptforest/index.ts index 477512e65a9abd..144c4209e2bf84 100644 --- a/lib/routes/transcriptforest/index.ts +++ b/lib/routes/transcriptforest/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const bakeTimestamp = (seconds) => { const hours = Math.floor(seconds / 3600); diff --git a/lib/routes/trending/all-trending.ts b/lib/routes/trending/all-trending.ts index 8bfaa312adfc97..31d15f3cfd8480 100644 --- a/lib/routes/trending/all-trending.ts +++ b/lib/routes/trending/all-trending.ts @@ -10,7 +10,7 @@ dayjs.extend(utc); dayjs.extend(timezone); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; import md5 from '@/utils/md5'; diff --git a/lib/routes/tribalfootball/latest.ts b/lib/routes/tribalfootball/latest.ts index 8d6a21e61f3ffa..a87986a637b44b 100644 --- a/lib/routes/tribalfootball/latest.ts +++ b/lib/routes/tribalfootball/latest.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import cache from '@/utils/cache'; import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; diff --git a/lib/routes/tvb/news.ts b/lib/routes/tvb/news.ts index 544b5b994f4ce2..07195ba0c52722 100644 --- a/lib/routes/tvb/news.ts +++ b/lib/routes/tvb/news.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const titles = { focus: { diff --git a/lib/routes/tvtropes/featured.ts b/lib/routes/tvtropes/featured.ts index 0a0621d006df8d..69586bb9abf393 100644 --- a/lib/routes/tvtropes/featured.ts +++ b/lib/routes/tvtropes/featured.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const categories = { today: 'left', diff --git a/lib/routes/twitter/api/developer-api/search.ts b/lib/routes/twitter/api/developer-api/search.ts index f3162e2fdf7eb8..5a9fc81b47ee1d 100644 --- a/lib/routes/twitter/api/developer-api/search.ts +++ b/lib/routes/twitter/api/developer-api/search.ts @@ -1,6 +1,6 @@ import utils from '../../utils'; -export default async (ctx) => { +const handler = async (ctx) => { const keyword = ctx.req.param('keyword'); const limit = ctx.req.query('limit') ?? 50; const client = await utils.getAppClient(); @@ -20,3 +20,4 @@ export default async (ctx) => { allowEmpty: true, }; }; +export default handler; diff --git a/lib/routes/twitter/api/developer-api/user.ts b/lib/routes/twitter/api/developer-api/user.ts index a5c94712fddbce..2d94a7165533f6 100644 --- a/lib/routes/twitter/api/developer-api/user.ts +++ b/lib/routes/twitter/api/developer-api/user.ts @@ -1,6 +1,6 @@ import utils from '../../utils'; -export default async (ctx) => { +const handler = async (ctx) => { const id = ctx.req.param('id'); // For compatibility const { exclude_replies, include_rts, count } = utils.parseRouteParams(ctx.req.param('routeParams')); @@ -35,3 +35,4 @@ export default async (ctx) => { }), }; }; +export default handler; diff --git a/lib/routes/twreporter/fetch-article.ts b/lib/routes/twreporter/fetch-article.ts index cf9cfee8c45ba7..035fbbf85effc5 100644 --- a/lib/routes/twreporter/fetch-article.ts +++ b/lib/routes/twreporter/fetch-article.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export default async function fetch(slug: string) { const url = `https://go-api.twreporter.org/v2/posts/${slug}?full=true`; diff --git a/lib/routes/txrjy/fornumtopic.ts b/lib/routes/txrjy/fornumtopic.ts index e8bb7e9b486e30..f384ff1842f54f 100644 --- a/lib/routes/txrjy/fornumtopic.ts +++ b/lib/routes/txrjy/fornumtopic.ts @@ -9,7 +9,7 @@ import iconv from 'iconv-lite'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://www.txrjy.com'; diff --git a/lib/routes/udn/breaking-news.ts b/lib/routes/udn/breaking-news.ts index 797a996f732c06..9fa1080695a538 100644 --- a/lib/routes/udn/breaking-news.ts +++ b/lib/routes/udn/breaking-news.ts @@ -8,7 +8,7 @@ import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/news/breakingnews/:id', diff --git a/lib/routes/uptimerobot/rss.ts b/lib/routes/uptimerobot/rss.ts index e3697b62292e1d..5bb7bc23b09bfa 100644 --- a/lib/routes/uptimerobot/rss.ts +++ b/lib/routes/uptimerobot/rss.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import Parser from 'rss-parser'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import dayjs from 'dayjs'; import { fallback, queryToBoolean } from '@/utils/readable-social'; diff --git a/lib/routes/urbandictionary/random.ts b/lib/routes/urbandictionary/random.ts index c65c0123ba192a..e6ec9a48f57edb 100644 --- a/lib/routes/urbandictionary/random.ts +++ b/lib/routes/urbandictionary/random.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/random', diff --git a/lib/routes/utgd/category.ts b/lib/routes/utgd/category.ts index 4e4c45f268019c..30d738f720f2ef 100644 --- a/lib/routes/utgd/category.ts +++ b/lib/routes/utgd/category.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import MarkdownIt from 'markdown-it'; const md = MarkdownIt({ html: true, diff --git a/lib/routes/utgd/timeline.ts b/lib/routes/utgd/timeline.ts index 09a4592ef7db71..cd3d147787788a 100644 --- a/lib/routes/utgd/timeline.ts +++ b/lib/routes/utgd/timeline.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import MarkdownIt from 'markdown-it'; const md = MarkdownIt({ html: true, diff --git a/lib/routes/utgd/topic.ts b/lib/routes/utgd/topic.ts index 5504a4be8b3fef..17ce8d3ebbfdcd 100644 --- a/lib/routes/utgd/topic.ts +++ b/lib/routes/utgd/topic.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import MarkdownIt from 'markdown-it'; const md = MarkdownIt({ html: true, diff --git a/lib/routes/vcb-s/category.ts b/lib/routes/vcb-s/category.ts index f7a421c250d9e9..2ab017c39270de 100644 --- a/lib/routes/vcb-s/category.ts +++ b/lib/routes/vcb-s/category.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://vcb-s.com'; const cateAPIUrl = `${rootUrl}/wp-json/wp/v2/categories`; diff --git a/lib/routes/vcb-s/index.ts b/lib/routes/vcb-s/index.ts index 333a6e13f10a65..9e9106305cb231 100644 --- a/lib/routes/vcb-s/index.ts +++ b/lib/routes/vcb-s/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://vcb-s.com'; const postsAPIUrl = `${rootUrl}/wp-json/wp/v2/posts`; diff --git a/lib/routes/vimeo/category.ts b/lib/routes/vimeo/category.ts index a3700b803e7343..b8069104c790de 100644 --- a/lib/routes/vimeo/category.ts +++ b/lib/routes/vimeo/category.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/category/:category/:staffpicks?', diff --git a/lib/routes/vimeo/channel.ts b/lib/routes/vimeo/channel.ts index a245c8542ab84e..5578c640c54b3e 100644 --- a/lib/routes/vimeo/channel.ts +++ b/lib/routes/vimeo/channel.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/channel/:channel', diff --git a/lib/routes/vimeo/usr-videos.ts b/lib/routes/vimeo/usr-videos.ts index eb1faf9a9f1ea0..bd16a4a670b799 100644 --- a/lib/routes/vimeo/usr-videos.ts +++ b/lib/routes/vimeo/usr-videos.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/user/:username/:cat?', diff --git a/lib/routes/wallpaperhub/index.ts b/lib/routes/wallpaperhub/index.ts index dfe0a6add5efde..ea7371adbc665b 100644 --- a/lib/routes/wallpaperhub/index.ts +++ b/lib/routes/wallpaperhub/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/', diff --git a/lib/routes/wallstreetcn/live.ts b/lib/routes/wallstreetcn/live.ts index 05d20027802bf0..02a7c7f5f8a309 100644 --- a/lib/routes/wallstreetcn/live.ts +++ b/lib/routes/wallstreetcn/live.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const titles = { global: '要闻', diff --git a/lib/routes/warthunder/news.ts b/lib/routes/warthunder/news.ts index 17fa321de7257d..cb7432d3177493 100644 --- a/lib/routes/warthunder/news.ts +++ b/lib/routes/warthunder/news.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; diff --git a/lib/routes/wechat/feeddd.ts b/lib/routes/wechat/feeddd.ts index 97a4a52c3309fc..f9dede4d29cd34 100644 --- a/lib/routes/wechat/feeddd.ts +++ b/lib/routes/wechat/feeddd.ts @@ -2,7 +2,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { finishArticleItem } from '@/utils/wechat-mp'; -export default async (ctx) => { +const handler = async (ctx) => { const id = ctx.req.param('id'); const baseUrl = 'https://feed.hamibot.com'; @@ -29,19 +29,20 @@ export default async (ctx) => { items = await Promise.all(items.map((item) => finishArticleItem(item))); - return { + ctx.set('json', { title: response.data.title, link: response.data.feed_url, + image: 'https://mp.weixin.qq.com/favicon.ico', description: response.data.title, item: items, - allowEmpty: true, - }; + }); - ctx.set('json', { + return { title: response.data.title, link: response.data.feed_url, - image: 'https://mp.weixin.qq.com/favicon.ico', description: response.data.title, item: items, - }); + allowEmpty: true, + }; }; +export default handler; diff --git a/lib/routes/wechat/feeds.ts b/lib/routes/wechat/feeds.ts deleted file mode 100644 index e709d9d7a5f6b7..00000000000000 --- a/lib/routes/wechat/feeds.ts +++ /dev/null @@ -1,23 +0,0 @@ -import parser from '@/utils/rss-parser'; -import { finishArticleItem } from '@/utils/wechat-mp'; - -export default async (ctx) => { - const id = ctx.req.param('id'); - const link = `https://github.com/hellodword/wechat-feeds/raw/feeds/${id}.xml`; - const feed = await parser.parseURL(link); - - const items = feed.items.map((item) => ({ - title: item.title, - pubDate: new Date(item.pubDate), - link: item.link, - guid: item.link, - })); - await Promise.all(items.map((item) => finishArticleItem(item))); - - return { - title: feed.title, - link, - description: feed.description, - item: items, - }; -}; diff --git a/lib/routes/wechat/wxnmh.ts b/lib/routes/wechat/wxnmh.ts deleted file mode 100644 index 494207ce4e10cf..00000000000000 --- a/lib/routes/wechat/wxnmh.ts +++ /dev/null @@ -1,45 +0,0 @@ -import cache from '@/utils/cache'; -import got from '@/utils/got'; -import { load } from 'cheerio'; -import { parseRelativeDate } from '@/utils/parse-date'; - -export default async (ctx) => { - const origin = 'https://www.wxnmh.com/'; - const response = await got.get(`${origin}user-${ctx.req.param('id')}.htm`); - const $ = load(response.data); - - const name = $('#body .col-lg-9 .card-block .col-md-9 h3').text().trim(); - const description = $('#body .col-lg-9 .card-block .col-md-9 p').text().trim(); - - const links = $('#body tr.thread .subject a') - .map((index, ele) => { - const title = $(ele).text(); - const link = origin + $(ele).attr('href'); - return { title, link }; - }) - .get(); - - const item = await Promise.all( - links.map((item) => - cache.tryGet(item.link, async () => { - try { - const res = await got.get(item.link); - const $ = load(res.data); - const desc = $('#js_content').html().replaceAll('data-src="http', 'src="http'); - item.description = `
${desc}
`; - item.pubDate = parseRelativeDate($('.date').text()); - return item; - } catch { - return ''; - } - }) - ) - ); - - return { - title: `${name} - 微信公众号`, - link: 'https://www.wxnmh.com/', - description, - item, - }; -}; diff --git a/lib/routes/weibo/search/hot.ts b/lib/routes/weibo/search/hot.ts index 6dd5137d1bf93b..3656a4f718a55c 100644 --- a/lib/routes/weibo/search/hot.ts +++ b/lib/routes/weibo/search/hot.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { art } from '@/utils/render'; import { load } from 'cheerio'; -import * as path from 'node:path'; +import path from 'node:path'; // import weiboUtils from '../utils'; // Default hide all picture diff --git a/lib/routes/whu/news.ts b/lib/routes/whu/news.ts index c328599bc7e8df..e544656bb69fd1 100644 --- a/lib/routes/whu/news.ts +++ b/lib/routes/whu/news.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { domain, processMeta, getMeta, processItems } from './util'; diff --git a/lib/routes/whu/util.ts b/lib/routes/whu/util.ts index 993ff09ae333ae..811a1ace4325d1 100644 --- a/lib/routes/whu/util.ts +++ b/lib/routes/whu/util.ts @@ -6,7 +6,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const domain = 'whu.edu.cn'; diff --git a/lib/routes/winstall/update.ts b/lib/routes/winstall/update.ts index e8b824a8b67448..6e370c870e36e7 100644 --- a/lib/routes/winstall/update.ts +++ b/lib/routes/winstall/update.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { config } from '@/config'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:appId', diff --git a/lib/routes/wise/pair.ts b/lib/routes/wise/pair.ts index 7411f0b4f4157f..e5eee6a7ff8e32 100644 --- a/lib/routes/wise/pair.ts +++ b/lib/routes/wise/pair.ts @@ -9,7 +9,7 @@ import dayjs from 'dayjs'; import customParseFormat from 'dayjs/plugin/customParseFormat'; dayjs.extend(customParseFormat); import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const renderDesc = (content) => art(path.join(__dirname, 'templates/description.art'), content); export const route: Route = { diff --git a/lib/routes/wmc-bj/publish.ts b/lib/routes/wmc-bj/publish.ts index ca62d1b08a3198..80f1385ea35a47 100644 --- a/lib/routes/wmc-bj/publish.ts +++ b/lib/routes/wmc-bj/publish.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/publish/:category{.+}?', diff --git a/lib/routes/wnacg/index.ts b/lib/routes/wnacg/index.ts index 2bfdc11fab453b..6ab4a78c8d5c78 100644 --- a/lib/routes/wnacg/index.ts +++ b/lib/routes/wnacg/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const categories = { 1: '同人誌 漢化', diff --git a/lib/routes/wsj/utils.ts b/lib/routes/wsj/utils.ts index f3697d697e44ec..8951df13b161e3 100644 --- a/lib/routes/wsj/utils.ts +++ b/lib/routes/wsj/utils.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import randUserAgent from '@/utils/rand-user-agent'; const UA = randUserAgent({ browser: 'chrome', os: 'android', device: 'mobile' }); diff --git a/lib/routes/x-mol/news.ts b/lib/routes/x-mol/news.ts index 6ed3fae95c6f74..6a920957358a51 100644 --- a/lib/routes/x-mol/news.ts +++ b/lib/routes/x-mol/news.ts @@ -9,7 +9,7 @@ import utils from './utils'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/news/:tag?', diff --git a/lib/routes/xiaomiyoupin/crowdfunding.ts b/lib/routes/xiaomiyoupin/crowdfunding.ts index f81ff985c3928f..44a3b88b1f3d3c 100644 --- a/lib/routes/xiaomiyoupin/crowdfunding.ts +++ b/lib/routes/xiaomiyoupin/crowdfunding.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const base_url = 'https://m.xiaomiyoupin.com'; export const route: Route = { diff --git a/lib/routes/xiaomiyoupin/utils.ts b/lib/routes/xiaomiyoupin/utils.ts index 149df26e3f568c..adba9939fd89b7 100644 --- a/lib/routes/xiaomiyoupin/utils.ts +++ b/lib/routes/xiaomiyoupin/utils.ts @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const parseModule = (floors, module_key) => floors.find((floor) => floor.module_key === module_key); diff --git a/lib/routes/xinpianchang/util.ts b/lib/routes/xinpianchang/util.ts index de2dba0e16b4e1..0e4936b285fc85 100644 --- a/lib/routes/xinpianchang/util.ts +++ b/lib/routes/xinpianchang/util.ts @@ -5,7 +5,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const appKey = '61a2f329348b3bf77'; diff --git a/lib/routes/xjtu/job.ts b/lib/routes/xjtu/job.ts index 336d699396341e..2feec0c217e542 100644 --- a/lib/routes/xjtu/job.ts +++ b/lib/routes/xjtu/job.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const baseUrl = 'https://job.xjtu.edu.cn'; diff --git a/lib/routes/xjtu/std.ts b/lib/routes/xjtu/std.ts index 8689acbd5d7715..bf9e5909c88e79 100644 --- a/lib/routes/xjtu/std.ts +++ b/lib/routes/xjtu/std.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/std/:category?', diff --git a/lib/routes/xkb/index.ts b/lib/routes/xkb/index.ts index 30d8135cb5224b..e5cd7a32ea5aa1 100644 --- a/lib/routes/xkb/index.ts +++ b/lib/routes/xkb/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:channel', diff --git a/lib/routes/xueqiu/stock-comments.ts b/lib/routes/xueqiu/stock-comments.ts index 4382e81cf62606..401eca00e57665 100644 --- a/lib/routes/xueqiu/stock-comments.ts +++ b/lib/routes/xueqiu/stock-comments.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import sanitizeHtml from 'sanitize-html'; diff --git a/lib/routes/xys/new.ts b/lib/routes/xys/new.ts index dd4890c767750e..45c49d51cf8cad 100644 --- a/lib/routes/xys/new.ts +++ b/lib/routes/xys/new.ts @@ -6,7 +6,7 @@ import cache from '@/utils/cache'; import got from '@/utils/got'; import { load } from 'cheerio'; import iconv from 'iconv-lite'; -import * as path from 'node:path'; +import path from 'node:path'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; diff --git a/lib/routes/xyzrank/index.ts b/lib/routes/xyzrank/index.ts index 302d4e203a18f5..0f6e0e706e0b96 100644 --- a/lib/routes/xyzrank/index.ts +++ b/lib/routes/xyzrank/index.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:category?', diff --git a/lib/routes/yahoo/news/tw/utils.ts b/lib/routes/yahoo/news/tw/utils.ts index 1f519e775ee88f..021335b7a9cabb 100644 --- a/lib/routes/yahoo/news/tw/utils.ts +++ b/lib/routes/yahoo/news/tw/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; -import * as path from 'node:path'; +import path from 'node:path'; import { art } from '@/utils/render'; const getArchive = async (region, limit, tag, providerId) => { diff --git a/lib/routes/ycwb/index.ts b/lib/routes/ycwb/index.ts index 16189bf4725487..37b3987fb842cf 100644 --- a/lib/routes/ycwb/index.ts +++ b/lib/routes/ycwb/index.ts @@ -8,7 +8,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/:node', diff --git a/lib/routes/yicai/dt.ts b/lib/routes/yicai/dt.ts index c7ab9c14305fe6..c978059cb3ba89 100644 --- a/lib/routes/yicai/dt.ts +++ b/lib/routes/yicai/dt.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const columns = { article: 2, diff --git a/lib/routes/yicai/utils.ts b/lib/routes/yicai/utils.ts index 02b9f9be31cbf7..779c7790459fc5 100644 --- a/lib/routes/yicai/utils.ts +++ b/lib/routes/yicai/utils.ts @@ -6,7 +6,7 @@ import { load } from 'cheerio'; import timezone from '@/utils/timezone'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://www.yicai.com'; diff --git a/lib/routes/ymgal/game.ts b/lib/routes/ymgal/game.ts index dc91e0c0260216..80df068ba102aa 100644 --- a/lib/routes/ymgal/game.ts +++ b/lib/routes/ymgal/game.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.ymgal.games'; diff --git a/lib/routes/yoasobi-music/info.ts b/lib/routes/yoasobi-music/info.ts index 7a88c724d0f21a..938b9e9d5ffb63 100644 --- a/lib/routes/yoasobi-music/info.ts +++ b/lib/routes/yoasobi-music/info.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { parseJSONP } from './jsonp-helper'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/info/:category?', diff --git a/lib/routes/yoasobi-music/live.ts b/lib/routes/yoasobi-music/live.ts index 7eb7ef87d74bda..0555b451f781bb 100644 --- a/lib/routes/yoasobi-music/live.ts +++ b/lib/routes/yoasobi-music/live.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseJSONP } from './jsonp-helper'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/live', diff --git a/lib/routes/yoasobi-music/media.ts b/lib/routes/yoasobi-music/media.ts index 7b0a4af97d2222..15c90791354910 100644 --- a/lib/routes/yoasobi-music/media.ts +++ b/lib/routes/yoasobi-music/media.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { parseJSONP } from './jsonp-helper'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/media', diff --git a/lib/routes/youku/channel.ts b/lib/routes/youku/channel.ts index 570181a95ae74a..6a21efe6375ade 100644 --- a/lib/routes/youku/channel.ts +++ b/lib/routes/youku/channel.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '/channel/:channelId/:embed?', diff --git a/lib/routes/youtube/community.ts b/lib/routes/youtube/community.ts index be035f2b1093ad..d278532a613ea4 100644 --- a/lib/routes/youtube/community.ts +++ b/lib/routes/youtube/community.ts @@ -6,7 +6,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { isYouTubeChannelId } from './utils'; export const route: Route = { diff --git a/lib/routes/youtube/utils.ts b/lib/routes/youtube/utils.ts index adcdd0240a2a08..ec5596cad5404b 100644 --- a/lib/routes/youtube/utils.ts +++ b/lib/routes/youtube/utils.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import { google } from 'googleapis'; const { OAuth2 } = google.auth; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { config } from '@/config'; let count = 0; diff --git a/lib/routes/yxdzqb/index.ts b/lib/routes/yxdzqb/index.ts index 5f4196b30c549f..f7ddd01463f45b 100644 --- a/lib/routes/yxdzqb/index.ts +++ b/lib/routes/yxdzqb/index.ts @@ -5,7 +5,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { load } from 'cheerio'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const host = 'https://www.yxdzqb.com'; diff --git a/lib/routes/zagg/new-arrivals.ts b/lib/routes/zagg/new-arrivals.ts index 946a88172f0a8c..2e179f65237484 100644 --- a/lib/routes/zagg/new-arrivals.ts +++ b/lib/routes/zagg/new-arrivals.ts @@ -4,7 +4,7 @@ const __dirname = getCurrentPath(import.meta.url); import got from '@/utils/got'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { load } from 'cheerio'; const host = 'https://www.zagg.com/en_us'; export const route: Route = { diff --git a/lib/routes/zaobao/util.ts b/lib/routes/zaobao/util.ts index e74bcecea1de89..8bd5a2a40d9855 100644 --- a/lib/routes/zaobao/util.ts +++ b/lib/routes/zaobao/util.ts @@ -7,7 +7,7 @@ import { load } from 'cheerio'; import { parseRelativeDate } from '@/utils/parse-date'; import timezone from '@/utils/timezone'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import { base32 } from 'rfc4648'; const baseUrl = 'https://www.zaobao.com'; diff --git a/lib/routes/zcool/discover.ts b/lib/routes/zcool/discover.ts index f8b983563d6642..f3d9cda27f9867 100644 --- a/lib/routes/zcool/discover.ts +++ b/lib/routes/zcool/discover.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import locations from './locations'; export const route: Route = { diff --git a/lib/routes/zcool/utils.ts b/lib/routes/zcool/utils.ts index 37e13938914c75..f9ed05419ab7a8 100644 --- a/lib/routes/zcool/utils.ts +++ b/lib/routes/zcool/utils.ts @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const extractArticle = (data) => data.props.pageProps.data.summary + data.props.pageProps.data.memo; diff --git a/lib/routes/zhitongcaijing/index.ts b/lib/routes/zhitongcaijing/index.ts index 257c3bf14fee17..9d574bc26b407a 100644 --- a/lib/routes/zhitongcaijing/index.ts +++ b/lib/routes/zhitongcaijing/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const ids = { recommend: { diff --git a/lib/routes/zhiy/post.ts b/lib/routes/zhiy/post.ts index 938d2a373e4ac9..9497226466c3e6 100644 --- a/lib/routes/zhiy/post.ts +++ b/lib/routes/zhiy/post.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { parseDate } from '@/utils/parse-date'; import { baseUrl, fetchUserDate } from './utils'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import dayjs from 'dayjs'; export const route: Route = { diff --git a/lib/routes/zhubai/top20.ts b/lib/routes/zhubai/top20.ts index 09f0111a3e70cb..81527e75e6869c 100644 --- a/lib/routes/zhubai/top20.ts +++ b/lib/routes/zhubai/top20.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate, parseRelativeDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const parseContent = (content) => art(path.join(__dirname, 'templates/description.art'), { diff --git a/lib/routes/zodgame/forum.ts b/lib/routes/zodgame/forum.ts index b219adc3d0c1ba..164945729371bd 100644 --- a/lib/routes/zodgame/forum.ts +++ b/lib/routes/zodgame/forum.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { config } from '@/config'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; const rootUrl = 'https://zodgame.xyz'; diff --git a/lib/routes/zuvio/utils.ts b/lib/routes/zuvio/utils.ts index f80a6063f36862..86634e1bbaf64f 100644 --- a/lib/routes/zuvio/utils.ts +++ b/lib/routes/zuvio/utils.ts @@ -2,7 +2,7 @@ import { getCurrentPath } from '@/utils/helpers'; const __dirname = getCurrentPath(import.meta.url); import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; import got from '@/utils/got'; const token = diff --git a/lib/routes/zyshow/index.ts b/lib/routes/zyshow/index.ts index c2082f76697dcd..a6a840caee0c0d 100644 --- a/lib/routes/zyshow/index.ts +++ b/lib/routes/zyshow/index.ts @@ -7,7 +7,7 @@ import got from '@/utils/got'; import { load } from 'cheerio'; import { parseDate } from '@/utils/parse-date'; import { art } from '@/utils/render'; -import * as path from 'node:path'; +import path from 'node:path'; export const route: Route = { path: '*', diff --git a/lib/utils/helpers.ts b/lib/utils/helpers.ts index 1b7d3bff83ee31..ff78e73a184940 100644 --- a/lib/utils/helpers.ts +++ b/lib/utils/helpers.ts @@ -1,5 +1,5 @@ import { fileURLToPath } from 'url'; -import * as path from 'node:path'; +import path from 'node:path'; export const getRouteNameFromPath = (path: string) => { const p = path.split('/').filter(Boolean); diff --git a/lib/utils/logger.ts b/lib/utils/logger.ts index b654234cc4059f..7a32e82d7e1aa3 100644 --- a/lib/utils/logger.ts +++ b/lib/utils/logger.ts @@ -1,4 +1,4 @@ -import * as path from 'node:path'; +import path from 'node:path'; import winston from 'winston'; import { config } from '@/config'; diff --git a/lib/utils/rand-user-agent.ts b/lib/utils/rand-user-agent.ts index 6a1df014bdaa99..3a925dcdd700db 100644 --- a/lib/utils/rand-user-agent.ts +++ b/lib/utils/rand-user-agent.ts @@ -9,7 +9,7 @@ import { randUserAgent } from '@tonyrl/rand-user-agent'; * @param {string} randUserAgent.device Name of a device, case-insensitive. `desktop`, `mobile` or `tablet`. * @returns A random useragent for the given specifications. */ -export default ({ browser = 'chrome', os = 'mac os', device = 'desktop' }) => { +const _randUserAgent = ({ browser = 'chrome', os = 'mac os', device = 'desktop' }: { browser: string; os: string; device: string }) => { device = device.toLowerCase(); browser = browser.toLowerCase(); os = os.toLowerCase(); @@ -27,3 +27,4 @@ export default ({ browser = 'chrome', os = 'mac os', device = 'desktop' }) => { } return UA; }; +export default _randUserAgent; diff --git a/lib/utils/timezone.ts b/lib/utils/timezone.ts index 6091fa11686d37..00ae95beb986dd 100644 --- a/lib/utils/timezone.ts +++ b/lib/utils/timezone.ts @@ -3,7 +3,7 @@ import { strict as assert } from 'assert'; const millisInAnHour = 60 * 60 * 1000; const serverTimezone = -new Date().getTimezoneOffset() / 60; -export default function (date, timezone = serverTimezone) { +export default function timezone(date, timezone = serverTimezone) { if (typeof date === 'string') { date = new Date(date); } diff --git a/package.json b/package.json index 5ffb846ff340e2..c9d7fdb06a9024 100644 --- a/package.json +++ b/package.json @@ -25,8 +25,8 @@ "build:docs": "tsx scripts/workflow/build-docs.ts", "dev": "cross-env NODE_ENV=dev tsx watch --no-cache lib/index.ts", "dev:cache": "cross-env NODE_ENV=production tsx watch lib/index.ts", - "format": "eslint --cache --fix \"**/*.{ts,js,yml}\" && prettier \"**/*.{ts,js,json}\" --write", - "format:check": "eslint --cache \"**/*.{ts,js,yml}\" && prettier \"**/*.{ts,js,json}\" --check", + "format": "eslint --cache --fix \"**/*.{ts,tsx,js,yml}\" && prettier \"**/*.{ts,tsx,js,json}\" --write", + "format:check": "eslint --cache \"**/*.{ts,tsx,js,yml}\" && prettier \"**/*.{ts,tsx,js,json}\" --check", "format:staged": "lint-staged", "vitest": "cross-env NODE_ENV=test vitest", "vitest:fullroutes": "cross-env NODE_ENV=test FULL_ROUTES_TEST=true vitest --reporter=json --reporter=default --outputFile=\"./assets/build/test-full-routes.json\" routes", @@ -43,7 +43,7 @@ "eslint --cache --fix", "prettier --ignore-unknown --ignore-path ./.gitignore --write" ], - "*.ts": [ + "*.{ts,tsx}": [ "eslint --cache --fix", "prettier --ignore-unknown --ignore-path ./.gitignore --write" ], diff --git a/scripts/workflow/build-docs.ts b/scripts/workflow/build-docs.ts index 43384e1525d22d..c2faf99f9fafd5 100644 --- a/scripts/workflow/build-docs.ts +++ b/scripts/workflow/build-docs.ts @@ -1,6 +1,6 @@ import { namespaces } from '../../lib/registry'; import fs from 'node:fs'; -import * as path from 'node:path'; +import path from 'node:path'; import { categories } from './data'; import { getCurrentPath } from '../../lib/utils/helpers'; diff --git a/scripts/workflow/build-routes.ts b/scripts/workflow/build-routes.ts index 3a4634cc1f288a..9003f73e4a2f9f 100644 --- a/scripts/workflow/build-routes.ts +++ b/scripts/workflow/build-routes.ts @@ -2,7 +2,7 @@ import { namespaces } from '../../lib/registry'; import { RadarItem } from '../../lib/types'; import { parse } from 'tldts'; import fs from 'node:fs'; -import * as path from 'node:path'; +import path from 'node:path'; import toSource from 'tosource'; import { getCurrentPath } from '../../lib/utils/helpers'; From ad93d75ce7c1cfc99d9635a0409045452f0c3070 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 4 Apr 2024 12:30:18 +0000 Subject: [PATCH 2/6] style: auto format --- lib/app.tsx | 11 +++--- lib/errors/index.tsx | 19 ++++----- lib/views/atom.tsx | 12 ++++-- lib/views/error.tsx | 93 +++++++++++++++++++++++++++++++++++--------- lib/views/rss.tsx | 9 +++-- 5 files changed, 100 insertions(+), 44 deletions(-) diff --git a/lib/app.tsx b/lib/app.tsx index 5615affc107b47..53e85e2a56dee1 100644 --- a/lib/app.tsx +++ b/lib/app.tsx @@ -28,13 +28,12 @@ const app = new Hono(); app.use(compress()); -app.use(jsxRenderer( - ({ children }) => <>{children}, - { +app.use( + jsxRenderer(({ children }) => <>{children}, { docType: '', - stream: {} - } -)); + stream: {}, + }) +); app.use(mLogger); app.use(sentry); app.use(accessControl); diff --git a/lib/errors/index.tsx b/lib/errors/index.tsx index 913bd3b82c7e2c..2f16d0512d4d79 100644 --- a/lib/errors/index.tsx +++ b/lib/errors/index.tsx @@ -62,18 +62,13 @@ export const errorHandler: ErrorHandler = (error, ctx) => { logger.error(`Error in ${requestPath}: ${message}`); - return config.isPackage ? ctx.json({ - error: { - message: error.message ?? error, - }, - }) : ctx.html(( - - )); + return config.isPackage + ? ctx.json({ + error: { + message: error.message ?? error, + }, + }) + : ctx.html(); }; export const notFoundHandler: NotFoundHandler = (ctx) => errorHandler(new NotFoundError(), ctx); diff --git a/lib/views/atom.tsx b/lib/views/atom.tsx index b13d30d5423e92..506435017a575a 100644 --- a/lib/views/atom.tsx +++ b/lib/views/atom.tsx @@ -5,7 +5,7 @@ const RSS: FC<{ data: Data }> = ({ data }) => ( {data.title || 'RSSHub'} - { data.id || data.link } + {data.id || data.link} {data.description || data.title} - Made with love by RSSHub(https://github.com/DIYgod/RSSHub) RSSHub i@diygod.me (DIYgod) @@ -17,12 +17,18 @@ const RSS: FC<{ data: Data }> = ({ data }) => ( {data.item?.map((item) => ( {item.title} - {item.description} + + {item.description} + {item.guid || item.link || item.title} {item.pubDate && {item.pubDate}} {item.updated && {item.updated || item.pubDate}} - {item.author && {item.author}} + {item.author && ( + + {item.author} + + )} {typeof item.category === 'string' ? : item.category?.map((c) => )} {item.media && Object.entries(item.media).map(([key, value]) => { diff --git a/lib/views/error.tsx b/lib/views/error.tsx index bdab930c16bec9..cc63e064da545e 100644 --- a/lib/views/error.tsx +++ b/lib/views/error.tsx @@ -30,12 +30,7 @@ const Index: FC<{ message: string; errorRoute: string; nodeVersion: string; -}> = ({ - requestPath, - message, - errorRoute, - nodeVersion, -}) => ( +}> = ({ requestPath, message, errorRoute, nodeVersion }) => (
RSSHub -

- Looks like something went wrong -

+

Looks like something went wrong

Helpful Information

-

Error Message:
{message}

-

Route: {errorRoute}

-

Full Route: {requestPath}

-

Node Version: {nodeVersion}

-

Git Hash: {gitHash}

-

Git Date: {gitDate?.toUTCString()}

+

+ Error Message: +
+ {message} +

+

+ Route: {errorRoute} +

+

+ Full Route: {requestPath} +

+

+ Node Version: {nodeVersion} +

+

+ Git Hash: {gitHash} +

+

+ Git Date: {gitDate?.toUTCString()} +

Report

-

After carefully reading the document, if you think this is a bug of RSSHub, please submit an issue on GitHub.

-

在仔细阅读文档后,如果你认为这是 RSSHub 的 bug,请在 GitHub 提交 issue

+

+ After carefully reading the{' '} + + document + + , if you think this is a bug of RSSHub, please{' '} + + submit an issue + {' '} + on GitHub. +

+

+ 在仔细阅读 + + 文档 + + 后,如果你认为这是 RSSHub 的 bug,请在 GitHub{' '} + + 提交 issue + + 。 +

Community

-

You can also join our Telegram group, or follow our Telegram channel and Twitter to get community support and news.

-

你也可以加入我们的 Telegram 群组,或关注我们的 Telegram 频道Twitter 获取社区支持和新闻。

+

+ You can also join our{' '} + + Telegram group + + , or follow our{' '} + + Telegram channel + {' '} + and{' '} + + Twitter + {' '} + to get community support and news. +

+

+ 你也可以加入我们的{' '} + + Telegram 群组 + + ,或关注我们的{' '} + + Telegram 频道 + + 和{' '} + + Twitter + {' '} + 获取社区支持和新闻。 +

diff --git a/lib/views/rss.tsx b/lib/views/rss.tsx index d18e2f2ea5870f..f7420789a445a5 100644 --- a/lib/views/rss.tsx +++ b/lib/views/rss.tsx @@ -39,10 +39,11 @@ const RSS: FC<{ data: Data }> = ({ data }) => { {item.enclosure_url && } {item.itunes_duration && {item.itunes_duration}} {typeof item.category === 'string' ? {item.category} : item.category?.map((c) => {c})} - {item.media && Object.entries(item.media).map(([key, value]) => { - const Tag = `media:${key}`; - return ; - })} + {item.media && + Object.entries(item.media).map(([key, value]) => { + const Tag = `media:${key}`; + return ; + })} ))} From b47839e41c4fec0321fed0ae9f9a41476f56d9e4 Mon Sep 17 00:00:00 2001 From: JimenezLi <75196426+JimenezLi@users.noreply.github.com> Date: Thu, 4 Apr 2024 21:26:37 +0800 Subject: [PATCH 3/6] fix(route): xhu (#15097) --- lib/routes/zhihu/xhu/auth.ts | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/lib/routes/zhihu/xhu/auth.ts b/lib/routes/zhihu/xhu/auth.ts index 81f6398f8b64a7..37ae99c330e4d6 100644 --- a/lib/routes/zhihu/xhu/auth.ts +++ b/lib/routes/zhihu/xhu/auth.ts @@ -1,38 +1,30 @@ import cache from '@/utils/cache'; -import got from '@/utils/got'; - -const ProcessCookie = (cookie) => cookie.map((cookie) => cookie.split(';')[0]).join('; '); - -const ProcessNewCookie = (oldCookie, newCookie) => { - const oldCookieArray = oldCookie.split('; '); - const newCookieArray = newCookie.map((cookie) => cookie.split(';')[0]); - return [...oldCookieArray, ...newCookieArray].join('; '); -}; +import ofetch from '@/utils/ofetch'; export default { getCookie: () => { const key = 'zhihu-xhu-cookie'; return cache.tryGet(key, async () => { // Get udid - const udidResponse = await got({ + const udidResponse = await ofetch.raw('https://api.zhihuvvv.workers.dev/appcloud/v1/device', { method: 'get', - url: 'https://api.zhihuvvv.workers.dev/appcloud/v1/device', headers: { Referer: 'https://api.zhihuvvv.workers.dev', }, }); - const udidCookie = ProcessCookie(udidResponse.headers['set-cookie']); + const udidCookieArray = udidResponse.headers.getSetCookie(); + const udidCookie = udidCookieArray.join('; '); // Get access token - const accessTokenResponse = await got({ + const accessTokenResponse = await ofetch.raw('https://api.zhihuvvv.workers.dev/guests/token', { method: 'get', - url: 'https://api.zhihuvvv.workers.dev/guests/token', headers: { Referer: 'https://api.zhihuvvv.workers.dev', Cookie: udidCookie, }, }); - const accessTokenCookie = ProcessNewCookie(udidCookie, accessTokenResponse.headers['set-cookie']); + const accessTokenCookieArray = [...accessTokenResponse.headers.getSetCookie(), ...udidCookieArray]; + const accessTokenCookie = accessTokenCookieArray.join('; '); return accessTokenCookie; }); }, From a06159ac690e58f25aa0c93e0d3736be8a5099a7 Mon Sep 17 00:00:00 2001 From: Ne0 Date: Thu, 4 Apr 2024 21:50:18 +0800 Subject: [PATCH 4/6] =?UTF-8?q?feat(route):=20=E4=B8=AD=E5=9B=BD=E7=A7=91?= =?UTF-8?q?=E5=AD=A6=E6=8A=80=E6=9C=AF=E5=A4=A7=E5=AD=A6-=E6=95=B0?= =?UTF-8?q?=E5=AD=A6=E7=A7=91=E5=AD=A6=E5=AD=A6=E9=99=A2=20(#15095)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * ustc math school * fixed pub date * assume articles published at 12:00 UTC+8 --- lib/routes/ustc/math.ts | 93 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 lib/routes/ustc/math.ts diff --git a/lib/routes/ustc/math.ts b/lib/routes/ustc/math.ts new file mode 100644 index 00000000000000..d19fb67980dc72 --- /dev/null +++ b/lib/routes/ustc/math.ts @@ -0,0 +1,93 @@ +import { Route } from '@/types'; +import cache from '@/utils/cache'; +import got from '@/utils/got'; +import { load } from 'cheerio'; +import { parseDate } from '@/utils/parse-date'; +import timezone from '@/utils/timezone'; + +const map = new Map([ + ['xyxw', { title: '中国科学技术大学数学科学学院 - 学院新闻', id: 'xyxw' }], + ['tzgg', { title: '中国科学技术大学数学科学学院 - 通知公告', id: 'tzgg' }], + ['xsjl', { title: '中国科学技术大学数学科学学院 - 学术交流', id: 'xsjl' }], + ['xsbg', { title: '中国科学技术大学数学科学学院 - 学术报告', id: 'xsbg_18822' }], +]); + +const host = 'https://math.ustc.edu.cn'; + +export const route: Route = { + path: '/math/:type?', + categories: ['university'], + example: '/ustc/math/tzgg', + parameters: { type: '分类,见下表,默认为通知公告' }, + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + radar: [ + { + source: ['math.ustc.edu.cn/'], + target: '/math', + }, + ], + name: '数学科学学院', + maintainers: ['ne0-wu'], + handler, + url: 'math.ustc.edu.cn/', + description: `| 学院新闻 | 通知公告 | 学术交流 | 学术报告 | + | -------- | -------- | -------- | -------- | + | xyxw | tzgg | xsjl | xsbg |`, +}; + +async function handler(ctx) { + const type = ctx.req.param('type') ?? 'tzgg'; + const info = map.get(type); + if (!info) { + throw new Error('invalid type'); + } + const id = info.id; + + const response = await got(`${host}/${id}/list.htm`); + const $ = load(response.data); + + let items = $('#wp_news_w6 > .wp_article_list > .list_item') + .toArray() + .map((item) => { + const elem = $(item); + const title = elem.find('.Article_Title > a').attr('title').trim(); + let link = elem.find('.Article_Title > a').attr('href'); + link = link.startsWith('/') ? host + link : link; + // Assume that the articles are published at 12:00 UTC+8 + const pubDate = timezone(parseDate(elem.find('.Article_PublishDate').text(), 'YYYY-MM-DD'), -4); + return { + title, + pubDate, + link, + }; + }); + + items = await Promise.all( + items.map((item) => + cache.tryGet(item.link, async () => { + let desc = ''; + try { + const response = await got(item.link); + desc = load(response.data)('div.wp_articlecontent').html(); + item.description = desc; + } catch { + // Intranet only contents + } + return item; + }) + ) + ); + + return { + title: info.title, + link: `${host}/${id}/list.htm`, + item: items, + }; +} From 5da0ec13b0a67a0d8c1dbe4e567a0c8020c11697 Mon Sep 17 00:00:00 2001 From: Ethan Shen <42264778+nczitzk@users.noreply.github.com> Date: Fri, 5 Apr 2024 00:26:17 +0800 Subject: [PATCH 5/6] =?UTF-8?q?feat(route):=20add=20=E7=BD=97=E7=A3=8A?= =?UTF-8?q?=E7=9A=84=E7=8B=AC=E7=AB=8B=E5=8D=9A=E5=AE=A2=20(#15104)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/routes/luolei/index.ts | 121 +++++++++++++++++++++++++++++++++ lib/routes/luolei/namespace.ts | 8 +++ 2 files changed, 129 insertions(+) create mode 100644 lib/routes/luolei/index.ts create mode 100644 lib/routes/luolei/namespace.ts diff --git a/lib/routes/luolei/index.ts b/lib/routes/luolei/index.ts new file mode 100644 index 00000000000000..137a5e0a92b437 --- /dev/null +++ b/lib/routes/luolei/index.ts @@ -0,0 +1,121 @@ +import { Route } from '@/types'; + +import cache from '@/utils/cache'; +import got from '@/utils/got'; +import { load } from 'cheerio'; +import { parseDate } from '@/utils/parse-date'; + +export const handler = async (ctx) => { + const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit'), 10) : 50; + + const rootUrl = 'https://luolei.org'; + + const { data: response } = await got(rootUrl); + + const $ = load(response); + + const language = $('html').prop('lang'); + const themeEl = $('link[rel="modulepreload"]') + .toArray() + .filter((l) => /theme\.\w+\.js$/.test($(l).prop('href'))) + .pop(); + const themeUrl = themeEl ? new URL($(themeEl).prop('href'), rootUrl).href : undefined; + + const { data: themeResponse } = await got(themeUrl); + + let items = themeResponse + .match(/{"title":".*?"string":".*?"}}/g) + .slice(0, limit) + .map((item) => { + item = JSON.parse(item.replaceAll('\\\\"', '\\"').replaceAll('\\\\n', '').replaceAll('\\`', '`')); + + const title = item.title; + const description = item.excerpt; + const image = item.cover; + + return { + title, + description, + pubDate: parseDate(item.date.time, 'x'), + link: new URL(item.url, rootUrl).href, + category: item.categories, + author: item.author, + content: { + html: description, + text: description, + }, + image, + banner: image, + language, + }; + }); + + items = await Promise.all( + items.map((item) => + cache.tryGet(item.link, async () => { + if (item.description) { + return item; + } + + const { data: detailResponse } = await got(item.link); + + const $$ = load(detailResponse); + + $$('div.tweet-card').remove(); + + const title = $$('h2').first().text(); + const description = $$('div.vp-doc').html(); + + item.title = title; + item.description = description; + item.content = { + html: description, + text: $$('div.vp-doc').text(), + }; + item.language = language; + + return item; + }) + ) + ); + + const image = new URL($('img.logo').prop('src'), rootUrl).href; + + return { + title: $('title').first().text(), + description: $('meta[name="description"]').prop('content'), + link: rootUrl, + item: items, + allowEmpty: true, + image, + author: $('meta[property="og:title"]').prop('content'), + language, + }; +}; + +export const route: Route = { + path: '/', + name: '罗磊的独立博客', + url: 'luolei.org', + maintainers: ['nczitzk'], + handler, + example: '/luolei', + description: '', + categories: ['blog'], + + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportRadar: true, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + radar: [ + { + source: ['luolei.org'], + target: '/', + }, + ], +}; diff --git a/lib/routes/luolei/namespace.ts b/lib/routes/luolei/namespace.ts new file mode 100644 index 00000000000000..2707ad28416973 --- /dev/null +++ b/lib/routes/luolei/namespace.ts @@ -0,0 +1,8 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: '罗磊的独立博客', + url: 'luolei.org', + categories: ['blog'], + description: '', +}; From 3ba4a634cf83f2217e2722832216d71c5d33e89b Mon Sep 17 00:00:00 2001 From: Enoch Ma Date: Thu, 4 Apr 2024 21:52:02 +0200 Subject: [PATCH 6/6] feat(route): support europechinese (#15019) * support europechinese * fix time --- lib/routes/europechinese/latest.ts | 66 +++++++++++++++++++++++++++ lib/routes/europechinese/namespace.ts | 6 +++ 2 files changed, 72 insertions(+) create mode 100644 lib/routes/europechinese/latest.ts create mode 100644 lib/routes/europechinese/namespace.ts diff --git a/lib/routes/europechinese/latest.ts b/lib/routes/europechinese/latest.ts new file mode 100644 index 00000000000000..abb8df4a8520bb --- /dev/null +++ b/lib/routes/europechinese/latest.ts @@ -0,0 +1,66 @@ +import { Route } from '@/types'; +import { load } from 'cheerio'; +import cache from '@/utils/cache'; +import got from '@/utils/got'; + +export const route: Route = { + path: '/latest', + categories: ['new-media'], + example: '/europechinese/latest', + parameters: {}, + features: { + requireConfig: false, + requirePuppeteer: false, + antiCrawler: false, + supportBT: false, + supportPodcast: false, + supportScihub: false, + }, + radar: [ + { + source: ['europechinese.blogspot.com'], + }, + ], + name: '最新', + maintainers: ['emdoe'], + handler, + url: 'europechinese.blogspot.com/', +}; + +async function handler() { + const url = `https://europechinese.blogspot.com/`; + const { data: response } = await got(url); + const $ = load(response); + const list = $('h3.post-title'); + + const out = await Promise.all( + list.map((_, item) => { + const title = $(item).find('a').text(); + const link = $(item).find('a').attr('href'); + + return cache.tryGet(link, async () => { + const { data: response } = await got(link); + const $ = load(response); + $('div.widget-content').remove(); + $('div.byline').remove(); + $('div.post-sidebar').remove(); + const time = $('time.published').attr('datetime'); + const text = $('div.post-body-container').html(); + + return { + title, + link, + guid: link, + description: text, + pubDate: time, + }; + }); + }) + ); + + return { + title: `歐洲動態(國際)| 最新`, + link: url, + item: out, + }; +} diff --git a/lib/routes/europechinese/namespace.ts b/lib/routes/europechinese/namespace.ts new file mode 100644 index 00000000000000..9c639fb2dd2c7a --- /dev/null +++ b/lib/routes/europechinese/namespace.ts @@ -0,0 +1,6 @@ +import type { Namespace } from '@/types'; + +export const namespace: Namespace = { + name: '歐洲動態(國際)', + url: 'europechinese.blogspot.com', +};