From 6d901cb7dce937e4445ca905d635eb6d716c00ca Mon Sep 17 00:00:00 2001 From: Tony Date: Thu, 18 Jan 2024 12:43:40 +0000 Subject: [PATCH] style(eslint): add eslint-unicorn (#14257) * style: add eslint-unicorn * style: fix unicorn/no-useless-spread * style: fix unicorn/no-useless-promise-resolve-reject * style: fix unicorn/no-for-loop * fix: codeql bad HTML filtering regexp * fix: codeql incomplete replace * fix: unicorn/no-abusive-eslint-disable * style: fix unicorn/no-new-array * style: fix unicorn/no-typeof-undefined * style: fix unicorn/no-zero-fractions * style: fix unicorn/no-empty-file * style: fix unicorn/prefer-date-now * revert: auto fix unicorn/prefer-switch on lib/v2/kuaidi100/utils.js * style: fix unicorn/prefer-array-find * style: fix unicorn/prefer-array-flat * style: fix unicorn/prefer-array-flat-map * style: fix unicorn/prefer-at * style: fix unicorn/prefer-string-starts-ends-with * style: fix unicorn/prefer-includes * fix: codeql URL substring sanitization * style: fix unicorn/prefer-optional-catch-binding * style: fix unicorn/catch-error-name * style: fix unicorn/escape-case * style: fix unicorn/prefer-native-coercion-functions * style: fix unicorn/prefer-regexp-test * style: fix unicorn/require-array-join-separator * style: fix unicorn/prefer-math-trunc * style: fix unicorn/prefer-negative-index * style: fix unicorn/prefer-dom-node-dataset * style: fix unicorn/prefer-dom-node-text-content * style: fix unicorn/prefer-query-selector * style: fix unicorn/no-array-for-each * style: fix unicorn/no-negated-condition * style: fix unicorn/prefer-add-event-listener * style: fix unicorn/import-style * style: fix prefer-regex-literals * style: disable unicorn/no-useless-switch-case * style: disable unicorn/text-encoding-identifier-case * style: fix unicorn/prefer-set-has * style: fix unicorn/prefer-spread * revert: auto fix on lib/routes/universities/ynnu/edu/base64.js * style: fix unicorn/no-useless-undefined * style: fix unicorn/no-array-push-push * style: fix unicorn/no-useless-undefined again * style: fix unicorn/no-lonely-if * style: fix unicorn/prefer-reflect-apply * style: fix unicorn/switch-case-braces * style: fix unicorn/prefer-switch * style: fix unicorn/prefer-array-some * fix: deepscan UNUSED_VAR_ASSIGN * style: fix unicorn/prefer-ternary * fix: follow-up of unicorn/prefer-ternary * revert: auto fix of unicorn/prefer-string-slice for substring() * style: disable unicorn/prefer-string-slice fix: auto fix slice over deprecated substr * style: fix unicorn/throw-new-error * style: fix unicorn/filename-case * test: fix dateParser renaming * style: fix unicorn/better-regex * style: fix unicorn/prefer-string-replace-all * fix(deps): add sanitize-html * style: fix no-prototype-builtins * style: fix unicorn/consistent-destructuring * style: fix unicorn/consistent-function-scoping * style: fix unicorn/prefer-regexp-test * style: fix unicorn/prefer-logical-operator-over-ternary * style: fix unicorn/no-array-callback-reference * style: add prefer-object-has-own * style: warn unicorn/no-empty-file * style: fix unicorn/prefer-number-properties * style: fix no-useless-undefined again * style: fix unicorn/numeric-separators-style * style: disable unicorn/no-array-callback-reference false postive with cheerio --- .eslintrc.json | 92 +-- assets/radar-rules.js | 6 +- lib/{api_router.js => api-router.js} | 5 +- lib/app.js | 10 +- lib/config.js | 20 +- lib/{core_router.js => core-router.js} | 0 lib/index.js | 4 +- lib/maintainer.js | 18 +- lib/middleware/access-control.js | 26 +- lib/middleware/anti-hotlink.js | 27 +- lib/middleware/cache/index.js | 18 +- lib/middleware/cache/redis.js | 8 +- lib/middleware/header.js | 2 +- lib/middleware/load-on-demand.js | 6 +- lib/middleware/onerror.js | 30 +- lib/middleware/parameter.js | 60 +- lib/middleware/template.js | 80 ++- lib/middleware/utf8.js | 2 +- ...rotected_router.js => protected-router.js} | 0 lib/radar-rules.js | 6 +- lib/radar.js | 46 +- lib/router.js | 62 +- lib/routes/005tv/zx.js | 2 +- lib/routes/10000link/news.js | 4 +- lib/routes/12379/index.js | 2 +- lib/routes/21caijing/channel.js | 6 +- lib/routes/60s-science/transcript.js | 6 +- lib/routes/755/user.js | 6 +- lib/routes/99percentinvisible/transcript.js | 4 +- lib/routes/acm/amturingaward.js | 4 +- lib/routes/acwifi/index.js | 4 +- lib/routes/adquan/index.js | 7 +- lib/routes/aiyanxishe/home.js | 46 +- lib/routes/amazfitwatchfaces/search.js | 2 +- lib/routes/amd/graphicsdrivers.js | 6 +- .../anigamer/{new_anime.js => new-anime.js} | 0 lib/routes/aozora/newbook.js | 18 +- lib/routes/appsales/index.js | 4 +- lib/routes/archdaily/home.js | 4 +- lib/routes/asahi/index.js | 8 +- lib/routes/autotrader/index.js | 4 +- lib/routes/avgle/videos.js | 8 +- lib/routes/axis-studios/work.js | 127 ++--- lib/routes/babykingdom/index.js | 38 +- .../{creation_index.js => creation-index.js} | 8 +- lib/routes/bahamut/utils.js | 14 +- lib/routes/bandisoft/index.js | 2 +- lib/routes/banyuetan/index.js | 4 +- lib/routes/benedictevans/recent.js | 4 +- lib/routes/bibgame/category.js | 2 +- lib/routes/bjnews/news.js | 4 +- lib/routes/blogs/hedwig.js | 6 +- .../{jingwei_link.js => jingwei-link.js} | 0 lib/routes/blogs/wangyin.js | 4 +- lib/routes/blogs/wordpress.js | 10 +- lib/routes/blow-studio/work.js | 4 +- lib/routes/blur-studio/index.js | 14 +- lib/routes/booth-pm/shop.js | 6 +- lib/routes/ccg/index.js | 2 +- lib/routes/cell/cell/index.js | 4 +- lib/routes/cell/cover.js | 2 +- lib/routes/cfan/news.js | 4 +- lib/routes/cgtn/most.js | 2 +- lib/routes/cgtn/opinions.js | 2 +- lib/routes/chaoli/index.js | 2 +- lib/routes/chicagotribune/index.js | 4 +- lib/routes/chiphell/forum.js | 8 +- lib/routes/chocolatey/software.js | 2 +- lib/routes/chouti/top.js | 2 +- lib/routes/chsi/zszcgd.js | 2 +- lib/routes/cnu/discovery.js | 12 +- lib/routes/cnu/selected.js | 10 +- lib/routes/cnu/utils.js | 8 +- lib/routes/cpython/index.js | 6 +- lib/routes/cs/news.js | 2 +- lib/routes/csc/notice.js | 8 +- lib/routes/daxiaamu/home.js | 4 +- lib/routes/ddrk/list.js | 2 +- lib/routes/deepl/blog.js | 2 +- lib/routes/dev.to/top.js | 4 +- lib/routes/dgtle/index.js | 4 +- lib/routes/dgtle/keyword.js | 3 +- lib/routes/dgtle/trade.js | 4 +- .../dgtle/{whale_rank.js => whale-rank.js} | 0 lib/routes/dida365/habit-checkins.js | 15 +- lib/routes/digitaling/article.js | 2 +- lib/routes/digitaling/index.js | 2 +- lib/routes/digitaling/project.js | 2 +- lib/routes/discuss/index.js | 16 +- lib/routes/disqus/posts.js | 10 +- lib/routes/dongmanmanhua/comic.js | 4 +- lib/routes/duozhi/index.js | 9 +- lib/routes/edrawsoft/mindmap.js | 10 +- lib/routes/eeo/index.js | 6 +- lib/routes/emi-nitta/home.js | 9 +- lib/routes/enclavebooks/category.js | 9 +- lib/routes/enclavebooks/collection.js | 2 +- lib/routes/enclavebooks/user.js | 2 +- lib/routes/engadget/home.js | 10 +- lib/routes/etherscan/transactions.js | 2 +- lib/routes/everything/changes.js | 6 +- lib/routes/fanbox/conv.js | 12 +- lib/routes/fanbox/main.js | 6 +- .../{home_timeline.js => home-timeline.js} | 0 ...{public_timeline.js => public-timeline.js} | 0 .../{user_timeline.js => user-timeline.js} | 0 lib/routes/fashionnetwork/headline.js | 2 +- lib/routes/fashionnetwork/news.js | 8 +- lib/routes/furaffinity/home.js | 33 +- ...ournal_comments.js => journal-comments.js} | 0 lib/routes/furaffinity/status.js | 9 +- ...ion_comments.js => submission-comments.js} | 0 lib/routes/furaffinity/user.js | 40 +- lib/routes/galaxylab/index.js | 2 +- lib/routes/gamersky/ent.js | 4 +- lib/routes/gaoqing/utils.js | 2 +- lib/routes/gitlab/explore.js | 4 +- lib/routes/gitlab/release.js | 2 +- lib/routes/gitlab/tag.js | 2 +- lib/routes/go.jp/mofa/main.js | 15 +- lib/routes/gov/beijing/eea.js | 8 +- lib/routes/gov/beijing/mhc.js | 2 +- lib/routes/gov/chongqing/ljxq/zwgk.js | 2 +- .../nanjing/{getContent.js => get-content.js} | 4 +- lib/routes/gov/city/nanjing/index.js | 2 +- lib/routes/gov/cnca/hydt.js | 4 +- lib/routes/gov/cnca/jgdt.js | 4 +- lib/routes/gov/cnca/zxtz.js | 8 +- lib/routes/gov/cppcc/index.js | 4 +- lib/routes/gov/guangdong/edu.js | 2 +- lib/routes/gov/guangdong/eea.js | 2 +- lib/routes/gov/harbin/kjj.js | 4 +- lib/routes/gov/hubei/hbsia.js | 2 +- lib/routes/gov/hunan/notice.js | 4 +- lib/routes/gov/mohrss/sbjm.js | 4 +- lib/routes/gov/mohurd/policy.js | 2 +- lib/routes/gov/ngd/index.js | 4 +- lib/routes/gov/nppa/channels.js | 4 +- lib/routes/gov/nppa/contents.js | 2 +- .../jiangsu/{getContent.js => get-content.js} | 4 +- lib/routes/gov/province/jiangsu/index.js | 2 +- lib/routes/gov/sapprft/7026.js | 4 +- lib/routes/gov/shanghai/sthj.js | 2 +- lib/routes/gov/taiwan/mnd.js | 4 +- lib/routes/gov/veterans/china.js | 2 +- lib/routes/gov/veterans/hebei.js | 10 +- lib/routes/gov/wuhan/kjj.js | 2 +- lib/routes/gov/wuhan/wehdz.js | 2 +- lib/routes/gov/xinwen/tujie.js | 2 +- lib/routes/guanggoo/index.js | 2 +- lib/routes/guardian/guardian.js | 4 +- lib/routes/guat/news.js | 2 +- lib/routes/guet/news.js | 10 +- lib/routes/gwern/category.js | 4 +- lib/routes/hackerone/hacktivity.js | 6 +- lib/routes/hackerone/search.js | 6 +- lib/routes/haohaozhu/discover.js | 2 +- lib/routes/haohaozhu/whole-house.js | 10 +- lib/routes/hdx/explore.js | 4 +- lib/routes/hentai-cosplays/utils.js | 4 +- lib/routes/hexo/fluid.js | 2 +- lib/routes/hexo/next.js | 2 +- lib/routes/hexo/yilia.js | 2 +- lib/routes/hkej/index.js | 2 +- lib/routes/huya/live.js | 2 +- lib/routes/icourse163/newest.js | 2 +- lib/routes/idownloadblog/index.js | 2 +- lib/routes/ifanr/index.js | 8 +- lib/routes/ifnews/column.js | 8 +- lib/routes/im2maker/index.js | 2 +- lib/routes/index.js | 17 +- lib/routes/indienova/article.js | 4 +- ...mical_events.js => astronomical-events.js} | 0 lib/routes/iplay/utils.js | 8 +- lib/routes/ipsw/index.js | 57 +- lib/routes/jinse/lives.js | 2 +- lib/routes/jpmorganchase/research.js | 4 +- lib/routes/jx3/news.js | 8 +- lib/routes/kaiyan/index.js | 4 +- ...pular_recent.js => post-popular-recent.js} | 0 lib/routes/kongfz/shop.js | 2 +- lib/routes/kuai/id.js | 4 +- lib/routes/kuai/index.js | 4 +- lib/routes/lastfm/loved.js | 2 +- lib/routes/lastfm/recent.js | 2 +- lib/routes/lastfm/top.js | 2 +- lib/routes/law/dh.js | 4 +- lib/routes/law/gf.js | 4 +- lib/routes/law/hq.js | 4 +- lib/routes/law/hw.js | 4 +- lib/routes/law/jctd.js | 4 +- lib/routes/law/jh.js | 4 +- lib/routes/law/jtc.js | 4 +- lib/routes/law/ts.js | 4 +- lib/routes/law/zl.js | 4 +- lib/routes/letterboxd/utils.js | 12 +- lib/routes/lifetimes/index.js | 18 +- lib/routes/liyuan-forums/threads.js | 24 +- lib/routes/lol/newsindex.js | 42 +- lib/routes/lolapp/article.js | 4 +- lib/routes/mafengwo/note.js | 2 +- lib/routes/magireco/announcements.js | 2 +- .../{event_banner.js => event-banner.js} | 2 +- lib/routes/manxiaosi/book.js | 2 +- .../{hotComplete.js => hot-complete.js} | 10 +- lib/routes/mcdonalds/news.js | 6 +- lib/routes/mediadigest/category.js | 10 +- lib/routes/meihua/article.js | 2 +- lib/routes/meihua/shots.js | 2 +- lib/routes/meituan/open/announce.js | 4 +- lib/routes/method-studios/index.js | 10 +- lib/routes/mhw/news.js | 9 +- lib/routes/mhw/update.js | 7 +- lib/routes/mi/crowdfunding.js | 6 +- lib/routes/mi/miui/index.js | 2 +- lib/routes/micmicidol/article.js | 2 +- lib/routes/microsoft-store/updates.js | 2 +- lib/routes/mihoyo/bh2.js | 2 +- lib/routes/mihoyo/bh3.js | 2 +- .../{get_entries.js => get-entries.js} | 14 +- .../miniflux/{get_feeds.js => get-feeds.js} | 6 +- lib/routes/missevan/drama.js | 2 +- lib/routes/missevan/latest.js | 6 +- lib/routes/modian/zhongchou.js | 6 +- lib/routes/moxingfans/index.js | 4 +- lib/routes/muchong/journal.js | 2 +- lib/routes/netflix/newsroom.js | 4 +- lib/routes/nobelprize/index.js | 2 +- lib/routes/noi/index.js | 2 +- lib/routes/noi/province-news.js | 2 +- lib/routes/noi/rg-news.js | 2 +- lib/routes/noi/winners-list.js | 2 +- lib/routes/nosec/index.js | 6 +- lib/routes/novel/biquge.js | 2 +- lib/routes/novel/biqugeinfo.js | 11 +- lib/routes/novel/uukanshu.js | 4 +- lib/routes/one/index.js | 4 +- lib/routes/owspace/read.js | 16 +- lib/routes/p-articles/contributors.js | 2 +- lib/routes/p-articles/section.js | 2 +- lib/routes/patchwork.kernel.org/comments.js | 2 +- lib/routes/pcr/news-cn.js | 2 +- lib/routes/pcr/news-tw.js | 8 +- lib/routes/pediy/topic.js | 10 +- lib/routes/pediy/utils.js | 10 +- lib/routes/piapro/public.js | 6 +- lib/routes/piapro/user.js | 2 +- lib/routes/piapro/utils.js | 2 +- lib/routes/pmcaff/feed.js | 4 +- lib/routes/pmcaff/list.js | 4 +- lib/routes/pork-price/index.js | 4 +- lib/routes/potplayer/update.js | 6 +- lib/routes/project-zero-issues/index.js | 4 +- lib/routes/ptpress/book.js | 2 +- lib/routes/qstheory/index.js | 2 +- lib/routes/quantamagazine/archive.js | 24 +- lib/routes/qutoutiao/category.js | 8 +- lib/routes/react/react-native-weekly.js | 2 +- lib/routes/remote-work/index.js | 2 +- lib/routes/rescuetime/release-notes.js | 4 +- lib/routes/rthk-news/index.js | 4 +- lib/routes/scboy/thread.js | 2 +- .../{release_notes.js => release-notes.js} | 0 lib/routes/sexinsex/index.js | 12 +- lib/routes/shanbay/checkin.js | 6 +- lib/routes/shanbay/footprints.js | 4 +- lib/routes/simonsfoundation/articles.js | 11 +- lib/routes/simpread/changelog.js | 8 +- lib/routes/sketch/updates.js | 6 +- lib/routes/socialbeta/home.js | 4 +- lib/routes/socialclub/events.js | 4 +- lib/routes/soul/hot.js | 34 +- lib/routes/soundcloud/utils.js | 2 +- lib/routes/steam/search.js | 2 +- lib/routes/t66y/index.js | 47 +- lib/routes/t66y/post.js | 22 +- lib/routes/technologyreview/topic.js | 4 +- lib/routes/tencent/tucaoqq/post.js | 4 +- .../tencent/wechat/miniprogram/devtools.js | 9 +- .../tencent/wechat/miniprogram/framework.js | 6 +- .../tencent/wechat/miniprogram/wxcloud.js | 8 +- lib/routes/tingdiantz/95598.js | 7 +- lib/routes/titsguru/model.js | 2 +- lib/routes/titsguru/util.js | 4 +- lib/routes/tongli/news.js | 2 +- lib/routes/totalcommander/whatsnew.js | 2 +- lib/routes/touhougarakuta/index.js | 2 +- lib/routes/touhougarakuta/json2html.js | 8 +- lib/routes/tprtc/cqzr.js | 4 +- lib/routes/tprtc/news.js | 4 +- lib/routes/tprtc/qyzc.js | 4 +- lib/routes/ui-cn/article.js | 11 +- lib/routes/unit-image/films.js | 4 +- lib/routes/universities/ahau/cs_news/utils.js | 2 +- lib/routes/universities/ahau/jwc/utils.js | 2 +- lib/routes/universities/ahau/main/utils.js | 2 +- lib/routes/universities/ahmu/news.js | 2 +- lib/routes/universities/ahut/cstzgg.js | 2 +- lib/routes/universities/ahut/jwc.js | 2 +- lib/routes/universities/ahut/news.js | 2 +- lib/routes/universities/bjtu/gs/index.js | 6 +- lib/routes/universities/bupt/funbox.js | 6 +- lib/routes/universities/bupt/grs.js | 6 +- lib/routes/universities/bupt/news.js | 8 +- lib/routes/universities/bupt/portal.js | 8 +- lib/routes/universities/bupt/utils.js | 7 +- lib/routes/universities/bwu/utils.js | 2 +- lib/routes/universities/cpu/home.js | 2 +- lib/routes/universities/cpu/jwc.js | 2 +- lib/routes/universities/cpu/yjsy.js | 2 +- .../universities/cqu/jwc/announcement.js | 2 +- lib/routes/universities/cqu/net/info.js | 2 +- lib/routes/universities/cqu/news/tz.js | 2 +- lib/routes/universities/cqu/news/utils.js | 4 +- lib/routes/universities/cqu/sci/info.js | 7 +- lib/routes/universities/cqu/youth/info.js | 7 +- lib/routes/universities/cug/gcxy/index.js | 4 +- lib/routes/universities/cug/news.js | 8 +- lib/routes/universities/cuit/cxxww.js | 4 +- lib/routes/universities/dlmu/news.js | 6 +- lib/routes/universities/dlu/jiaowu/news.js | 9 +- lib/routes/universities/fudan/cce.js | 6 +- .../fzu/{news_min.js => news-min.js} | 0 lib/routes/universities/gdou/jwc/utils.js | 4 +- lib/routes/universities/gzmtu/jwc/utils.js | 2 +- lib/routes/universities/gzmtu/tsg/utils.js | 2 +- .../hhu/{libNews.js => lib-news.js} | 12 +- .../hhu/{libNewsc.js => lib-newsc.js} | 38 +- .../universities/hnust/graduate/index.js | 2 +- lib/routes/universities/jnu/yw/index.js | 4 +- lib/routes/universities/kmust/job/careers.js | 2 +- lib/routes/universities/kmust/job/jobfairs.js | 2 +- lib/routes/universities/kmust/jwc.js | 2 +- lib/routes/universities/lit/jwc.js | 2 +- lib/routes/universities/lit/tw.js | 2 +- lib/routes/universities/lit/xwzx.js | 4 +- lib/routes/universities/lntu/jwnews.js | 4 +- lib/routes/universities/lyu/news/utils.js | 2 +- .../universities/mit/graduateadmissions.js | 6 +- lib/routes/universities/nciae/news.js | 6 +- lib/routes/universities/nciae/tzgg.js | 6 +- lib/routes/universities/nciae/xsxx.js | 6 +- lib/routes/universities/njfu/jwc.js | 9 +- lib/routes/universities/njtech/jwc.js | 6 +- lib/routes/universities/nuc/index.js | 8 +- lib/routes/universities/nudt/yjszs.js | 7 +- .../universities/shanghaitech/activity.js | 2 +- .../shanghaitech/sist/activity.js | 6 +- lib/routes/universities/shou/www.js | 2 +- lib/routes/universities/slu/utils.js | 4 +- lib/routes/universities/swufe/seie/index.js | 6 +- lib/routes/universities/swust/cs.js | 41 +- lib/routes/universities/swust/helper.js | 2 +- .../swust/{jwc_news.js => jwc-news.js} | 2 +- .../swust/{jwc_notice.js => jwc-notice.js} | 2 +- lib/routes/universities/thu/index.js | 79 ++- lib/routes/universities/usst/jwc.js | 6 +- lib/routes/universities/utdallas/isso.js | 6 +- lib/routes/universities/ynnu/edu/base64.js | 9 +- lib/routes/universities/ynnu/edu/news.js | 6 +- lib/routes/universities/ynu/utils.js | 16 +- lib/routes/universities/yzu/home.js | 8 +- lib/routes/universities/yzu/yjszs.js | 8 +- lib/routes/universities/zjgsu/tzgg/utils.js | 2 +- lib/routes/universities/zjut/design.js | 6 +- lib/routes/universities/zjut/index.js | 2 +- .../universities/zucc/cssearch/index.js | 2 +- lib/routes/universities/zucc/news/index.js | 8 +- lib/routes/universities/zzu/news.js | 2 +- lib/routes/universities/zzu/soft/news.js | 2 +- .../{argument_audio.js => argument-audio.js} | 0 lib/routes/uwants/index.js | 14 +- lib/routes/voa/index.js | 2 +- lib/routes/vol/lastupdate.js | 6 +- lib/routes/vulture/utils.js | 2 +- lib/routes/watchface/update.js | 8 +- lib/routes/webtoons/comic.js | 4 +- lib/routes/webtoons/naver.js | 2 +- lib/routes/weexcn/index.js | 4 +- lib/routes/wegene/column.js | 7 +- lib/routes/weidian/goods.js | 2 +- lib/routes/whb/zhuzhan.js | 14 +- lib/routes/wto/dispute-settlement.js | 2 +- lib/routes/xiachufang/utils.js | 11 +- lib/routes/xiaoheihe/discount.js | 4 +- lib/routes/xiaoheihe/news.js | 6 +- lib/routes/xiaoheihe/user.js | 2 +- lib/routes/xuangubao/subject.js | 7 +- .../{course_info.js => course-info.js} | 0 .../{course_list.js => course-list.js} | 6 +- ...pular_recent.js => post-popular-recent.js} | 0 lib/routes/yinxiang/card.js | 8 +- lib/routes/yinxiang/category.js | 8 +- lib/routes/yinxiang/note.js | 8 +- lib/routes/yinxiang/personal.js | 8 +- lib/routes/yinxiang/tag.js | 8 +- lib/routes/youdao/latest.js | 2 +- lib/routes/youdao/xueba.js | 4 +- lib/routes/yuzu-emu/entry.js | 2 +- lib/routes/zhishifenzi/depth.js | 4 +- lib/routes/zhishifenzi/innovation.js | 12 +- lib/routes/zhuixinfan/list.js | 6 +- lib/routes/zreading/home.js | 4 +- lib/routes/zsnews/index.js | 4 +- lib/utils/cf-email.js | 2 +- lib/utils/common-config.js | 6 +- lib/utils/common-utils.js | 2 +- lib/utils/{dateParser.js => date-parser.js} | 31 +- lib/utils/date.js | 76 +-- lib/utils/got.js | 2 +- lib/utils/logger.js | 6 +- lib/utils/pac-proxy.js | 14 +- lib/utils/parse-date.js | 34 +- lib/utils/puppeteer.js | 28 +- lib/utils/readable-social.js | 6 +- lib/utils/request-wrapper.js | 38 +- lib/utils/unify-proxy.js | 30 +- lib/utils/valid-host.js | 2 +- lib/utils/wechat-mp.js | 20 +- lib/v2/12306/index.js | 6 +- lib/v2/12306/zxdt.js | 17 +- lib/v2/141jav/radar.js | 4 +- lib/v2/141ppv/radar.js | 4 +- lib/v2/163/exclusive.js | 2 +- lib/v2/163/music/artist-songs.js | 2 +- lib/v2/163/music/djradio.js | 2 +- lib/v2/163/music/userplayrecords.js | 2 +- lib/v2/163/news/rank.js | 10 +- lib/v2/163/news/special.js | 8 +- lib/v2/163/open/vip.js | 2 +- lib/v2/163/renjian.js | 4 +- lib/v2/163/today.js | 2 +- lib/v2/18comic/index.js | 2 +- lib/v2/18comic/search.js | 2 +- lib/v2/18comic/utils.js | 6 +- lib/v2/19lou/index.js | 2 +- lib/v2/1point3acres/blog.js | 4 +- lib/v2/1point3acres/category.js | 2 +- lib/v2/1point3acres/offer.js | 10 +- lib/v2/1point3acres/section.js | 4 +- lib/v2/1point3acres/thread.js | 2 +- lib/v2/1point3acres/utils.js | 4 +- lib/v2/2048/index.js | 2 +- lib/v2/2cycd/radar.js | 2 +- lib/v2/36kr/hot-list.js | 4 +- lib/v2/36kr/index.js | 8 +- lib/v2/36kr/utils.js | 8 +- lib/v2/3dmgame/game.js | 7 +- .../{news_center.js => news-center.js} | 2 +- lib/v2/3dmgame/router.js | 2 +- lib/v2/4ksj/forum.js | 25 +- lib/v2/500px/router.js | 2 +- lib/v2/500px/{tribeSet.js => tribe-set.js} | 2 +- lib/v2/500px/user.js | 2 +- lib/v2/500px/utils.js | 2 +- lib/v2/50forum/zhuanjia.js | 2 +- lib/v2/591/list.js | 2 +- lib/v2/5eplay/utils.js | 11 +- lib/v2/6park/index.js | 6 +- lib/v2/6park/news.js | 12 +- .../{latestMovies.js => latest-movies.js} | 0 .../{latestTVSeries.js => latest-tvseries.js} | 0 lib/v2/6v123/router.js | 4 +- lib/v2/6v123/utils.js | 6 +- lib/v2/78dm/index.js | 4 +- lib/v2/7mmtv/radar.js | 4 +- lib/v2/81/81rc/index.js | 2 +- lib/v2/8264/list.js | 4 +- lib/v2/8kcos/article.js | 2 +- lib/v2/8kcos/cat.js | 2 +- lib/v2/8kcos/latest.js | 2 +- lib/v2/8kcos/tag.js | 2 +- lib/v2/91porn/utils.js | 4 +- lib/v2/9to5/subsite.js | 2 +- lib/v2/9to5/utils.js | 2 +- lib/v2/abc/index.js | 23 +- lib/v2/abskoop/index.js | 2 +- lib/v2/abskoop/nsfw.js | 2 +- lib/v2/acfun/article.js | 8 +- lib/v2/acpaa/index.js | 4 +- lib/v2/aeon/utils.js | 2 +- lib/v2/agirls/router.js | 2 +- .../agirls/{topic_list.js => topic-list.js} | 0 lib/v2/agora0/index.js | 2 +- lib/v2/ahjzu/news.js | 2 +- lib/v2/aicaijing/index.js | 2 +- lib/v2/aijishu/utils.js | 6 +- lib/v2/ainvest/article.js | 2 +- lib/v2/ainvest/news.js | 2 +- lib/v2/ainvest/utils.js | 4 +- lib/v2/aip/journal-pupp.js | 2 +- lib/v2/aisixiang/column.js | 4 +- lib/v2/aisixiang/thinktank.js | 2 +- lib/v2/aisixiang/toplist.js | 2 +- lib/v2/aisixiang/utils.js | 4 +- lib/v2/aisixiang/zhuanti.js | 2 +- lib/v2/aliresearch/information.js | 2 +- .../{database_month.js => database-month.js} | 0 lib/v2/aliyun/router.js | 2 +- lib/v2/aljazeera/index.js | 4 +- lib/v2/ally/rail.js | 4 +- lib/v2/amazon/kindle-software-updates.js | 2 +- lib/v2/annualreviews/index.js | 2 +- lib/v2/anquanke/vul.js | 6 +- lib/v2/apkpure/versions.js | 4 +- lib/v2/apnews/topics.js | 2 +- lib/v2/app-center/release.js | 2 +- lib/v2/apple/apps.js | 10 +- ...{exchange_repair.js => exchange-repair.js} | 0 lib/v2/apple/router.js | 2 +- lib/v2/appleinsider/index.js | 2 +- lib/v2/aqara/community.js | 2 +- lib/v2/aqara/news.js | 4 +- lib/v2/aqara/post.js | 4 +- lib/v2/arcteryx/new-arrivals.js | 5 +- lib/v2/arcteryx/outlet.js | 5 +- lib/v2/arcteryx/regear-new-arrivals.js | 6 +- lib/v2/arcteryx/utils.js | 6 +- lib/v2/artstation/user.js | 8 +- lib/v2/asiantolick/index.js | 4 +- lib/v2/atcoder/contest.js | 2 +- lib/v2/baai/comments.js | 5 +- lib/v2/baai/events.js | 7 +- lib/v2/baai/hub.js | 11 +- lib/v2/backlinko/blog.js | 2 +- lib/v2/baidu/tieba/post.js | 2 +- lib/v2/bangumi/moe/index.js | 2 +- lib/v2/bangumi/online/online.js | 2 +- lib/v2/bangumi/tv/calendar/today.js | 10 +- lib/v2/bangumi/tv/group/reply.js | 2 +- lib/v2/bangumi/tv/other/followrank.js | 38 +- lib/v2/bangumi/tv/person/index.js | 2 +- lib/v2/bangumi/tv/subject/comments.js | 11 +- lib/v2/bangumi/tv/subject/ep.js | 4 +- lib/v2/bangumi/tv/subject/index.js | 2 +- lib/v2/bast/index.js | 2 +- lib/v2/bbc/index.js | 22 +- lib/v2/bbc/utils.js | 2 +- lib/v2/bbcnewslabs/news.js | 3 +- lib/v2/bdys/index.js | 4 +- lib/v2/behance/radar.js | 9 +- lib/v2/bendibao/news.js | 6 +- lib/v2/bilibili/bangumi.js | 24 +- lib/v2/bilibili/cache.js | 22 +- lib/v2/bilibili/coin.js | 4 +- lib/v2/bilibili/danmaku.js | 8 +- lib/v2/bilibili/dynamic.js | 86 +-- lib/v2/bilibili/fav.js | 4 +- lib/v2/bilibili/followers.js | 4 +- ...wings_article.js => followings-article.js} | 4 +- ...wings_dynamic.js => followings-dynamic.js} | 86 +-- ...ollowings_video.js => followings-video.js} | 6 +- lib/v2/bilibili/followings.js | 6 +- .../bilibili/{hotSearch.js => hot-search.js} | 0 lib/v2/bilibili/{linkNews.js => link-news.js} | 2 +- lib/v2/bilibili/{liveArea.js => live-area.js} | 0 lib/v2/bilibili/{liveRoom.js => live-room.js} | 2 +- .../{liveSearch.js => live-search.js} | 0 lib/v2/bilibili/{mallIP.js => mall-ip.js} | 0 lib/v2/bilibili/{mallNew.js => mall-new.js} | 4 +- ...anga_followings.js => manga-followings.js} | 4 +- .../{manga_update.js => manga-update.js} | 0 lib/v2/bilibili/page.js | 4 +- lib/v2/bilibili/partion-ranking.js | 14 +- lib/v2/bilibili/partion.js | 4 +- lib/v2/bilibili/popular.js | 2 +- lib/v2/bilibili/radar.js | 2 +- lib/v2/bilibili/ranking.js | 8 +- lib/v2/bilibili/readlist.js | 2 +- lib/v2/bilibili/router.js | 34 +- .../{user_bangumi.js => user-bangumi.js} | 4 +- .../{userChannel.js => user-channel.js} | 4 +- .../{userCollection.js => user-collection.js} | 4 +- lib/v2/bilibili/{userFav.js => user-fav.js} | 2 +- lib/v2/bilibili/utils.js | 6 +- lib/v2/bilibili/video-all.js | 6 +- lib/v2/bilibili/video.js | 2 +- lib/v2/bilibili/vsearch.js | 8 +- lib/v2/bilibili/watchlater.js | 6 +- ...eekly_recommend.js => weekly-recommend.js} | 2 +- lib/v2/bing/daily-wallpaper.js | 2 +- lib/v2/bioone/featured.js | 4 +- lib/v2/bioone/journal.js | 2 +- lib/v2/biquge/index.js | 10 +- lib/v2/bitmovin/blog.js | 2 +- lib/v2/bjfu/it/utils.js | 2 +- lib/v2/bjfu/news/utils.js | 2 +- lib/v2/bjsk/keti.js | 2 +- lib/v2/bjwxdxh/index.js | 2 +- lib/v2/bjx/huanbao.js | 4 +- lib/v2/blizzard/news.js | 2 +- lib/v2/bloomberg/utils.js | 27 +- lib/v2/bnu/dwxgb.js | 4 +- lib/v2/boc/whpj.js | 2 +- lib/v2/bossdesign/index.js | 2 +- lib/v2/bse/index.js | 11 +- lib/v2/bsky/keyword.js | 2 +- lib/v2/bsky/posts.js | 8 +- lib/v2/btzj/index.js | 4 +- lib/v2/byteclicks/index.js | 2 +- lib/v2/byteclicks/tag.js | 2 +- lib/v2/bytes/bytes.js | 2 +- lib/v2/c114/roll.js | 2 +- lib/v2/caijing/roll.js | 2 +- lib/v2/caixin/blog.js | 52 +- lib/v2/caixin/category.js | 6 +- lib/v2/caixin/utils.js | 37 +- lib/v2/caixin/weekly.js | 25 +- lib/v2/caixinglobal/latest.js | 2 +- lib/v2/camchina/index.js | 2 +- lib/v2/cankaoxiaoxi/index.js | 2 +- lib/v2/cas/is/index.js | 2 +- lib/v2/cas/mesalab/kb.js | 2 +- lib/v2/cau/yjs.js | 2 +- lib/v2/caus/index.js | 2 +- lib/v2/cbaigui/index.js | 4 +- lib/v2/ccf/ccfcv/index.js | 2 +- lib/v2/cctv/jx.js | 2 +- lib/v2/cctv/lm.js | 2 +- lib/v2/cctv/utils/mzzlbg.js | 2 +- lib/v2/cde/utils.js | 2 +- lib/v2/cdi/index.js | 2 +- .../{projectList.js => project-list.js} | 0 lib/v2/cdzjryb/router.js | 2 +- lib/v2/cfachina/analygarden.js | 2 +- lib/v2/changba/user.js | 4 +- lib/v2/chiculture/topic.js | 8 +- lib/v2/china/finance/finance.js | 2 +- lib/v2/chinaisa/index.js | 4 +- lib/v2/chinanews/index.js | 2 +- lib/v2/chinaventure/index.js | 2 +- lib/v2/chinawriter/index.js | 12 +- lib/v2/chsi/hotnews.js | 14 +- lib/v2/chsi/kydt.js | 7 +- lib/v2/chsi/kyzx.js | 6 +- lib/v2/civitai/discussions.js | 4 +- lib/v2/cls/depth.js | 19 +- lib/v2/cls/hot.js | 2 +- lib/v2/cls/telegraph.js | 2 +- lib/v2/cma/channel.js | 2 +- lib/v2/cna/index.js | 2 +- lib/v2/cna/web/index.js | 10 +- lib/v2/cnbc/rss.js | 2 +- lib/v2/cnbeta/utils.js | 2 +- lib/v2/cneb/yjxw.js | 6 +- lib/v2/cneb/yjxx.js | 2 +- lib/v2/cnjxol/index.js | 6 +- lib/v2/cnljxh/index.js | 4 +- lib/v2/cntv/column.js | 2 +- lib/v2/codeforces/contests.js | 4 +- .../{recent_actions.js => recent-actions.js} | 0 lib/v2/codeforces/router.js | 2 +- lib/v2/cool18/index.js | 4 +- lib/v2/coolapk/dyh.js | 4 +- lib/v2/coolapk/hot.js | 2 +- lib/v2/coolapk/huati.js | 4 +- lib/v2/coolapk/router.js | 2 +- .../{userDynamic.js => user-dynamic.js} | 6 +- lib/v2/coolapk/utils.js | 12 +- lib/v2/coomer/utils.js | 2 +- lib/v2/copymanga/comic.js | 11 +- lib/v2/cpcey/index.js | 4 +- lib/v2/crac/index.js | 2 +- lib/v2/creative-comic/book.js | 2 +- lib/v2/cssn/iolaw.js | 2 +- lib/v2/cste/index.js | 2 +- lib/v2/csu/utils.js | 2 +- lib/v2/cts/news.js | 2 +- lib/v2/cyzone/author.js | 6 +- lib/v2/cyzone/index.js | 6 +- lib/v2/cyzone/label.js | 6 +- lib/v2/cyzone/util.js | 7 +- lib/v2/dahecube/radar.js | 6 +- lib/v2/damai/activity.js | 6 +- lib/v2/dayanzai/index.js | 32 +- lib/v2/dblp/publication.js | 7 +- lib/v2/dcard/section.js | 2 +- lib/v2/dcard/utils.js | 10 +- lib/v2/dcfever/news.js | 2 +- lib/v2/deadline/posts.js | 4 +- lib/v2/dedao/knowledge.js | 2 +- lib/v2/dedao/list.js | 4 +- lib/v2/dedao/user.js | 4 +- lib/v2/dgjyw/index.js | 2 +- lib/v2/dgjyw/router.js | 2 +- lib/v2/dhu/jiaowu/news.js | 6 +- lib/v2/dhu/xxgk/news.js | 4 +- lib/v2/diershoubing/news.js | 2 +- lib/v2/discord/channel.js | 2 +- lib/v2/discourse/notifications.js | 4 +- lib/v2/discourse/utils.js | 2 +- lib/v2/discuz/discuz.js | 16 +- lib/v2/discuz/radar.js | 1 + lib/v2/dlnews/category.js | 37 +- lib/v2/dlsite/campaign.js | 2 +- lib/v2/dlsite/ci-en/article.js | 2 +- lib/v2/dlsite/new.js | 4 +- lib/v2/dlsite/utils.js | 6 +- lib/v2/dn/news.js | 2 +- lib/v2/dockerhub/build.js | 2 +- lib/v2/dockerhub/radar.js | 4 +- lib/v2/dockerhub/tag.js | 2 +- lib/v2/domp4/detail.js | 4 +- lib/v2/domp4/utils.js | 8 +- .../{player_news.js => player-news.js} | 0 lib/v2/dongqiudi/result.js | 2 +- lib/v2/dongqiudi/router.js | 6 +- lib/v2/dongqiudi/special.js | 2 +- .../dongqiudi/{team_news.js => team-news.js} | 0 lib/v2/dongqiudi/{top_news.js => top-news.js} | 2 +- lib/v2/dongqiudi/utils.js | 2 +- lib/v2/dorohedoro/news.js | 4 +- lib/v2/douban/channel/topic.js | 2 +- lib/v2/douban/other/celebrity.js | 2 +- lib/v2/douban/other/classification.js | 22 +- .../{explore_column.js => explore-column.js} | 2 +- lib/v2/douban/other/explore.js | 2 +- lib/v2/douban/other/group.js | 2 +- .../other/{latest_book.js => latest-book.js} | 0 .../{latest_music.js => latest-music.js} | 0 lib/v2/douban/other/list.js | 2 +- lib/v2/douban/other/playing.js | 26 +- lib/v2/douban/other/recommended.js | 2 +- lib/v2/douban/other/replied.js | 4 +- lib/v2/douban/other/topic.js | 4 +- .../other/{weekly_best.js => weekly-best.js} | 0 lib/v2/douban/people/status.js | 100 ++-- lib/v2/douban/people/wish.js | 8 +- lib/v2/douban/radar.js | 2 +- lib/v2/douban/router.js | 8 +- lib/v2/douyin/hashtag.js | 8 +- lib/v2/douyin/live.js | 4 +- lib/v2/douyin/user.js | 8 +- lib/v2/douyin/utils.js | 22 +- lib/v2/dribbble/utils.js | 6 +- lib/v2/duozhuayu/search.js | 8 +- lib/v2/dushu/fuzhou/index.js | 2 +- lib/v2/dut/index.js | 14 +- lib/v2/dut/radar.js | 28 +- lib/v2/dut/router.js | 2 +- lib/v2/dx2025/radar.js | 2 +- lib/v2/dxy/profile/thread.js | 12 +- lib/v2/dxy/special.js | 12 +- lib/v2/dxy/utils.js | 2 +- lib/v2/e-hentai/index.js | 2 +- lib/v2/eagle/blog.js | 6 +- lib/v2/eagle/changelog.js | 6 +- lib/v2/earthquake/ceic.js | 8 +- lib/v2/earthquake/index.js | 6 +- lib/v2/eastday/24.js | 8 +- lib/v2/eastmoney/report/index.js | 2 +- lib/v2/eastmoney/search/index.js | 2 +- lib/v2/economist/espresso.js | 4 +- lib/v2/economist/full.js | 2 +- lib/v2/economist/global-business-review.js | 20 +- lib/v2/ecust/e/news.js | 4 +- lib/v2/ecust/jwc/notice.js | 2 +- lib/v2/ehentai/ehapi.js | 32 +- lib/v2/ehentai/favorites.js | 26 +- lib/v2/ehentai/search.js | 24 +- lib/v2/ehentai/tag.js | 24 +- lib/v2/eleduck/posts.js | 4 +- lib/v2/embassy/index.js | 2 +- .../{supportedList.js => supported-list.js} | 0 lib/v2/epicgames/index.js | 4 +- lib/v2/eprice/rss.js | 10 +- lib/v2/eventernote/actors.js | 4 +- lib/v2/fantia/search.js | 17 +- lib/v2/fantia/user.js | 8 +- lib/v2/farmatters/index.js | 4 +- lib/v2/fastbull/express-news.js | 2 +- lib/v2/fastbull/news.js | 2 +- lib/v2/fda/cdrh.js | 6 +- .../ff14/{ff14_global.js => ff14-global.js} | 6 +- lib/v2/ff14/{ff14_zh.js => ff14-zh.js} | 0 lib/v2/ff14/router.js | 8 +- lib/v2/fffdm/manhua/manhua.js | 7 +- .../{mostViewed.js => most-viewed.js} | 0 lib/v2/finology/router.js | 2 +- lib/v2/finviz/news.js | 8 +- lib/v2/firefox/release.js | 2 +- lib/v2/fjksbm/index.js | 4 +- lib/v2/flyert/utils.js | 5 +- lib/v2/followin/index.js | 6 +- lib/v2/followin/radar.js | 2 +- lib/v2/followin/tag.js | 4 +- lib/v2/followin/utils.js | 14 +- lib/v2/foresightnews/article.js | 2 +- lib/v2/foresightnews/column.js | 2 +- lib/v2/foresightnews/index.js | 2 +- lib/v2/foresightnews/news.js | 2 +- lib/v2/foresightnews/util.js | 5 +- lib/v2/fortunechina/index.js | 2 +- lib/v2/ft/myft.js | 9 +- lib/v2/ft/utils.js | 2 +- lib/v2/furstar/archive.js | 2 +- lib/v2/furstar/artists.js | 2 +- lib/v2/furstar/index.js | 2 +- lib/v2/futunn/main.js | 4 +- lib/v2/fx-markets/channel.js | 2 +- lib/v2/gamebase/news.js | 6 +- lib/v2/gamer/{gnn_index.js => gnn-index.js} | 22 +- lib/v2/gamer/router.js | 2 +- lib/v2/gamersecret/index.js | 2 +- lib/v2/gamme/category.js | 2 +- lib/v2/gamme/tag.js | 2 +- lib/v2/gcores/category.js | 36 +- lib/v2/gcores/collection.js | 28 +- lib/v2/gcores/radio.js | 18 +- lib/v2/gdsrx/index.js | 2 +- lib/v2/gdut/news.js | 1 + lib/v2/gdut/{oa_news.js => oa-news.js} | 82 ++- lib/v2/gdut/router.js | 2 +- lib/v2/getitfree/index.js | 6 +- lib/v2/getitfree/util.js | 22 +- lib/v2/gf-cn/news.js | 2 +- lib/v2/gitee/repos/commits.js | 2 +- lib/v2/gitee/repos/events.js | 2 +- lib/v2/gitee/repos/releases.js | 2 +- lib/v2/gitee/users/events.js | 2 +- lib/v2/github/comments.js | 34 +- lib/v2/github/contributors.js | 65 +-- lib/v2/github/issue.js | 2 +- lib/v2/github/notifications.js | 10 +- lib/v2/github/pulls.js | 2 +- lib/v2/github/router.js | 2 +- .../{starred_repos.js => starred-repos.js} | 0 lib/v2/github/trending.js | 2 +- lib/v2/gitpod/blog.js | 2 +- lib/v2/globallawreview/index.js | 2 +- lib/v2/gocn/utils.js | 2 +- lib/v2/gofans/index.js | 4 +- lib/v2/google/album.js | 2 +- lib/v2/google/fonts.js | 2 +- lib/v2/google/scholar.js | 2 +- lib/v2/gov/beijing/bphc/index.js | 2 +- lib/v2/gov/beijing/jw/tzgg.js | 2 +- lib/v2/gov/beijing/kw/index.js | 6 +- lib/v2/gov/caac/cjwt.js | 6 +- lib/v2/gov/cac/index.js | 4 +- lib/v2/gov/ccdi/index.js | 2 +- lib/v2/gov/ccdi/utils.js | 10 +- lib/v2/gov/chinamine-safety/util.js | 2 +- lib/v2/gov/chinamine-safety/xw.js | 2 +- lib/v2/gov/chinamine-safety/zfxxgk.js | 2 +- lib/v2/gov/chinatax/latest.js | 8 +- lib/v2/gov/chongqing/gzw.js | 7 +- lib/v2/gov/cmse/index.js | 4 +- lib/v2/gov/cnnic/index.js | 4 +- lib/v2/gov/forestry/gjlckjdjt.js | 4 +- lib/v2/gov/general/general.js | 50 +- lib/v2/gov/huizhou/zwgk/index.js | 2 +- lib/v2/gov/jgjcndrc/index.js | 2 +- ..._exam_notice.js => medical-exam-notice.js} | 0 lib/v2/gov/maoming/maoming.js | 76 +-- lib/v2/gov/mee/ywdt.js | 4 +- lib/v2/gov/mem/sgcc.js | 2 +- lib/v2/gov/mfa/wjdt.js | 2 +- lib/v2/gov/miit/wjfb.js | 4 +- lib/v2/gov/miit/wjgs.js | 2 +- lib/v2/gov/miit/yjzj.js | 4 +- lib/v2/gov/miit/zcjd.js | 2 +- lib/v2/gov/miit/zcwj.js | 4 +- lib/v2/gov/moa/moa.js | 14 +- lib/v2/gov/moa/zdscxx.js | 10 +- lib/v2/gov/moe/moe.js | 50 +- lib/v2/gov/mofcom/article.js | 14 +- lib/v2/gov/mot/index.js | 6 +- lib/v2/gov/ndrc/fggz.js | 4 +- lib/v2/gov/ndrc/xwdt.js | 2 +- lib/v2/gov/nea/ghs.js | 2 +- lib/v2/gov/news/index.js | 96 ++-- lib/v2/gov/nifdc/index.js | 8 +- lib/v2/gov/nopss/index.js | 2 +- lib/v2/gov/nrta/dsj.js | 2 +- lib/v2/gov/nrta/news.js | 4 +- lib/v2/gov/nsfc/index.js | 6 +- lib/v2/gov/pbc/gzlw.js | 2 +- ...eAnnouncement.js => trade-announcement.js} | 0 lib/v2/gov/radar.js | 24 +- lib/v2/gov/router.js | 8 +- lib/v2/gov/safe/business.js | 2 +- lib/v2/gov/safe/complaint.js | 2 +- lib/v2/gov/samr/xgzlyhd.js | 8 +- lib/v2/gov/shanghai/wgj/wgj.js | 2 +- lib/v2/gov/shanghai/yjj/index.js | 4 +- lib/v2/gov/shenzhen/hrss/szksy/index.js | 2 +- lib/v2/gov/shenzhen/xxgk/zfxxgj.js | 2 +- lib/v2/gov/shenzhen/zjj/index.js | 2 +- lib/v2/gov/shenzhen/zzb/index.js | 2 +- lib/v2/gov/sichuan/deyang/govpublicinfo.js | 2 +- lib/v2/gov/stats/index.js | 4 +- lib/v2/gov/suzhou/fg.js | 2 +- lib/v2/gov/taiyuan/rsj.js | 2 +- lib/v2/gov/xuzhou/hrss.js | 2 +- lib/v2/gov/zhejiang/gwy.js | 2 +- lib/v2/gov/zhengce/govall.js | 4 +- lib/v2/gov/zhengce/index.js | 6 +- lib/v2/gov/zhengce/wenjian.js | 2 +- lib/v2/greasyfork/scripts.js | 2 +- lib/v2/grist/featured.js | 2 +- lib/v2/grubstreet/utils.js | 2 +- lib/v2/guancha/index.js | 24 +- lib/v2/guancha/member.js | 8 +- lib/v2/guancha/personalpage.js | 8 +- lib/v2/guangdiu/index.js | 9 +- lib/v2/guangdiu/radar.js | 6 +- lib/v2/guangzhoumetro/news.js | 2 +- lib/v2/guanhai/index.js | 24 +- lib/v2/gumroad/index.js | 2 +- lib/v2/guokr/channel.js | 2 +- lib/v2/gxmzu/utils/index.js | 8 +- lib/v2/hackernews/index.js | 2 +- lib/v2/hacking8/search.js | 2 +- lib/v2/hackyournews/index.js | 4 +- lib/v2/hakkatv/type.js | 55 +- lib/v2/hameln/chapter.js | 2 +- lib/v2/hdu/cs/notice.js | 2 +- lib/v2/hdu/cs/pg.js | 2 +- lib/v2/hebtv/nong-bo-shi-zai-xing-dong.js | 2 +- lib/v2/hellobtc/kepu.js | 2 +- lib/v2/hellobtc/news.js | 2 +- lib/v2/hellogithub/index.js | 2 +- lib/v2/hinatazaka46/news.js | 2 +- lib/v2/hit/jwc.js | 8 +- lib/v2/hit/today.js | 8 +- lib/v2/hitwh/today.js | 10 +- lib/v2/hizu/index.js | 2 +- lib/v2/hk01/utils.js | 2 +- lib/v2/hket/index.js | 42 +- lib/v2/hnrb/index.js | 4 +- lib/v2/hongkong/chp.js | 6 +- lib/v2/hostmonit/cloudflareyes.js | 6 +- lib/v2/houxu/events.js | 2 +- lib/v2/houxu/index.js | 2 +- lib/v2/hoyolab/news.js | 6 +- lib/v2/hoyolab/utils.js | 2 +- lib/v2/hpoi/{bannerItem.js => banner-item.js} | 0 lib/v2/hpoi/router.js | 2 +- lib/v2/hpoi/utils.js | 2 +- lib/v2/hrbeu/gx/card.js | 9 +- lib/v2/hrbeu/gx/list.js | 9 +- lib/v2/hrbeu/uae/news.js | 4 +- lib/v2/hrbeu/yjsy/list.js | 2 +- lib/v2/hrbust/utils.js | 13 +- lib/v2/huanqiu/index.js | 22 +- lib/v2/huggingface/daily-papers.js | 2 +- .../{categoryTitle.js => category-title.js} | 0 lib/v2/hunau/utils/common.js | 6 +- .../utils/{indexPage.js => index-page.js} | 2 +- .../utils/{newsContent.js => news-content.js} | 6 +- lib/v2/hupu/all.js | 2 +- lib/v2/hupu/bbs.js | 2 +- lib/v2/hupu/index.js | 2 +- .../huxiu/{briefColumn.js => brief-column.js} | 2 +- lib/v2/huxiu/channel.js | 2 +- lib/v2/huxiu/club.js | 2 +- lib/v2/huxiu/collection.js | 2 +- lib/v2/huxiu/member.js | 2 +- lib/v2/huxiu/moment.js | 2 +- lib/v2/huxiu/router.js | 2 +- lib/v2/huxiu/search.js | 2 +- lib/v2/huxiu/tag.js | 2 +- lib/v2/huxiu/util.js | 44 +- lib/v2/ianspriggs/index.js | 2 +- lib/v2/icbc/whpj.js | 2 +- lib/v2/ieee/earlyaccess.js | 4 +- lib/v2/ieee/journal.js | 4 +- lib/v2/ieee/recent.js | 4 +- lib/v2/ielts/index.js | 2 +- lib/v2/ifeng/feng.js | 16 +- lib/v2/ifeng/news.js | 6 +- lib/v2/ifeng/utils.js | 6 +- lib/v2/iguoguo/index.js | 8 +- .../cn/{family_offers.js => family-offers.js} | 8 +- lib/v2/ikea/cn/{low_price.js => low-price.js} | 2 +- lib/v2/ikea/cn/new.js | 4 +- lib/v2/ikea/cn/utils.js | 2 +- lib/v2/ikea/gb/offer.js | 12 +- lib/v2/ikea/router.js | 4 +- lib/v2/imagemagick/changelog.js | 2 +- lib/v2/imiker/jinghua.js | 2 +- lib/v2/infoq/topic.js | 2 +- lib/v2/infoq/utils.js | 2 +- lib/v2/instagram/common-utils.js | 6 +- lib/v2/instagram/private-api/index.js | 18 +- lib/v2/instagram/private-api/utils.js | 4 +- lib/v2/instagram/web-api/index.js | 23 +- lib/v2/instagram/web-api/utils.js | 20 +- lib/v2/instructables/projects.js | 2 +- lib/v2/iqilu/program.js | 2 +- lib/v2/iqiyi/album.js | 2 +- lib/v2/iqnew/latest.js | 2 +- lib/v2/iresearch/report.js | 2 +- lib/v2/iresearch/weekly.js | 4 +- lib/v2/itch/devlog.js | 2 +- lib/v2/itch/router.js | 2 +- lib/v2/ithome/index.js | 2 +- lib/v2/ithome/ranking.js | 2 +- lib/v2/ithome/tag.js | 2 +- lib/v2/iwara/index.js | 2 +- lib/v2/iwara/subscriptions.js | 11 +- lib/v2/ixigua/router.js | 2 +- lib/v2/ixigua/{userVideo.js => user-video.js} | 5 +- lib/v2/jandan/section.js | 2 +- lib/v2/japanpost/radar.js | 2 +- lib/v2/japanpost/track.js | 6 +- lib/v2/japanpost/utils.js | 6 +- lib/v2/javbus/index.js | 26 +- lib/v2/javdb/utils.js | 6 +- lib/v2/javlibrary/utils.js | 12 +- lib/v2/jiaoliudao/index.js | 2 +- lib/v2/jiemian/lists.js | 6 +- lib/v2/jike/router.js | 2 +- lib/v2/jike/{topicText.js => topic-text.js} | 2 +- lib/v2/jike/topic.js | 6 +- lib/v2/jike/user.js | 40 +- lib/v2/jike/utils.js | 8 +- lib/v2/jisilu/index.js | 4 +- lib/v2/jornada/index.js | 10 +- lib/v2/jou/utils/index.js | 4 +- lib/v2/juejin/favorites.js | 6 +- lib/v2/juejin/pins.js | 2 +- lib/v2/juejin/radar.js | 2 +- lib/v2/juejin/utils.js | 2 +- lib/v2/jump/discount.js | 2 +- lib/v2/kamen-rider-official/news.js | 14 +- lib/v2/kantarworldpanel/index.js | 2 +- lib/v2/kcna/news.js | 2 +- lib/v2/kcna/utils.js | 4 +- lib/v2/ke/results.js | 4 +- lib/v2/keep/user.js | 10 +- lib/v2/kemono/index.js | 4 +- lib/v2/kepu/live.js | 2 +- lib/v2/keylol/index.js | 10 +- lib/v2/kuaidi100/index.js | 19 +- lib/v2/kuaidi100/router.js | 2 +- ...ported_company.js => supported-company.js} | 0 lib/v2/kuaidi100/utils.js | 49 +- lib/v2/kunchengblog/essay.js | 10 +- lib/v2/kyodonews/index.js | 6 +- lib/v2/lanqiao/questions.js | 32 +- lib/v2/laohu8/personal.js | 2 +- lib/v2/latepost/index.js | 27 +- lib/v2/layoffs/index.js | 10 +- lib/v2/leetcode/dailyquestion-solution-cn.js | 2 +- lib/v2/leetcode/dailyquestion-solution-en.js | 8 +- lib/v2/leiphone/utils.js | 4 +- lib/v2/lfsyd/{old_home.js => old-home.js} | 0 lib/v2/lfsyd/router.js | 2 +- lib/v2/lfsyd/utils.js | 4 +- .../{lightNovel.js => light-novel.js} | 2 +- lib/v2/lightnovel/router.js | 2 +- lib/v2/line/publisher.js | 2 +- lib/v2/linkedin/cn/renderer.js | 78 +-- lib/v2/linkedin/cn/utils.js | 4 +- lib/v2/linkresearcher/index.js | 10 +- .../{cs_matches.js => cs-matches.js} | 8 +- .../{dota2_matches.js => dota2-matches.js} | 0 lib/v2/liquipedia/router.js | 4 +- lib/v2/literotica/new.js | 2 +- lib/v2/liulinblog/index.js | 6 +- lib/v2/liveuamap/index.js | 4 +- lib/v2/lkong/query.js | 6 +- lib/v2/lkong/thread.js | 2 +- lib/v2/lofter/user.js | 4 +- lib/v2/logclub/index.js | 37 +- lib/v2/logclub/radar.js | 4 +- lib/v2/logclub/report.js | 6 +- lib/v2/logonews/index.js | 4 +- lib/v2/logonews/router.js | 2 +- lib/v2/lovelive-anime/topics.js | 7 +- lib/v2/luogu/contest.js | 2 +- lib/v2/luogu/router.js | 4 +- lib/v2/luogu/{userBlog.js => user-blog.js} | 0 lib/v2/luogu/{userFeed.js => user-feed.js} | 0 lib/v2/lvv2/news.js | 29 +- lib/v2/lvv2/radar.js | 32 +- lib/v2/lvv2/top.js | 27 +- lib/v2/lxixsxa/discography.js | 8 +- lib/v2/lxixsxa/information.js | 4 +- .../jsonp-helper.js} | 6 +- lib/v2/macfilos/blog.js | 2 +- lib/v2/macmenubar/recently.js | 2 +- lib/v2/magazinelib/latest-magazine.js | 8 +- lib/v2/mail/imap.js | 16 +- lib/v2/manhuagui/comic.js | 10 +- .../mastodon/{account_id.js => account-id.js} | 0 lib/v2/mastodon/router.js | 6 +- .../{timeline_local.js => timeline-local.js} | 0 ...{timeline_remote.js => timeline-remote.js} | 0 lib/v2/mastodon/utils.js | 60 +- .../cn/{categoryMap.js => category-map.js} | 0 lib/v2/mckinsey/cn/index.js | 4 +- lib/v2/mckinsey/radar.js | 2 +- lib/v2/mdpi/journal.js | 2 +- lib/v2/medieval-china/post.js | 2 +- lib/v2/medium/following.js | 4 +- lib/v2/medium/for-you.js | 4 +- lib/v2/medium/list.js | 4 +- lib/v2/medium/parse-article.js | 8 +- lib/v2/medium/tag.js | 4 +- lib/v2/medsci/index.js | 2 +- lib/v2/metacritic/index.js | 24 +- lib/v2/meteor/index.js | 8 +- lib/v2/meteor/utils.js | 10 +- lib/v2/metmuseum/exhibitions.js | 2 +- lib/v2/mihoyo/sr/news.js | 12 +- lib/v2/mihoyo/ys/news.js | 4 +- lib/v2/mingpao/index.js | 6 +- lib/v2/mirror/index.js | 2 +- lib/v2/missav/new.js | 4 +- lib/v2/mittrchina/index.js | 27 +- lib/v2/mixcloud/index.js | 6 +- lib/v2/modelscope/community.js | 2 +- lib/v2/modelscope/datasets.js | 4 +- lib/v2/modelscope/models.js | 4 +- lib/v2/modelscope/studios.js | 2 +- lib/v2/mpaypass/main.js | 14 +- lib/v2/mydrivers/cid.js | 9 +- lib/v2/mydrivers/index.js | 6 +- lib/v2/mydrivers/rank.js | 4 +- lib/v2/mydrivers/util.js | 12 +- lib/v2/myfigurecollection/activity.js | 2 +- lib/v2/myfigurecollection/index.js | 10 +- lib/v2/mygopen/index.js | 2 +- lib/v2/mymusicsheet/usersheets.js | 2 +- lib/v2/nasa/apod-cn.js | 2 +- lib/v2/nasa/apod-ncku.js | 2 +- lib/v2/nasa/apod.js | 2 +- lib/v2/natgeo/dailyphoto.js | 2 +- lib/v2/natgeo/dailyselection.js | 2 +- lib/v2/natgeo/natgeo.js | 2 +- lib/v2/nationalgeographic/latest-stories.js | 8 +- lib/v2/nature/cover.js | 4 +- lib/v2/nature/siteindex.js | 2 +- lib/v2/nature/utils.js | 8 +- lib/v2/nautil/topics.js | 2 +- lib/v2/ncc-cma/cmdp.js | 2 +- lib/v2/ncepu/master/masterinfo.js | 7 +- lib/v2/ndss-symposium/ndss.js | 8 +- lib/v2/neatdownloadmanager/download.js | 10 +- lib/v2/neea/index.js | 2 +- lib/v2/nenu/sohac.js | 2 +- lib/v2/nenu/yjsy.js | 4 +- lib/v2/netflav/index.js | 4 +- lib/v2/neu/bmie.js | 2 +- lib/v2/newrank/douyin.js | 2 +- lib/v2/newrank/utils.js | 10 +- lib/v2/newrank/wechat.js | 6 +- lib/v2/news/whxw.js | 6 +- lib/v2/newsmarket/index.js | 2 +- lib/v2/newzmz/index.js | 6 +- lib/v2/newzmz/util.js | 17 +- lib/v2/nga/forum.js | 6 +- lib/v2/nga/post.js | 45 +- lib/v2/nhentai/other.js | 8 +- lib/v2/nhentai/search.js | 2 +- lib/v2/nhentai/util.js | 10 +- .../{news_web_easy.js => news-web-easy.js} | 0 lib/v2/nhk/router.js | 2 +- lib/v2/niaogebiji/index.js | 2 +- lib/v2/niaogebiji/today.js | 2 +- lib/v2/nikkei/asia/index.js | 4 +- lib/v2/nikkei/cn/index.js | 12 +- lib/v2/nikkei/news.js | 15 +- lib/v2/nintendo/{eshop_cn.js => eshop-cn.js} | 0 lib/v2/nintendo/{eshop_hk.js => eshop-hk.js} | 2 +- lib/v2/nintendo/{eshop_jp.js => eshop-jp.js} | 0 lib/v2/nintendo/{eshop_us.js => eshop-us.js} | 0 .../nintendo/{news_china.js => news-china.js} | 0 lib/v2/nintendo/router.js | 10 +- lib/v2/nintendo/system-update.js | 2 +- lib/v2/nintendo/utils.js | 4 +- lib/v2/njglyy/utils/index.js | 4 +- lib/v2/njit/jwc.js | 34 +- lib/v2/njit/tzgg.js | 22 +- lib/v2/nju/admission.js | 16 +- lib/v2/nju/dafls.js | 20 +- lib/v2/nju/hosptial.js | 16 +- lib/v2/nju/hqjt.js | 20 +- lib/v2/nju/itsc.js | 28 +- lib/v2/nju/jjc.js | 22 +- lib/v2/nju/zbb.js | 26 +- lib/v2/nju/zcc.js | 16 +- lib/v2/njucm/utils/index.js | 4 +- lib/v2/njupt/jwc.js | 6 +- lib/v2/njupt/radar.js | 4 +- lib/v2/njust/radar.js | 6 +- lib/v2/njxzc/utils/index.js | 4 +- lib/v2/nmtv/column.js | 2 +- lib/v2/nogizaka46/news.js | 2 +- lib/v2/notefolio/search.js | 17 +- lib/v2/now/news.js | 9 +- lib/v2/nowcoder/discuss.js | 2 +- lib/v2/nowcoder/jobcenter.js | 4 +- lib/v2/nowcoder/recommend.js | 4 +- lib/v2/nowcoder/schedule.js | 12 +- lib/v2/npm/router.js | 2 +- lib/v2/npr/full.js | 12 +- lib/v2/nua/dc.js | 2 +- lib/v2/nua/lib.js | 2 +- lib/v2/nuaa/college/cae.js | 2 +- lib/v2/nuaa/college/cs.js | 4 +- lib/v2/nuaa/jwc/jwc.js | 2 +- lib/v2/nuaa/yjsy/yjsy.js | 2 +- lib/v2/nuist/bulletin.js | 2 +- lib/v2/nuist/cas.js | 4 +- lib/v2/nuist/xgc.js | 4 +- lib/v2/nyaa/main.js | 7 +- ...g_chinese.js => daily-briefing-chinese.js} | 6 +- lib/v2/nytimes/index.js | 39 +- lib/v2/nytimes/router.js | 2 +- ...arithmeticIndex.js => arithmetic-index.js} | 12 +- lib/v2/oceanengine/router.js | 2 +- lib/v2/odaily/activity.js | 2 +- lib/v2/odaily/router.js | 2 +- .../odaily/{search_news.js => search-news.js} | 0 lib/v2/odaily/user.js | 2 +- lib/v2/oeeee/app/channel.js | 2 +- lib/v2/oeeee/utils.js | 2 +- lib/v2/oncc/money18.js | 6 +- lib/v2/openai/chatgpt.js | 10 +- lib/v2/orcid/index.js | 14 +- ..._sec_page_data.js => get-sec-page-data.js} | 0 lib/v2/oreno3d/main.js | 6 +- lib/v2/oschina/topic.js | 2 +- lib/v2/oschina/user.js | 2 +- lib/v2/oshwhub/explore.js | 37 +- lib/v2/otobanana/cast.js | 2 +- lib/v2/otobanana/livestream.js | 2 +- lib/v2/otobanana/timeline.js | 2 +- lib/v2/otobanana/utils.js | 8 +- lib/v2/ouc/it.js | 2 +- lib/v2/outagereport/index.js | 8 +- lib/v2/panewslab/news.js | 2 +- lib/v2/papers/index.js | 2 +- lib/v2/patagonia/radar.js | 6 +- lib/v2/paulgraham/article.js | 2 +- lib/v2/penguin-random-house/utils.js | 4 +- lib/v2/people/index.js | 8 +- lib/v2/people/xjpjh.js | 10 +- lib/v2/phoronix/index.js | 48 +- lib/v2/pianyuan/utils.js | 6 +- lib/v2/picnob/user.js | 24 +- lib/v2/picnob/utils.js | 6 +- lib/v2/picuki/profile.js | 15 +- lib/v2/pikabu/utils.js | 2 +- lib/v2/pixabay/search.js | 2 +- .../api/{getBookmarks.js => get-bookmarks.js} | 0 ...IllustFollows.js => get-illust-follows.js} | 0 .../api/{getIllusts.js => get-illusts.js} | 0 .../api/{getRanking.js => get-ranking.js} | 4 +- .../{getUserDetail.js => get-user-detail.js} | 0 .../api/{searchIllust.js => search-illust.js} | 0 ...ularIllust.js => search-popular-illust.js} | 0 lib/v2/pixiv/bookmarks.js | 4 +- lib/v2/pixiv/illustfollow.js | 2 +- lib/v2/pixiv/novels.js | 6 +- lib/v2/pixiv/pixiv-got.js | 10 +- lib/v2/pixiv/ranking.js | 4 +- lib/v2/pixiv/search.js | 11 +- lib/v2/pixiv/token.js | 4 +- lib/v2/pixiv/user.js | 2 +- lib/v2/pku/bbs/hot.js | 2 +- lib/v2/pku/eecs.js | 2 +- lib/v2/pku/router.js | 2 +- lib/v2/pku/ss/{pg_admin.js => pg-admin.js} | 0 lib/v2/plurk/top.js | 6 +- lib/v2/plurk/user.js | 4 +- lib/v2/plurk/utils.js | 2 +- lib/v2/pnas/index.js | 2 +- .../{category_url.js => category-url.js} | 2 +- lib/v2/pornhub/category.js | 4 +- lib/v2/pornhub/model.js | 2 +- lib/v2/pornhub/pornstar.js | 2 +- lib/v2/pornhub/router.js | 2 +- lib/v2/pornhub/users.js | 2 +- lib/v2/pornhub/utils.js | 4 +- lib/v2/producthunt/today.js | 2 +- lib/v2/ps/trophy.js | 8 +- lib/v2/pts/index.js | 2 +- lib/v2/pts/live.js | 2 +- lib/v2/pubmed/trending.js | 2 +- lib/v2/pumc/mdadmission.js | 2 +- lib/v2/putty/changes.js | 2 +- lib/v2/qdu/jwc.js | 22 +- lib/v2/qianp/radar.js | 2 +- lib/v2/qidian/forum.js | 3 +- lib/v2/qingting/podcast.js | 2 +- lib/v2/qlu/notice.js | 13 +- lib/v2/qoo-app/news.js | 10 +- lib/v2/qoo-app/notes/note.js | 2 +- lib/v2/qoo-app/router.js | 2 +- .../user/{appComment.js => app-comment.js} | 0 lib/v2/qq/ac/utils.js | 2 +- lib/v2/qq/kg/cache.js | 2 +- lib/v2/qqorw/index.js | 6 +- lib/v2/questmobile/report.js | 8 +- lib/v2/quicker/qa.js | 4 +- lib/v2/quicker/share.js | 4 +- lib/v2/quicker/user.js | 4 +- lib/v2/qweather/3days.js | 2 +- lib/v2/radio-canada/latest.js | 2 +- lib/v2/radio/album.js | 6 +- lib/v2/radio/zhibo.js | 2 +- lib/v2/rawkuma/manga.js | 4 +- lib/v2/readhub/daily.js | 4 +- lib/v2/readhub/index.js | 4 +- lib/v2/readhub/util.js | 15 +- lib/v2/reuters/common.js | 66 ++- lib/v2/rfa/index.js | 4 +- lib/v2/rfi/news.js | 2 +- lib/v2/right/forum.js | 2 +- lib/v2/routledge/book-series.js | 6 +- lib/v2/rsc/journal.js | 2 +- lib/v2/rsshub/transform/html.js | 33 +- lib/v2/rsshub/transform/json.js | 4 +- lib/v2/rsshub/transform/sitemap.js | 46 +- lib/v2/ruancan/utils.js | 2 +- lib/v2/ruc/hr.js | 2 +- lib/v2/runtrail/posts.js | 4 +- lib/v2/sakurazaka46/news.js | 2 +- lib/v2/saraba1st/digest.js | 4 +- lib/v2/saraba1st/thread.js | 10 +- lib/v2/sass/gs/index.js | 13 +- lib/v2/sciencenet/blog.js | 2 +- lib/v2/sciencenet/user.js | 2 +- ... physics-school-announcements-and-news.js} | 0 lib/v2/scnu/router.js | 6 +- lib/v2/sctv/programme.js | 6 +- lib/v2/scut/jwc/news.js | 14 +- lib/v2/scut/jwc/notice.js | 6 +- lib/v2/scut/jwc/school.js | 6 +- lib/v2/scut/router.js | 2 +- .../seie/{news_center.js => news-ccenter.js} | 2 +- lib/v2/sdu/cmse.js | 2 +- lib/v2/sdu/cs.js | 2 +- lib/v2/sdu/epe.js | 2 +- lib/v2/sdu/extractor/sdrj.js | 2 +- lib/v2/sdu/extractor/view.js | 2 +- lib/v2/sdu/extractor/wh/jwc.js | 2 +- lib/v2/sdu/extractor/wh/news.js | 2 +- lib/v2/sdu/mech.js | 2 +- lib/v2/sdu/sc.js | 4 +- lib/v2/sdu/wh/jwc.js | 2 +- lib/v2/sec-wiki/weekly.js | 2 +- lib/v2/segmentfault/channel.js | 2 +- lib/v2/sehuatang/index.js | 4 +- lib/v2/sehuatang/user.js | 4 +- lib/v2/sensortower/blog.js | 4 +- lib/v2/setn/index.js | 10 +- lib/v2/seu/cse/index.js | 2 +- lib/v2/seu/yzb/index.js | 2 +- lib/v2/shiep/index.js | 19 +- lib/v2/showstart/event.js | 6 +- lib/v2/showstart/service.js | 11 +- lib/v2/shuiguopai/index.js | 2 +- lib/v2/sigsac/ccs.js | 4 +- lib/v2/sina/finance/stock/usstock.js | 2 +- lib/v2/sina/utils.js | 14 +- lib/v2/sinchew/index.js | 4 +- lib/v2/sjtu/tongqu/activity.js | 4 +- lib/v2/slowmist/slowmist.js | 28 +- lib/v2/smashingmagazine/category.js | 7 +- .../{haowen_fenlei.js => haowen-fenlei.js} | 9 +- lib/v2/smzdm/router.js | 2 +- lib/v2/sohu/mp.js | 10 +- lib/v2/solidot/_article.js | 16 +- lib/v2/solidot/main.js | 6 +- lib/v2/spotify/saved.js | 2 +- lib/v2/spotify/top.js | 2 +- lib/v2/sse/convert.js | 2 +- lib/v2/sse/disclosure.js | 2 +- lib/v2/sse/inquire.js | 2 +- lib/v2/sse/lawandrules.js | 2 +- lib/v2/sse/radar.js | 2 +- lib/v2/sse/renewal.js | 2 +- lib/v2/sspai/author.js | 2 +- lib/v2/sspai/router.js | 4 +- .../{seriesUpdate.js => series-update.js} | 0 ...ortcutsGallery.js => shortcuts-gallery.js} | 2 +- lib/v2/sspu/jwc.js | 2 +- lib/v2/sspu/pe.js | 2 +- lib/v2/stcn/index.js | 4 +- lib/v2/studygolang/utils.js | 4 +- lib/v2/subhd/index.js | 2 +- lib/v2/supchina/index.js | 6 +- lib/v2/supchina/podcasts.js | 2 +- lib/v2/surfshark/blog.js | 2 +- lib/v2/swissinfo/index.js | 2 +- lib/v2/swpu/utils.js | 2 +- lib/v2/syosetu/chapter.js | 2 +- lib/v2/sysu/cse.js | 16 +- lib/v2/szse/inquire.js | 2 +- lib/v2/szse/notice.js | 28 +- lib/v2/szse/projectdynamic.js | 2 +- lib/v2/szu/yz/index.js | 2 +- lib/v2/tangshufang/index.js | 2 +- lib/v2/taoguba/blog.js | 2 +- lib/v2/taoguba/index.js | 2 +- lib/v2/telecompaper/news.js | 2 +- lib/v2/telecompaper/search.js | 4 +- lib/v2/telegram/channel.js | 53 +- lib/v2/tencent/news/author.js | 6 +- lib/v2/tencent/pvp/newsindex.js | 6 +- lib/v2/tencent/qq/sdk/changelog.js | 2 +- lib/v2/tencent/radar.js | 2 +- lib/v2/tesla/cx.js | 6 +- lib/v2/tesla/price/get-price.js | 2 +- lib/v2/test/index.js | 508 +++++++++-------- lib/v2/tfc-taiwan/utils.js | 4 +- lib/v2/theatlantic/utils.js | 4 +- lib/v2/thecatcity/index.js | 6 +- lib/v2/thecatcity/radar.js | 2 +- .../thecatcity/{termsMap.js => terms-map.js} | 0 lib/v2/theinitium/full.js | 4 +- lib/v2/thenewslens/index.js | 2 +- lib/v2/thepaper/factpaper.js | 2 +- lib/v2/thepaper/featured.js | 2 +- lib/v2/thepaper/utils.js | 2 +- lib/v2/theverge/index.js | 8 +- lib/v2/thoughtco/index.js | 10 +- lib/v2/threads/index.js | 2 +- lib/v2/threads/utils.js | 46 +- lib/v2/thwiki/index.js | 4 +- lib/v2/tingshuitz/wuhan.js | 2 +- lib/v2/tingtingfm/program.js | 10 +- lib/v2/tju/cic/index.js | 10 +- lib/v2/tju/news/index.js | 16 +- lib/v2/tju/oaa/index.js | 4 +- lib/v2/tju/yzb/index.js | 10 +- lib/v2/tokeninsight/blog.js | 4 +- lib/v2/tokeninsight/bulletin.js | 2 +- lib/v2/tokeninsight/report.js | 4 +- lib/v2/toodaylab/index.js | 10 +- lib/v2/topys/index.js | 2 +- lib/v2/tradingview/blog.js | 2 +- lib/v2/tradingview/desktop.js | 2 +- .../{allTrending.js => all-trending.js} | 0 lib/v2/trending/router.js | 2 +- lib/v2/tvb/news.js | 2 +- lib/v2/twitch/live.js | 2 +- lib/v2/twitch/schedule.js | 4 +- lib/v2/twitch/video.js | 6 +- ...lback_common.js => api-fallback-common.js} | 4 +- lib/v2/twitter/collection.js | 6 +- lib/v2/twitter/followings.js | 2 +- lib/v2/twitter/list.js | 4 +- lib/v2/twitter/utils.js | 82 +-- lib/v2/twitter/web-api/twitter-api.js | 32 +- lib/v2/twitter/web-api/user.js | 7 +- .../{fetch_article.js => fetch-article.js} | 0 lib/v2/twreporter/newest.js | 2 +- lib/v2/txrjy/fornumtopic.js | 4 +- lib/v2/txrjy/radar.js | 2 +- lib/v2/u3c3/index.js | 4 +- lib/v2/u9a9/index.js | 2 +- lib/v2/uber/blog.js | 2 +- lib/v2/udn/breaking-news.js | 4 +- lib/v2/udn/global/index.js | 20 +- lib/v2/uibe/hr.js | 2 +- lib/v2/uptimerobot/rss.js | 2 +- lib/v2/uraaka-joshi/uraaka-joshi-user.js | 4 +- lib/v2/uraaka-joshi/uraaka-joshi.js | 4 +- lib/v2/usenix/usenix.js | 39 +- lib/v2/ustb/tj/news.js | 2 +- lib/v2/ustb/yjsy/news.js | 33 +- lib/v2/ustb/yzxc/tzgg.js | 2 +- lib/v2/ustc/eeis.js | 2 +- lib/v2/ustc/gs.js | 2 +- lib/v2/ustc/job.js | 2 +- lib/v2/ustc/sist.js | 2 +- lib/v2/usts/jwch.js | 19 +- lib/v2/utgd/category.js | 2 +- lib/v2/utgd/timeline.js | 2 +- lib/v2/utgd/topic.js | 4 +- lib/v2/v2ex/tab.js | 2 +- lib/v2/vcb-s/category.js | 2 +- lib/v2/vcb-s/index.js | 2 +- lib/v2/verfghbw/press.js | 26 +- lib/v2/vimeo/category.js | 2 +- lib/v2/vimeo/channel.js | 4 +- lib/v2/vimeo/radar.js | 2 +- lib/v2/vimeo/usr-videos.js | 8 +- lib/v2/wallhaven/index.js | 4 +- lib/v2/web3caff/index.js | 2 +- lib/v2/wechat/ce.js | 2 +- lib/v2/wechat/data258.js | 28 +- lib/v2/wechat/feeddd.js | 2 +- lib/v2/wechat/sogou.js | 4 +- lib/v2/wechat/tgchannel.js | 8 +- lib/v2/wechat/uread.js | 4 +- lib/v2/wechat/wxnmh.js | 8 +- lib/v2/weibo/group.js | 12 +- lib/v2/weibo/router.js | 2 +- lib/v2/weibo/search/hot.js | 10 +- .../weibo/{super_index.js => super-index.js} | 0 lib/v2/weibo/timeline.js | 14 +- lib/v2/weibo/user.js | 14 +- lib/v2/weibo/utils.js | 72 ++- lib/v2/wenku8/chapter.js | 2 +- lib/v2/wenku8/volume.js | 4 +- lib/v2/wfu/news.js | 6 +- lib/v2/who/news-room.js | 2 +- lib/v2/whu/cs.js | 33 +- lib/v2/whu/gs/index.js | 4 +- lib/v2/whu/hyxt.js | 2 +- lib/v2/whu/news.js | 2 +- lib/v2/whu/util.js | 11 +- lib/v2/winstall/update.js | 4 +- lib/v2/wise/pair.js | 4 +- lib/v2/wnacg/index.js | 12 +- lib/v2/woshipm/router.js | 2 +- .../{user_article.js => user-article.js} | 2 +- lib/v2/wsj/news.js | 2 +- lib/v2/wsj/utils.js | 4 +- lib/v2/wsyu/news.js | 8 +- lib/v2/wtu/index.js | 2 +- lib/v2/wyzxwk/article.js | 2 +- lib/v2/wzu/news.js | 2 +- lib/v2/x-mol/news.js | 8 +- lib/v2/x-mol/paper.js | 2 +- lib/v2/x6d/index.js | 21 +- lib/v2/xaufe/jiaowu.js | 5 +- lib/v2/xaut/rsc.js | 2 +- lib/v2/xiaohongshu/user.js | 4 +- lib/v2/xiaohongshu/util.js | 32 +- lib/v2/xiaomiyoupin/utils.js | 2 +- lib/v2/xiaote/index.js | 4 +- lib/v2/ximalaya/album.js | 12 +- lib/v2/ximalaya/radar.js | 2 +- lib/v2/ximalaya/utils.js | 2 +- lib/v2/xinpianchang/index.js | 4 +- lib/v2/xinpianchang/rank.js | 2 +- lib/v2/xinpianchang/util.js | 2 +- lib/v2/xjtu/dean.js | 4 +- lib/v2/xmanhua/index.js | 18 +- lib/v2/xmnn/docs.js | 0 lib/v2/xmnn/epaper.js | 4 +- lib/v2/xmnn/news.js | 2 +- lib/v2/xsijishe/forum.js | 7 +- lib/v2/xsijishe/rank.js | 2 +- lib/v2/xueqiu/hots.js | 2 +- lib/v2/xueqiu/router.js | 6 +- lib/v2/xueqiu/snb.js | 2 +- .../{stock_comments.js => stock-comments.js} | 4 +- .../xueqiu/{stock_info.js => stock-info.js} | 8 +- lib/v2/xueqiu/today.js | 2 +- .../xueqiu/{user_stock.js => user-stock.js} | 0 lib/v2/xueqiu/user.js | 2 +- lib/v2/xys/new.js | 6 +- lib/v2/xyzrank/index.js | 2 +- lib/v2/yahoo/news/tw/index.js | 4 +- lib/v2/yahoo/news/tw/provider-helper.js | 2 +- lib/v2/yahoo/news/tw/provider.js | 4 +- lib/v2/yahoo/news/tw/utils.js | 6 +- lib/v2/yahoo/news/us/index.js | 2 +- lib/v2/yangtzeu/dongke.js | 2 +- lib/v2/ycwb/index.js | 4 +- lib/v2/yicai/dt.js | 4 +- lib/v2/yicai/utils.js | 2 +- lib/v2/yoasobi-music/info.js | 6 +- .../jsonp-helper.js} | 6 +- lib/v2/yoasobi-music/live.js | 4 +- lib/v2/yoasobi-music/media.js | 4 +- lib/v2/yomujp/level.js | 4 +- lib/v2/youku/channel.js | 4 +- lib/v2/youtube/channel.js | 4 +- lib/v2/youtube/charts.js | 48 +- lib/v2/youtube/community.js | 2 +- lib/v2/youtube/live.js | 2 +- lib/v2/youtube/radar.js | 2 +- lib/v2/youtube/subscriptions.js | 2 +- lib/v2/youtube/user.js | 2 +- lib/v2/youtube/utils.js | 12 +- lib/v2/youzhiyouxing/materials.js | 4 +- lib/v2/yuque/utils.js | 8 +- lib/v2/yxdzqb/index.js | 2 +- lib/v2/yxrb/home.js | 2 +- lib/v2/yystv/category.js | 2 +- lib/v2/zaobao/realtime.js | 41 +- lib/v2/zaobao/util.js | 33 +- lib/v2/zaobao/znews.js | 45 +- lib/v2/zcmu/jwc/index.js | 2 +- lib/v2/zcmu/yxy/index.js | 2 +- lib/v2/zcool/discover.js | 4 +- lib/v2/zcool/user.js | 2 +- lib/v2/zhibo8/more.js | 7 +- lib/v2/zhibo8/post.js | 2 +- lib/v2/zhihu/activities.js | 41 +- lib/v2/zhihu/answers.js | 2 +- lib/v2/zhihu/bookstore/newest.js | 2 +- lib/v2/zhihu/collection.js | 2 +- .../{daily_section.js => daily-section.js} | 2 +- lib/v2/zhihu/daily.js | 4 +- .../{x-zse-96_v3.js => x-zse-96-v3.js} | 23 +- lib/v2/zhihu/pin/utils.js | 6 +- lib/v2/zhihu/question.js | 4 +- lib/v2/zhihu/radar.js | 6 +- lib/v2/zhihu/router.js | 2 +- lib/v2/zhihu/timeline.js | 4 +- lib/v2/zhihu/xhu/activities.js | 37 +- lib/v2/zhihu/xhu/auth.js | 2 +- lib/v2/zhihu/xhu/collection.js | 32 +- lib/v2/zhihu/xhu/zhuanlan.js | 52 +- lib/v2/zhihu/zhuanlan.js | 54 +- lib/v2/zhitongcaijing/index.js | 6 +- lib/v2/zhiy/letter.js | 10 +- lib/v2/zhiy/post.js | 10 +- lib/v2/zhubai/index.js | 4 +- lib/v2/zhubai/top20.js | 2 +- lib/v2/zimuxia/index.js | 2 +- lib/v2/zimuxia/portfolio.js | 4 +- lib/v2/zjgtjy/index.js | 5 +- lib/v2/zjol/paper.js | 2 +- lib/v2/zju/career/index.js | 2 +- lib/v2/zju/cst/custom.js | 4 +- lib/v2/zju/cst/index.js | 30 +- lib/v2/zju/grs/index.js | 2 +- lib/v2/zju/list.js | 6 +- lib/v2/zju/physics/index.js | 2 +- lib/v2/zodgame/forum.js | 10 +- lib/v2/zotero/versions.js | 6 +- lib/v2/zuel/notice.js | 2 +- lib/v2/zuvio/utils.js | 31 +- lib/v2/zyshow/router.js | 2 +- lib/views/rss3-ums.js | 2 +- package.json | 3 + pnpm-lock.yaml | 533 +++++++++++++++++- scripts/docker/minify-docker.js | 6 +- scripts/twitter-token/generate.js | 4 +- scripts/workflow/build-maintainer.js | 6 +- .../workflow/test-issue/call-maintainer.js | 23 +- scripts/workflow/test-route/identify.js | 28 +- scripts/workflow/test-route/test.js | 16 +- test/middleware/cache.js | 8 +- test/middleware/debug.js | 2 +- test/middleware/parameter.js | 6 +- test/middleware/template.js | 2 +- test/pkg.js | 4 +- test/router.js | 10 +- test/utils/common-config.js | 1 + test/utils/{dateParser.js => date-parser.js} | 2 +- test/utils/date.js | 2 +- test/utils/got.js | 2 +- test/utils/puppeteer-utils.js | 16 +- test/utils/request-wrapper.js | 2 +- test/utils/wechat-mp.js | 6 +- .../docs/joinus/advanced/script-standard.md | 2 +- website/docs/routes/government.mdx | 2 +- .../joinus/advanced/script-standard.md | 2 +- 1652 files changed, 6334 insertions(+), 6435 deletions(-) rename lib/{api_router.js => api-router.js} (88%) rename lib/{core_router.js => core-router.js} (100%) rename lib/{protected_router.js => protected-router.js} (100%) rename lib/routes/anigamer/{new_anime.js => new-anime.js} (100%) rename lib/routes/bahamut/{creation_index.js => creation-index.js} (77%) rename lib/routes/blogs/{jingwei_link.js => jingwei-link.js} (100%) rename lib/routes/dgtle/{whale_rank.js => whale-rank.js} (100%) rename lib/routes/fanfou/{home_timeline.js => home-timeline.js} (100%) rename lib/routes/fanfou/{public_timeline.js => public-timeline.js} (100%) rename lib/routes/fanfou/{user_timeline.js => user-timeline.js} (100%) rename lib/routes/furaffinity/{journal_comments.js => journal-comments.js} (100%) rename lib/routes/furaffinity/{submission_comments.js => submission-comments.js} (100%) rename lib/routes/gov/city/nanjing/{getContent.js => get-content.js} (96%) rename lib/routes/gov/province/jiangsu/{getContent.js => get-content.js} (97%) rename lib/routes/interesting-sky/{astronomical_events.js => astronomical-events.js} (100%) rename lib/routes/konachan/{post_popular_recent.js => post-popular-recent.js} (100%) rename lib/routes/magireco/{event_banner.js => event-banner.js} (95%) rename lib/routes/maoyan/{hotComplete.js => hot-complete.js} (91%) rename lib/routes/miniflux/{get_entries.js => get-entries.js} (94%) rename lib/routes/miniflux/{get_feeds.js => get-feeds.js} (98%) rename lib/routes/sesame/{release_notes.js => release-notes.js} (100%) rename lib/routes/universities/fzu/{news_min.js => news-min.js} (100%) rename lib/routes/universities/hhu/{libNews.js => lib-news.js} (78%) rename lib/routes/universities/hhu/{libNewsc.js => lib-newsc.js} (72%) rename lib/routes/universities/swust/{jwc_news.js => jwc-news.js} (96%) rename lib/routes/universities/swust/{jwc_notice.js => jwc-notice.js} (96%) rename lib/routes/us/supremecourt/{argument_audio.js => argument-audio.js} (100%) rename lib/routes/xuetangx/{course_info.js => course-info.js} (100%) rename lib/routes/xuetangx/{course_list.js => course-list.js} (92%) rename lib/routes/yande.re/{post_popular_recent.js => post-popular-recent.js} (100%) rename lib/utils/{dateParser.js => date-parser.js} (77%) rename lib/v2/3dmgame/{news_center.js => news-center.js} (95%) rename lib/v2/500px/{tribeSet.js => tribe-set.js} (94%) rename lib/v2/6v123/{latestMovies.js => latest-movies.js} (100%) rename lib/v2/6v123/{latestTVSeries.js => latest-tvseries.js} (100%) rename lib/v2/agirls/{topic_list.js => topic-list.js} (100%) rename lib/v2/aliyun/{database_month.js => database-month.js} (100%) rename lib/v2/apple/{exchange_repair.js => exchange-repair.js} (100%) rename lib/v2/bilibili/{followings_article.js => followings-article.js} (89%) rename lib/v2/bilibili/{followings_dynamic.js => followings-dynamic.js} (65%) rename lib/v2/bilibili/{followings_video.js => followings-video.js} (81%) rename lib/v2/bilibili/{hotSearch.js => hot-search.js} (100%) rename lib/v2/bilibili/{linkNews.js => link-news.js} (90%) rename lib/v2/bilibili/{liveArea.js => live-area.js} (100%) rename lib/v2/bilibili/{liveRoom.js => live-room.js} (96%) rename lib/v2/bilibili/{liveSearch.js => live-search.js} (100%) rename lib/v2/bilibili/{mallIP.js => mall-ip.js} (100%) rename lib/v2/bilibili/{mallNew.js => mall-new.js} (97%) rename lib/v2/bilibili/{manga_followings.js => manga-followings.js} (88%) rename lib/v2/bilibili/{manga_update.js => manga-update.js} (100%) rename lib/v2/bilibili/{user_bangumi.js => user-bangumi.js} (83%) rename lib/v2/bilibili/{userChannel.js => user-channel.js} (95%) rename lib/v2/bilibili/{userCollection.js => user-collection.js} (94%) rename lib/v2/bilibili/{userFav.js => user-fav.js} (90%) rename lib/v2/bilibili/{weekly_recommend.js => weekly-recommend.js} (94%) rename lib/v2/cdzjryb/{projectList.js => project-list.js} (100%) rename lib/v2/codeforces/{recent_actions.js => recent-actions.js} (100%) rename lib/v2/coolapk/{userDynamic.js => user-dynamic.js} (83%) rename lib/v2/dongqiudi/{player_news.js => player-news.js} (100%) rename lib/v2/dongqiudi/{team_news.js => team-news.js} (100%) rename lib/v2/dongqiudi/{top_news.js => top-news.js} (91%) rename lib/v2/douban/other/{explore_column.js => explore-column.js} (97%) rename lib/v2/douban/other/{latest_book.js => latest-book.js} (100%) rename lib/v2/douban/other/{latest_music.js => latest-music.js} (100%) rename lib/v2/douban/other/{weekly_best.js => weekly-best.js} (100%) rename lib/v2/embassy/{supportedList.js => supported-list.js} (100%) rename lib/v2/ff14/{ff14_global.js => ff14-global.js} (88%) rename lib/v2/ff14/{ff14_zh.js => ff14-zh.js} (100%) rename lib/v2/finology/{mostViewed.js => most-viewed.js} (100%) rename lib/v2/gamer/{gnn_index.js => gnn-index.js} (90%) rename lib/v2/gdut/{oa_news.js => oa-news.js} (80%) rename lib/v2/github/{starred_repos.js => starred-repos.js} (100%) rename lib/v2/gov/jinan/healthcommission/{medical_exam_notice.js => medical-exam-notice.js} (100%) rename lib/v2/gov/pbc/{tradeAnnouncement.js => trade-announcement.js} (100%) rename lib/v2/hpoi/{bannerItem.js => banner-item.js} (100%) rename lib/v2/hunau/utils/{categoryTitle.js => category-title.js} (100%) rename lib/v2/hunau/utils/{indexPage.js => index-page.js} (69%) rename lib/v2/hunau/utils/{newsContent.js => news-content.js} (91%) rename lib/v2/huxiu/{briefColumn.js => brief-column.js} (90%) rename lib/v2/ikea/cn/{family_offers.js => family-offers.js} (93%) rename lib/v2/ikea/cn/{low_price.js => low-price.js} (89%) rename lib/v2/ixigua/{userVideo.js => user-video.js} (88%) rename lib/v2/jike/{topicText.js => topic-text.js} (90%) rename lib/v2/kuaidi100/{supported_company.js => supported-company.js} (100%) rename lib/v2/lfsyd/{old_home.js => old-home.js} (100%) rename lib/v2/lightnovel/{lightNovel.js => light-novel.js} (96%) rename lib/v2/liquipedia/{cs_matches.js => cs-matches.js} (85%) rename lib/v2/liquipedia/{dota2_matches.js => dota2-matches.js} (100%) rename lib/v2/luogu/{userBlog.js => user-blog.js} (100%) rename lib/v2/luogu/{userFeed.js => user-feed.js} (100%) rename lib/v2/{yoasobi-music/jsonpHelper.js => lxixsxa/jsonp-helper.js} (81%) rename lib/v2/mastodon/{account_id.js => account-id.js} (100%) rename lib/v2/mastodon/{timeline_local.js => timeline-local.js} (100%) rename lib/v2/mastodon/{timeline_remote.js => timeline-remote.js} (100%) rename lib/v2/mckinsey/cn/{categoryMap.js => category-map.js} (100%) rename lib/v2/nhk/{news_web_easy.js => news-web-easy.js} (100%) rename lib/v2/nintendo/{eshop_cn.js => eshop-cn.js} (100%) rename lib/v2/nintendo/{eshop_hk.js => eshop-hk.js} (96%) rename lib/v2/nintendo/{eshop_jp.js => eshop-jp.js} (100%) rename lib/v2/nintendo/{eshop_us.js => eshop-us.js} (100%) rename lib/v2/nintendo/{news_china.js => news-china.js} (100%) rename lib/v2/nytimes/{daily_briefing_chinese.js => daily-briefing-chinese.js} (94%) rename lib/v2/oceanengine/{arithmeticIndex.js => arithmetic-index.js} (93%) rename lib/v2/odaily/{search_news.js => search-news.js} (100%) rename lib/v2/oreno3d/{get_sec_page_data.js => get-sec-page-data.js} (100%) rename lib/v2/pixiv/api/{getBookmarks.js => get-bookmarks.js} (100%) rename lib/v2/pixiv/api/{getIllustFollows.js => get-illust-follows.js} (100%) rename lib/v2/pixiv/api/{getIllusts.js => get-illusts.js} (100%) rename lib/v2/pixiv/api/{getRanking.js => get-ranking.js} (76%) rename lib/v2/pixiv/api/{getUserDetail.js => get-user-detail.js} (100%) rename lib/v2/pixiv/api/{searchIllust.js => search-illust.js} (100%) rename lib/v2/pixiv/api/{searchPopularIllust.js => search-popular-illust.js} (100%) rename lib/v2/pku/ss/{pg_admin.js => pg-admin.js} (100%) rename lib/v2/pornhub/{category_url.js => category-url.js} (94%) rename lib/v2/qoo-app/user/{appComment.js => app-comment.js} (100%) rename lib/v2/scnu/{physics_school_announcements_and_news.js => physics-school-announcements-and-news.js} (100%) rename lib/v2/scut/seie/{news_center.js => news-ccenter.js} (95%) rename lib/v2/smzdm/{haowen_fenlei.js => haowen-fenlei.js} (88%) rename lib/v2/sspai/{seriesUpdate.js => series-update.js} (100%) rename lib/v2/sspai/{shortcutsGallery.js => shortcuts-gallery.js} (94%) rename lib/v2/thecatcity/{termsMap.js => terms-map.js} (100%) rename lib/v2/trending/{allTrending.js => all-trending.js} (100%) rename lib/v2/twitter/{api_fallback_common.js => api-fallback-common.js} (89%) rename lib/v2/twreporter/{fetch_article.js => fetch-article.js} (100%) rename lib/v2/weibo/{super_index.js => super-index.js} (100%) rename lib/v2/woshipm/{user_article.js => user-article.js} (94%) delete mode 100644 lib/v2/xmnn/docs.js rename lib/v2/xueqiu/{stock_comments.js => stock-comments.js} (87%) rename lib/v2/xueqiu/{stock_info.js => stock-info.js} (89%) rename lib/v2/xueqiu/{user_stock.js => user-stock.js} (100%) rename lib/v2/{lxixsxa/jsonpHelper.js => yoasobi-music/jsonp-helper.js} (81%) rename lib/v2/zhihu/{daily_section.js => daily-section.js} (94%) rename lib/v2/zhihu/execlib/{x-zse-96_v3.js => x-zse-96-v3.js} (80%) rename test/utils/{dateParser.js => date-parser.js} (97%) diff --git a/.eslintrc.json b/.eslintrc.json index f6e2bc341..f86ea69c2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,24 +1,21 @@ { - "extends": ["eslint:recommended", "plugin:n/recommended", "plugin:prettier/recommended", "plugin:yml/recommended"], - "plugins": ["prettier", "@stylistic/js"], + "extends": ["eslint:recommended", "plugin:n/recommended", "plugin:unicorn/recommended", "plugin:prettier/recommended", "plugin:yml/recommended"], + "plugins": ["prettier", "@stylistic/js", "unicorn"], "parserOptions": { "ecmaVersion": "latest", "sourceType": "module" }, "env": { "node": true, - "es6": true, + "es2024": true, "browser": true }, "rules": { // possible problems - "array-callback-return": 2, + "array-callback-return": ["error", { "allowImplicit": true }], "no-await-in-loop": 2, "no-control-regex": 0, "no-duplicate-imports": 2, - "no-prototype-builtins": 0, - "no-unsafe-negation": 2, - "require-atomic-updates": 0, // suggestions "arrow-body-style": 2, "block-scoped-var": 2, @@ -29,16 +26,7 @@ "no-eval": 2, "no-extend-native": 2, "no-extra-label": 2, - "no-global-assign": 2, - "no-implicit-coercion": [ - "error", - { - "boolean": false, - "number": false, - "string": false, - "disallowTemplateShorthand": true - } - ], + "no-implicit-coercion": ["error", { "boolean": false, "number": false, "string": false, "disallowTemplateShorthand": true }], "no-implicit-globals": 2, "no-labels": 2, "no-multi-str": 2, @@ -52,9 +40,49 @@ "object-shorthand": 2, "prefer-arrow-callback": 2, "prefer-const": 2, - "prefer-regex-literals": 1, + "prefer-object-has-own": 2, + "prefer-regex-literals": ["error", { "disallowRedundantWrapping": true }], "require-await": 2, // plugin specific + "unicorn/consistent-destructuring": 1, + "unicorn/consistent-function-scoping": 1, + "unicorn/explicit-length-check": 0, + "unicorn/filename-case": ["error", { "case": "kebabCase", "ignore": [".*\\.(yaml|yml)$", "RequestInProgress\\.js$"] }], + "unicorn/new-for-builtins": 0, + "unicorn/no-array-callback-reference": 0, + "unicorn/no-array-reduce": 1, + "unicorn/no-await-expression-member": 1, + "unicorn/no-empty-file": 1, + "unicorn/no-hex-escape": 1, + "unicorn/no-null": 0, + "unicorn/no-object-as-default-parameter": 1, + "unicorn/no-process-exit": 0, + "unicorn/no-useless-switch-case": 0, + "unicorn/no-useless-undefined": ["error", { "checkArguments": false }], + "unicorn/numeric-separators-style": [ + "warn", + { + "onlyIfContainsSeparator": false, + "number": { "minimumDigits": 7, "groupLength": 3 }, + "binary": { "minimumDigits": 9, "groupLength": 4 }, + "octal": { "minimumDigits": 9, "groupLength": 4 }, + "hexadecimal": { "minimumDigits": 5, "groupLength": 2 } + } + ], + "unicorn/prefer-code-point": 1, + "unicorn/prefer-logical-operator-over-ternary": 1, + "unicorn/prefer-module": 0, + "unicorn/prefer-node-protocol": 0, + "unicorn/prefer-number-properties": ["warn", { "checkInfinity": false }], + "unicorn/prefer-object-from-entries": 1, + "unicorn/prefer-regexp-test": 1, + "unicorn/prefer-string-replace-all": 1, + "unicorn/prefer-string-slice": 0, + "unicorn/prefer-switch": ["error", { "emptyDefaultCase": "do-nothing-comment" }], + "unicorn/prefer-top-level-await": 0, + "unicorn/prevent-abbreviations": 0, + "unicorn/switch-case-braces": ["error", "avoid"], + "unicorn/text-encoding-identifier-case": 0, // previous eslint formatting rules "@stylistic/js/arrow-parens": 2, "@stylistic/js/arrow-spacing": 2, @@ -74,40 +102,20 @@ "@stylistic/js/space-unary-ops": 2, "@stylistic/js/spaced-comment": 2, // https://github.com/eslint-community/eslint-plugin-n - "n/no-extraneous-require": [ - "error", - { - "allowModules": ["puppeteer-extra-plugin-user-preferences", "puppeteer-extra-plugin-user-data-dir"] - } - ], + "n/no-extraneous-require": ["error", { "allowModules": ["puppeteer-extra-plugin-user-preferences", "puppeteer-extra-plugin-user-data-dir"] }], "n/no-deprecated-api": 1, "n/no-missing-require": 0, "n/no-process-exit": 0, - "n/no-unpublished-require": [ - "error", - { - "allowModules": ["tosource"] - } - ], + "n/no-unpublished-require": ["error", { "allowModules": ["tosource"] }], "prettier/prettier": 0, - "yml/quotes": [ - "error", - { - "prefer": "single" - } - ] + "yml/quotes": ["error", { "prefer": "single" }] }, "overrides": [ { "files": ["*.yaml", "*.yml"], "parser": "yaml-eslint-parser", "rules": { - "lines-around-comment": [ - "error", - { - "beforeBlockComment": false - } - ] + "lines-around-comment": ["error", { "beforeBlockComment": false }] } } ] diff --git a/assets/radar-rules.js b/assets/radar-rules.js index 43bcbba21..1b1724529 100644 --- a/assets/radar-rules.js +++ b/assets/radar-rules.js @@ -167,7 +167,7 @@ docs: 'https://docs.rsshub.app/routes/multimedia#onejav', source: '/', target: (params, url, document) => { - const today = document.querySelector('div.card.mb-1.card-overview').getAttribute('data-date').replace(/-/g, ''); + const today = document.querySelector('div.card.mb-1.card-overview').dataset.date.replaceAll('-', ''); return `/onejav/day/${today}`; }, }, @@ -215,7 +215,7 @@ } else { return false; } - return `/sexinsex/${pid}/${typeid ? typeid : ''}`; + return `/sexinsex/${pid}/${typeid ?? ''}`; }, }, ], @@ -230,7 +230,7 @@ target: (params, url) => { const id = new URL(url).searchParams.get('fid'); const type = new URL(url).searchParams.get('type'); - return `/t66y/${id}/${type ? type : ''}`; + return `/t66y/${id}/${type ?? ''}`; }, }, ], diff --git a/lib/api_router.js b/lib/api-router.js similarity index 88% rename from lib/api_router.js rename to lib/api-router.js index b452d6066..bed73e393 100644 --- a/lib/api_router.js +++ b/lib/api-router.js @@ -6,8 +6,7 @@ router.get('/routes/:name?', (ctx) => { let counter = 0; const maintainer = require('./maintainer'); - Object.keys(maintainer).forEach((i) => { - const path = i; + for (const path of Object.keys(maintainer)) { const top = path.split('/')[1]; if (!ctx.params.name || top === ctx.params.name) { @@ -18,7 +17,7 @@ router.get('/routes/:name?', (ctx) => { } counter++; } - }); + } ctx.body = { counter, result }; }); diff --git a/lib/app.js b/lib/app.js index 39b91f574..720da7f71 100644 --- a/lib/app.js +++ b/lib/app.js @@ -20,13 +20,13 @@ const antiHotlink = require('./middleware/anti-hotlink'); const loadOnDemand = require('./middleware/load-on-demand'); const router = require('./router'); -const core_router = require('./core_router'); -const protected_router = require('./protected_router'); +const core_router = require('./core-router'); +const protected_router = require('./protected-router'); const mount = require('koa-mount'); // API related const apiTemplate = require('./middleware/api-template'); -const api_router = require('./api_router'); +const api_router = require('./api-router'); const apiResponseHandler = require('./middleware/api-response-handler'); process.on('uncaughtException', (e) => { @@ -37,8 +37,8 @@ const app = new Koa(); app.proxy = true; // favicon -app.use(favicon(__dirname + '/favicon.png', { maxAge: 31536000000 })); -app.use(serve(__dirname + '/static', { maxage: 31536000000 })); +app.use(favicon(__dirname + '/favicon.png', { maxAge: 31_536_000_000 })); +app.use(serve(__dirname + '/static', { maxage: 31_536_000_000 })); // global error handing app.use(onerror); diff --git a/lib/config.js b/lib/config.js index 81f9b2c6c..13f781236 100644 --- a/lib/config.js +++ b/lib/config.js @@ -45,21 +45,21 @@ const calculateValue = () => { socket: envs.SOCKET || null, // 监听 Unix Socket, null 为禁用 }, listenInaddrAny: envs.LISTEN_INADDR_ANY || 1, // 是否允许公网连接,取值 0 1 - requestRetry: parseInt(envs.REQUEST_RETRY) || 2, // 请求失败重试次数 - requestTimeout: parseInt(envs.REQUEST_TIMEOUT) || 30000, // Milliseconds to wait for the server to end the response before aborting the request - ua: envs.UA ? envs.UA : envs.NO_RANDOM_UA === 'true' || envs.NO_RANDOM_UA === '1' ? TRUE_UA : randUserAgent({ browser: 'chrome', os: 'mac os', device: 'desktop' }), + requestRetry: Number.parseInt(envs.REQUEST_RETRY) || 2, // 请求失败重试次数 + requestTimeout: Number.parseInt(envs.REQUEST_TIMEOUT) || 30000, // Milliseconds to wait for the server to end the response before aborting the request + ua: envs.UA ?? (envs.NO_RANDOM_UA === 'true' || envs.NO_RANDOM_UA === '1' ? TRUE_UA : randUserAgent({ browser: 'chrome', os: 'mac os', device: 'desktop' })), trueUA: TRUE_UA, // cors request allowOrigin: envs.ALLOW_ORIGIN, // cache cache: { - type: typeof envs.CACHE_TYPE === 'undefined' ? 'memory' : envs.CACHE_TYPE, // 缓存类型,支持 'memory' 和 'redis',设为空可以禁止缓存 - requestTimeout: parseInt(envs.CACHE_REQUEST_TIMEOUT) || 60, - routeExpire: parseInt(envs.CACHE_EXPIRE) || 5 * 60, // 路由缓存时间,单位为秒 - contentExpire: parseInt(envs.CACHE_CONTENT_EXPIRE) || 1 * 60 * 60, // 不变内容缓存时间,单位为秒 + type: envs.CACHE_TYPE === undefined ? 'memory' : envs.CACHE_TYPE, // 缓存类型,支持 'memory' 和 'redis',设为空可以禁止缓存 + requestTimeout: Number.parseInt(envs.CACHE_REQUEST_TIMEOUT) || 60, + routeExpire: Number.parseInt(envs.CACHE_EXPIRE) || 5 * 60, // 路由缓存时间,单位为秒 + contentExpire: Number.parseInt(envs.CACHE_CONTENT_EXPIRE) || 1 * 60 * 60, // 不变内容缓存时间,单位为秒 }, memory: { - max: parseInt(envs.MEMORY_MAX) || Math.pow(2, 8), // The maximum number of items that remain in the cache. This must be a positive finite intger. + max: Number.parseInt(envs.MEMORY_MAX) || Math.pow(2, 8), // The maximum number of items that remain in the cache. This must be a positive finite intger. // https://github.com/isaacs/node-lru-cache#options }, redis: { @@ -96,7 +96,7 @@ const calculateValue = () => { showLoggerTimestamp: envs.SHOW_LOGGER_TIMESTAMP, sentry: { dsn: envs.SENTRY, - routeTimeout: parseInt(envs.SENTRY_ROUTE_TIMEOUT) || 30000, + routeTimeout: Number.parseInt(envs.SENTRY_ROUTE_TIMEOUT) || 30000, }, // feed config hotlink: { @@ -110,7 +110,7 @@ const calculateValue = () => { allow_user_supply_unsafe_domain: envs.ALLOW_USER_SUPPLY_UNSAFE_DOMAIN === 'true', }, suffix: envs.SUFFIX, - titleLengthLimit: parseInt(envs.TITLE_LENGTH_LIMIT) || 150, + titleLengthLimit: Number.parseInt(envs.TITLE_LENGTH_LIMIT) || 150, openai: { apiKey: envs.OPENAI_API_KEY, model: envs.OPENAI_MODEL || 'gpt-3.5-turbo-16k', diff --git a/lib/core_router.js b/lib/core-router.js similarity index 100% rename from lib/core_router.js rename to lib/core-router.js diff --git a/lib/index.js b/lib/index.js index cf7e0f63f..730a73c09 100644 --- a/lib/index.js +++ b/lib/index.js @@ -16,7 +16,7 @@ if (config.enableCluster && cluster.isMaster && process.env.NODE_ENV !== 'test' if (fs.existsSync(config.connect.socket)) { fs.unlinkSync(config.connect.socket); } - server = app.listen(config.connect.socket, parseInt(config.listenInaddrAny) ? null : '127.0.0.1'); + server = app.listen(config.connect.socket, Number.parseInt(config.listenInaddrAny) ? null : '127.0.0.1'); logger.info('Listening Unix Socket ' + config.connect.socket); process.on('SIGINT', () => { fs.unlinkSync(config.connect.socket); @@ -24,7 +24,7 @@ if (config.enableCluster && cluster.isMaster && process.env.NODE_ENV !== 'test' }); } if (config.connect.port) { - server = app.listen(config.connect.port, parseInt(config.listenInaddrAny) ? null : '127.0.0.1'); + server = app.listen(config.connect.port, Number.parseInt(config.listenInaddrAny) ? null : '127.0.0.1'); logger.info('Listening Port ' + config.connect.port); } diff --git a/lib/maintainer.js b/lib/maintainer.js index 41592e812..5417992ef 100644 --- a/lib/maintainer.js +++ b/lib/maintainer.js @@ -1,12 +1,12 @@ const dirname = __dirname + '/v2'; const fs = require('fs'); -const { join } = require('path'); +const path = require('path'); // Presence Check for (const dir of fs.readdirSync(dirname)) { - const dirPath = join(dirname, dir); - if (fs.existsSync(join(dirPath, 'router.js')) && !fs.existsSync(join(dirPath, 'maintainer.js'))) { - throw Error(`No maintainer.js in "${dirPath}".`); + const dirPath = path.join(dirname, dir); + if (fs.existsSync(path.join(dirPath, 'router.js')) && !fs.existsSync(path.join(dirPath, 'maintainer.js'))) { + throw new Error(`No maintainer.js in "${dirPath}".`); } } @@ -24,15 +24,15 @@ for (const dir in maintainerPath) { // typo check e.g., ✘ module.export, ✔ module.exports if (!Object.keys(routes).length) { - throw Error(`No maintainer in "${dir}".`); + throw new Error(`No maintainer in "${dir}".`); } for (const author of Object.values(routes)) { if (!Array.isArray(author)) { - throw Error(`Maintainers' name should be an array in "${dir}".`); + throw new TypeError(`Maintainers' name should be an array in "${dir}".`); } // check for [], [''] or ['Someone', ''] if (author.length < 1 || author.includes('')) { - throw Error(`Empty maintainer in "${dir}".`); + throw new Error(`Empty maintainer in "${dir}".`); } } @@ -43,11 +43,11 @@ for (const dir in maintainerPath) { // 兼容旧版路由 const router = require('./router'); -router.stack.forEach((e) => { +for (const e of router.stack) { if (!maintainers[e.path]) { maintainers[e.path] = []; } -}); +} module.exports = Object.keys(maintainers) .sort() diff --git a/lib/middleware/access-control.js b/lib/middleware/access-control.js index 277362689..a7b4ab2ba 100644 --- a/lib/middleware/access-control.js +++ b/lib/middleware/access-control.js @@ -5,11 +5,11 @@ const isLocalhost = require('is-localhost-ip'); const reject = (ctx) => { ctx.response.status = 403; - throw Error('Authentication failed. Access denied.'); + throw new Error('Authentication failed. Access denied.'); }; const ipv4Pattern = /^(\d{1,3}\.){3}\d{1,3}$/; -const cidrPattern = /(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})\/(\d{1,2})/; +const cidrPattern = /((?:\d{1,3}\.){3}\d{1,3})\/(\d{1,2})/; const ipInCidr = (cidr, ip) => { const cidrMatch = cidr.match(cidrPattern); @@ -17,7 +17,7 @@ const ipInCidr = (cidr, ip) => { if (!cidrMatch || !ipMatch) { return false; } - const subnetMask = parseInt(cidrMatch[2]); + const subnetMask = Number.parseInt(cidrMatch[2]); const cidrIpBits = ipv4ToBitsring(cidrMatch[1]).substring(0, subnetMask); const ipBits = ipv4ToBitsring(ip).substring(0, subnetMask); return cidrIpBits === ipBits; @@ -26,7 +26,7 @@ const ipInCidr = (cidr, ip) => { const ipv4ToBitsring = (ip) => ip .split('.') - .map((part) => ('00000000' + parseInt(part).toString(2)).slice(-8)) + .map((part) => ('00000000' + Number.parseInt(part).toString(2)).slice(-8)) .join(''); module.exports = async (ctx, next) => { @@ -53,22 +53,16 @@ module.exports = async (ctx, next) => { return grant(); } - if (config.accessKey) { - if (config.accessKey === accessKey || accessCode === md5(requestPath + config.accessKey)) { - return grant(); - } + if (config.accessKey && (config.accessKey === accessKey || accessCode === md5(requestPath + config.accessKey))) { + return grant(); } - if (config.allowlist) { - if (config.allowlist.find((item) => ip.includes(item) || ipInCidr(item, ip) || requestPath.includes(item) || requestUA.includes(item))) { - return grant(); - } + if (config.allowlist && config.allowlist.some((item) => ip.includes(item) || ipInCidr(item, ip) || requestPath.includes(item) || requestUA.includes(item))) { + return grant(); } - if (config.denylist) { - if (!config.denylist.find((item) => ip.includes(item) || ipInCidr(item, ip) || requestPath.includes(item) || requestUA.includes(item))) { - return grant(); - } + if (config.denylist && !config.denylist.some((item) => ip.includes(item) || ipInCidr(item, ip) || requestPath.includes(item) || requestUA.includes(item))) { + return grant(); } reject(ctx); diff --git a/lib/middleware/anti-hotlink.js b/lib/middleware/anti-hotlink.js index 049487010..9a216126a 100644 --- a/lib/middleware/anti-hotlink.js +++ b/lib/middleware/anti-hotlink.js @@ -4,8 +4,8 @@ const logger = require('@/utils/logger'); const path = require('path'); const { art } = require('@/utils/render'); -const templateRegex = /\$\{([^{}]+)}/g; -const allowedUrlProperties = ['hash', 'host', 'hostname', 'href', 'origin', 'password', 'pathname', 'port', 'protocol', 'search', 'searchParams', 'username']; +const templateRegex = /\${([^{}]+)}/g; +const allowedUrlProperties = new Set(['hash', 'host', 'hostname', 'href', 'origin', 'password', 'pathname', 'port', 'protocol', 'search', 'searchParams', 'username']); const IframeWrapperTemplate = path.join(__dirname, 'templates/iframe.art'); // match path or sub-path @@ -26,7 +26,7 @@ const filterPath = (path) => { }; const interpolate = (str, obj) => - str.replace(templateRegex, (_, prop) => { + str.replaceAll(templateRegex, (_, prop) => { let needEncode = false; if (prop.endsWith('_ue')) { // url encode @@ -39,7 +39,7 @@ const parseUrl = (str) => { let url; try { url = new URL(str); - } catch (e) { + } catch { logger.error(`Failed to parse ${str}`); } @@ -87,12 +87,12 @@ const validateTemplate = (template) => { if (!template) { return; } - [...template.matchAll(templateRegex)].forEach((match) => { + for (const match of template.matchAll(templateRegex)) { const prop = match[1].endsWith('_ue') ? match[1].slice(0, -3) : match[1]; - if (!allowedUrlProperties.includes(prop)) { + if (!allowedUrlProperties.has(prop)) { throw new Error(`Invalid URL property: ${prop}`); } - }); + } }; module.exports = async (ctx, next) => { @@ -115,11 +115,7 @@ module.exports = async (ctx, next) => { // Force config hotlink template on conflict if (config.hotlink.template) { - if (!filterPath(ctx.request.path)) { - image_hotlink_template = undefined; - } else { - image_hotlink_template = config.hotlink.template; - } + image_hotlink_template = filterPath(ctx.request.path) ? config.hotlink.template : undefined; } if (!image_hotlink_template && !multimedia_hotlink_template && !shouldWrapInIframe) { @@ -138,11 +134,12 @@ module.exports = async (ctx, next) => { ctx.state.data.description = process(ctx.state.data.description, image_hotlink_template, multimedia_hotlink_template, shouldWrapInIframe); } - ctx.state.data.item && - ctx.state.data.item.forEach((item) => { + if (ctx.state.data.item) { + for (const item of ctx.state.data.item) { if (item.description) { item.description = process(item.description, image_hotlink_template, multimedia_hotlink_template, shouldWrapInIframe); } - }); + } + } } }; diff --git a/lib/middleware/cache/index.js b/lib/middleware/cache/index.js index 4c715b85a..bde7cdc0a 100644 --- a/lib/middleware/cache/index.js +++ b/lib/middleware/cache/index.js @@ -57,22 +57,22 @@ module.exports = function (app) { ...cacheModule, tryGet: async (key, getValueFunc, maxAge = config.cache.contentExpire, refresh = true) => { if (typeof key !== 'string') { - throw Error('Cache key must be a string'); + throw new TypeError('Cache key must be a string'); } let v = await get(key, refresh); - if (!v) { - v = await getValueFunc(); - set(key, v, maxAge); - } else { + if (v) { let parsed; try { parsed = JSON.parse(v); - } catch (e) { + } catch { parsed = null; } if (parsed) { v = parsed; } + } else { + v = await getValueFunc(); + set(key, v, maxAge); } return v; @@ -112,7 +112,7 @@ module.exports = function (app) { ctx.state.data = JSON.parse(value); return; } - } catch (e) { + } catch { // } @@ -121,9 +121,9 @@ module.exports = function (app) { try { await next(); - } catch (e) { + } catch (error) { await globalCache.set(controlKey, '0', config.cache.requestTimeout); - throw e; + throw error; } if (ctx.response.get('Cache-Control') !== 'no-cache' && ctx.state && ctx.state.data) { diff --git a/lib/middleware/cache/redis.js b/lib/middleware/cache/redis.js index 2234dd866..b7d57b974 100644 --- a/lib/middleware/cache/redis.js +++ b/lib/middleware/cache/redis.js @@ -20,7 +20,7 @@ redisClient.on('connect', () => { const getCacheTtlKey = (key) => { if (key.startsWith('rsshub:cacheTtl:')) { - throw Error('"rsshub:cacheTtl:" prefix is reserved for the internal usage, please change your cache key'); // blocking any attempt to get/set the cacheTtl + throw new Error('"rsshub:cacheTtl:" prefix is reserved for the internal usage, please change your cache key'); // blocking any attempt to get/set the cacheTtl } return `rsshub:cacheTtl:${key}`; }; @@ -31,13 +31,13 @@ module.exports = { const cacheTtlKey = getCacheTtlKey(key); let [value, cacheTtl] = await redisClient.mget(key, cacheTtlKey); if (value && refresh) { - if (!cacheTtl) { + if (cacheTtl) { + redisClient.expire(cacheTtlKey, cacheTtl); + } else { // if cacheTtl is not set, that means the cache expire time is contentExpire cacheTtl = config.cache.contentExpire; // dont save cacheTtl to Redis, as it is the default value // redisClient.set(cacheTtlKey, cacheTtl, 'EX', cacheTtl); - } else { - redisClient.expire(cacheTtlKey, cacheTtl); } redisClient.expire(key, cacheTtl); value = value + ''; diff --git a/lib/middleware/header.js b/lib/middleware/header.js index 2292ddbed..762363f9d 100644 --- a/lib/middleware/header.js +++ b/lib/middleware/header.js @@ -24,7 +24,7 @@ module.exports = async (ctx, next) => { return; } - const status = (ctx.status / 100) | 0; + const status = Math.trunc(ctx.status / 100); if (2 !== status) { return; } diff --git a/lib/middleware/load-on-demand.js b/lib/middleware/load-on-demand.js index 0c15bb423..837a17cc7 100644 --- a/lib/middleware/load-on-demand.js +++ b/lib/middleware/load-on-demand.js @@ -11,7 +11,9 @@ module.exports = function (app) { if (p.length > 0) { modName = p[0]; - if (!loadedRoutes.has(modName)) { + if (loadedRoutes.has(modName)) { + mounted = true; + } else { const mod = routes[modName]; // Mount module if (mod) { @@ -21,8 +23,6 @@ module.exports = function (app) { mod(router); app.use(mount(`/${modName}`, router.routes())).use(router.allowedMethods()); } - } else { - mounted = true; } } diff --git a/lib/middleware/onerror.js b/lib/middleware/onerror.js index 3f2c3a04b..a4272b0aa 100644 --- a/lib/middleware/onerror.js +++ b/lib/middleware/onerror.js @@ -20,15 +20,15 @@ if (config.sentry.dsn) { try { gitHash = require('git-rev-sync').short(); -} catch (e) { +} catch { gitHash = (process.env.HEROKU_SLUG_COMMIT && process.env.HEROKU_SLUG_COMMIT.slice(0, 7)) || (process.env.VERCEL_GIT_COMMIT_SHA && process.env.VERCEL_GIT_COMMIT_SHA.slice(0, 7)) || 'unknown'; } module.exports = async (ctx, next) => { try { - const time = +new Date(); + const time = Date.now(); await next(); - if (config.sentry.dsn && +new Date() - time >= config.sentry.routeTimeout) { + if (config.sentry.dsn && Date.now() - time >= config.sentry.routeTimeout) { Sentry.withScope((scope) => { scope.setTag('route', ctx._matchedRoute); scope.setTag('name', ctx.request.path.split('/')[1]); @@ -36,8 +36,8 @@ module.exports = async (ctx, next) => { Sentry.captureException(new Error('Route Timeout')); }); } - } catch (err) { - if (err instanceof Error && !err.stack.split('\n')[1].includes('lib/middleware/parameter.js')) { + } catch (error) { + if (error instanceof Error && !error.stack.split('\n')[1].includes('lib/middleware/parameter.js')) { // Append v2 route path if a route throws an error // since koa-mount will remove the mount path from ctx.request.path // https://github.com/koajs/mount/issues/62 @@ -45,11 +45,11 @@ module.exports = async (ctx, next) => { ctx._matchedRoute = ctx._matchedRoute ? (ctx.mountPath ?? '') + ctx._matchedRoute : ctx._matchedRoute; } - let message = err; - if (err.name && (err.name === 'HTTPError' || err.name === 'RequestError')) { - message = `${err.message}: target website might be blocking our access, you can host your own RSSHub instance for a better usability.`; - } else if (err instanceof Error) { - message = process.env.NODE_ENV === 'production' ? err.message : err.stack; + let message = error; + if (error.name && (error.name === 'HTTPError' || error.name === 'RequestError')) { + message = `${error.message}: target website might be blocking our access, you can host your own RSSHub instance for a better usability.`; + } else if (error instanceof Error) { + message = process.env.NODE_ENV === 'production' ? error.message : error.stack; } logger.error(`Error in ${ctx.request.path}: ${message}`); @@ -57,7 +57,7 @@ module.exports = async (ctx, next) => { if (config.isPackage) { ctx.body = { error: { - message: err.message ? err.message : err, + message: error.message ?? error, }, }; } else { @@ -65,12 +65,12 @@ module.exports = async (ctx, next) => { 'Content-Type': 'text/html; charset=UTF-8', }); - if (err instanceof RequestInProgressError) { + if (error instanceof RequestInProgressError) { ctx.status = 503; - message = err.message; + message = error.message; ctx.set('Cache-Control', `public, max-age=${config.cache.requestTimeout}`); } else if (ctx.status === 403) { - message = err.message; + message = error.message; } else { ctx.status = 404; } @@ -112,7 +112,7 @@ module.exports = async (ctx, next) => { scope.setTag('route', ctx._matchedRoute); scope.setTag('name', ctx.request.path.split('/')[1]); scope.addEventProcessor((event) => Sentry.Handlers.parseRequest(event, ctx.request)); - Sentry.captureException(err); + Sentry.captureException(error); }); } } diff --git a/lib/middleware/parameter.js b/lib/middleware/parameter.js index bd37d3510..86f5fa85e 100644 --- a/lib/middleware/parameter.js +++ b/lib/middleware/parameter.js @@ -21,7 +21,7 @@ const resolveRelativeLink = ($, elem, attr, baseUrl) => { // e.g. should leave