rsshub 1.0.0-master.eb9cabb → 1.0.0-master.ebb62b5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/config.ts +39 -1
- package/lib/errors/index.tsx +2 -1
- package/lib/index.ts +48 -15
- package/lib/middleware/debug.ts +6 -4
- package/lib/middleware/header.test.ts +1 -0
- package/lib/middleware/header.ts +6 -0
- package/lib/middleware/template.test.ts +8 -0
- package/lib/middleware/template.tsx +5 -0
- package/lib/registry.ts +71 -1
- package/lib/router.js +0 -6
- package/lib/routes/18comic/album.ts +59 -64
- package/lib/routes/18comic/search.ts +53 -4
- package/lib/routes/18comic/utils.ts +70 -1
- package/lib/routes/36kr/hot-list.ts +1 -1
- package/lib/routes/36kr/index.ts +1 -1
- package/lib/routes/3dmgame/news-center.ts +1 -1
- package/lib/routes/500px/tribe-set.ts +1 -1
- package/lib/routes/acfun/article.ts +1 -1
- package/lib/routes/acfun/bangumi.ts +1 -1
- package/lib/routes/acfun/video.ts +1 -1
- package/lib/routes/aeon/category.ts +1 -1
- package/lib/routes/aeon/type.ts +1 -1
- package/lib/routes/agirls/topic-list.ts +1 -1
- package/lib/routes/agirls/topic.ts +1 -1
- package/lib/routes/agirls/z-index.ts +1 -1
- package/lib/routes/aibase/daily.ts +110 -0
- package/lib/routes/aibase/discover.ts +1 -1
- package/lib/routes/aibase/news.ts +1 -1
- package/lib/routes/aibase/topic.ts +1 -1
- package/lib/routes/aibase/util.ts +3 -0
- package/lib/routes/ainvest/news.ts +1 -1
- package/lib/routes/ajmide/index.ts +1 -1
- package/lib/routes/aliresearch/information.ts +1 -1
- package/lib/routes/android/security-bulletin.ts +61 -0
- package/lib/routes/anthropic/research.ts +112 -0
- package/lib/routes/apnews/topics.ts +2 -1
- package/lib/routes/apnews/utils.ts +1 -1
- package/lib/routes/app-sales/index.ts +200 -0
- package/lib/routes/app-sales/mostwanted.ts +194 -0
- package/lib/routes/app-sales/namespace.ts +9 -0
- package/lib/routes/app-sales/templates/description.art +120 -0
- package/lib/routes/app-sales/util.ts +161 -0
- package/lib/routes/apple/apps.ts +1 -1
- package/lib/routes/apple/security-releases.ts +179 -0
- package/lib/routes/apple/templates/security-releases.art +28 -0
- package/lib/routes/appleinsider/index.ts +1 -1
- package/lib/routes/augmentcode/blog.ts +161 -0
- package/lib/routes/augmentcode/namespace.ts +9 -0
- package/lib/routes/augmentcode/templates/description.art +17 -0
- package/lib/routes/baidu/gushitong/index.ts +1 -1
- package/lib/routes/bakamh/manga.ts +74 -0
- package/lib/routes/bakamh/namespace.ts +8 -0
- package/lib/routes/bandisoft/history.ts +329 -0
- package/lib/routes/bandisoft/namespace.ts +9 -0
- package/lib/routes/banyuetan/index.ts +238 -0
- package/lib/routes/banyuetan/namespace.ts +9 -0
- package/lib/routes/banyuetan/templates/description.art +21 -0
- package/lib/routes/bbc/learningenglish.ts +76 -0
- package/lib/routes/behance/user.ts +1 -1
- package/lib/routes/bfl/announcements.ts +127 -0
- package/lib/routes/bfl/namespace.ts +9 -0
- package/lib/routes/bigquant/collections.ts +1 -1
- package/lib/routes/bilibili/bangumi.ts +1 -1
- package/lib/routes/bilibili/cache.ts +19 -20
- package/lib/routes/bilibili/check-cookie.ts +31 -0
- package/lib/routes/bilibili/dynamic.ts +29 -15
- package/lib/routes/bilibili/followings-dynamic.ts +9 -3
- package/lib/routes/bilibili/ranking.ts +3 -1
- package/lib/routes/bilibili/readlist.ts +1 -1
- package/lib/routes/bilibili/video.ts +3 -1
- package/lib/routes/binance/announcement.ts +1 -1
- package/lib/routes/bitget/announcement.ts +1 -1
- package/lib/routes/bjp/apod.ts +1 -1
- package/lib/routes/bloomberg/authors.ts +1 -1
- package/lib/routes/bloomberg/index.ts +1 -1
- package/lib/routes/bookfere/category.ts +1 -1
- package/lib/routes/bsky/feeds.ts +1 -1
- package/lib/routes/bsky/keyword.ts +15 -10
- package/lib/routes/bsky/posts.ts +1 -1
- package/lib/routes/bupt/scss.ts +98 -0
- package/lib/routes/caixin/latest.ts +1 -1
- package/lib/routes/cara/likes.ts +1 -1
- package/lib/routes/cara/portfolio.ts +1 -1
- package/lib/routes/cara/timeline.ts +1 -1
- package/lib/routes/changba/user.ts +1 -1
- package/lib/routes/chaping/banner.ts +1 -1
- package/lib/routes/chaping/news.ts +1 -1
- package/lib/routes/chaping/newsflash.ts +1 -1
- package/lib/routes/chiphell/namespace.ts +7 -0
- package/lib/routes/chiphell/portal.ts +82 -0
- package/lib/routes/chnmuseum/namespace.ts +10 -0
- package/lib/routes/chnmuseum/xingnew.ts +73 -0
- package/lib/routes/chnmuseum/xwzt.ts +67 -0
- package/lib/routes/chocolatey/namespace.ts +9 -0
- package/lib/routes/chocolatey/packages.ts +122 -0
- package/lib/routes/chub/characters.ts +4 -6
- package/lib/routes/cih-index/namespace.ts +7 -0
- package/lib/routes/cih-index/report.ts +74 -0
- package/lib/routes/civitai/user.ts +90 -0
- package/lib/routes/cmde/index.ts +1 -1
- package/lib/routes/cna/index.ts +2 -24
- package/lib/routes/cna/utils.ts +23 -0
- package/lib/routes/cna/web/index.ts +2 -22
- package/lib/routes/cnbeta/namespace.ts +1 -1
- package/lib/routes/cngal/entry.ts +2 -2
- package/lib/routes/cngal/weekly.ts +3 -3
- package/lib/routes/cockroachlabs/blog.ts +113 -0
- package/lib/routes/cockroachlabs/namespace.ts +7 -0
- package/lib/routes/copymanga/comic.ts +7 -9
- package/lib/routes/cuilingmag/index.ts +1 -1
- package/lib/routes/cyzone/author.ts +1 -1
- package/lib/routes/cyzone/label.ts +1 -1
- package/lib/routes/daum/potplayer.ts +257 -0
- package/lib/routes/dcfever/news.ts +1 -1
- package/lib/routes/dcfever/reviews.ts +1 -1
- package/lib/routes/dcfever/trading-search.ts +1 -1
- package/lib/routes/dcfever/trading.ts +1 -1
- package/lib/routes/dedao/index.ts +1 -1
- package/lib/routes/dedao/knowledge.ts +1 -1
- package/lib/routes/dedao/list.ts +1 -1
- package/lib/routes/dedao/user.ts +1 -1
- package/lib/routes/deepl/blog.ts +422 -0
- package/lib/routes/deepl/namespace.ts +9 -0
- package/lib/routes/deepl/templates/description.art +21 -0
- package/lib/routes/deepmind/blog.ts +1 -1
- package/lib/routes/diandong/news.ts +1 -1
- package/lib/routes/digitalcameraworld/news.ts +1 -1
- package/lib/routes/dlsite/campaign.ts +1 -1
- package/lib/routes/dlsite/ci-en/article.ts +1 -1
- package/lib/routes/dlsite/new.ts +1 -1
- package/lib/routes/dn/news.ts +1 -1
- package/lib/routes/dockerhub/build.ts +1 -1
- package/lib/routes/dongqiudi/daily.ts +1 -1
- package/lib/routes/dongqiudi/player-news.ts +1 -1
- package/lib/routes/dongqiudi/result.ts +1 -1
- package/lib/routes/dongqiudi/special.ts +1 -1
- package/lib/routes/dongqiudi/team-news.ts +1 -1
- package/lib/routes/dongqiudi/top-news.ts +1 -1
- package/lib/routes/dora-world/article.ts +1 -1
- package/lib/routes/douban/other/group.ts +1 -1
- package/lib/routes/douban/other/list.ts +3 -3
- package/lib/routes/douban/other/topic.ts +1 -1
- package/lib/routes/douban/people/status.ts +1 -1
- package/lib/routes/dx2025/index.ts +1 -1
- package/lib/routes/eastmoney/report/index.ts +1 -1
- package/lib/routes/eastmoney/search/index.ts +1 -1
- package/lib/routes/eastmoney/ttjj/user.ts +1 -1
- package/lib/routes/economist/espresso.ts +1 -1
- package/lib/routes/economist/full.ts +1 -1
- package/lib/routes/embassy/supported-list.ts +1 -1
- package/lib/routes/epicgames/index.ts +1 -1
- package/lib/routes/eventernote/actors.ts +1 -1
- package/lib/routes/everia/article.ts +21 -0
- package/lib/routes/everia/category.ts +54 -0
- package/lib/routes/everia/const.ts +4 -0
- package/lib/routes/everia/latest.ts +49 -0
- package/lib/routes/everia/namespace.ts +6 -0
- package/lib/routes/everia/search.ts +45 -0
- package/lib/routes/everia/tag.ts +54 -0
- package/lib/routes/fanbox/utils.ts +1 -1
- package/lib/routes/fantia/search.ts +1 -1
- package/lib/routes/fantia/user.ts +1 -1
- package/lib/routes/fantube/creator.ts +69 -0
- package/lib/routes/fantube/namespace.ts +7 -0
- package/lib/routes/fantube/templates/post.art +17 -0
- package/lib/routes/fantube/types.ts +100 -0
- package/lib/routes/fantube/utils.ts +268 -0
- package/lib/routes/fashionnetwork/namespace.ts +1 -1
- package/lib/routes/fastbull/express-news.ts +1 -1
- package/lib/routes/fastbull/news.ts +1 -1
- package/lib/routes/fediverse/timeline.ts +1 -1
- package/lib/routes/ff14/ff14-global.ts +1 -1
- package/lib/routes/finviz/news.ts +1 -1
- package/lib/routes/followin/index.ts +1 -1
- package/lib/routes/followin/news.ts +1 -1
- package/lib/routes/foresightnews/article.ts +1 -1
- package/lib/routes/foresightnews/column.ts +1 -1
- package/lib/routes/foresightnews/index.ts +1 -1
- package/lib/routes/foresightnews/news.ts +1 -1
- package/lib/routes/freewechat/profile.ts +7 -1
- package/lib/routes/ftm/index.ts +1 -1
- package/lib/routes/furaffinity/browse.ts +1 -1
- package/lib/routes/furaffinity/home.ts +1 -1
- package/lib/routes/furaffinity/journals.ts +1 -1
- package/lib/routes/furaffinity/search.ts +1 -1
- package/lib/routes/furaffinity/shouts.ts +1 -1
- package/lib/routes/furaffinity/status.ts +1 -1
- package/lib/routes/fx678/kx.ts +1 -1
- package/lib/routes/gamer/ani/anime.ts +1 -1
- package/lib/routes/gamer/ani/new-anime.ts +1 -1
- package/lib/routes/gamer/gnn-index.ts +1 -1
- package/lib/routes/gamer/hot.ts +1 -1
- package/lib/routes/gcores/radio.ts +1 -1
- package/lib/routes/geekpark/index.ts +1 -1
- package/lib/routes/gelonghui/home.ts +1 -1
- package/lib/routes/gelonghui/hot-article.ts +1 -1
- package/lib/routes/gelonghui/keyword.ts +1 -1
- package/lib/routes/gelonghui/live.ts +1 -1
- package/lib/routes/gelonghui/subject.ts +1 -1
- package/lib/routes/gelonghui/user.ts +1 -1
- package/lib/routes/geocaching/blogs.ts +2 -2
- package/lib/routes/gettr/user.ts +1 -1
- package/lib/routes/github/activity.ts +2 -1
- package/lib/routes/github/issue.ts +1 -1
- package/lib/routes/github/star.ts +1 -1
- package/lib/routes/github/trending.ts +1 -1
- package/lib/routes/gmu/namespace.ts +7 -0
- package/lib/routes/gmu/news.ts +136 -0
- package/lib/routes/gmu/yjs.ts +173 -0
- package/lib/routes/go/jihs/idwr.ts +137 -0
- package/lib/routes/google/citations.ts +1 -1
- package/lib/routes/google/doodles.ts +1 -1
- package/lib/routes/google/news.ts +1 -1
- package/lib/routes/google/scholar.ts +1 -1
- package/lib/routes/google/search.ts +18 -30
- package/lib/routes/gov/chongqing/sydwgkzp.ts +22 -6
- package/lib/routes/gov/customs/list.ts +8 -3
- package/lib/routes/gov/hangzhou/zwfw.ts +1 -1
- package/lib/routes/gov/pbc/goutongjiaoliu.ts +1 -1
- package/lib/routes/gov/sichuan/deyang/govpublicinfo.ts +9 -10
- package/lib/routes/gq/news.ts +1 -1
- package/lib/routes/grist/featured.ts +1 -1
- package/lib/routes/grist/index.ts +1 -1
- package/lib/routes/grist/series.ts +1 -1
- package/lib/routes/grist/topic.ts +1 -1
- package/lib/routes/guokr/channel.ts +1 -1
- package/lib/routes/guokr/scientific.ts +1 -1
- package/lib/routes/hackernews/index.ts +1 -1
- package/lib/routes/harvard/health/blog.ts +1 -1
- package/lib/routes/hbr/topic.ts +1 -1
- package/lib/routes/hedwig/namespace.ts +7 -0
- package/lib/routes/hedwig/posts.ts +60 -0
- package/lib/routes/hellobtc/information.ts +1 -1
- package/lib/routes/hellobtc/kepu.ts +1 -1
- package/lib/routes/hellobtc/news.ts +1 -1
- package/lib/routes/hellogithub/index.ts +1 -1
- package/lib/routes/hkepc/index.ts +1 -1
- package/lib/routes/hpoi/all.ts +1 -1
- package/lib/routes/hpoi/character.ts +1 -1
- package/lib/routes/hpoi/work.ts +1 -1
- package/lib/routes/huawei/developer/harmonyos/samplecode.ts +69 -0
- package/lib/routes/huawei/namespace.ts +7 -0
- package/lib/routes/hupu/templates/description.art +1 -1
- package/lib/routes/huxiu/brief-column.ts +1 -1
- package/lib/routes/huxiu/channel.ts +1 -1
- package/lib/routes/huxiu/club.ts +1 -1
- package/lib/routes/huxiu/collection.ts +1 -1
- package/lib/routes/huxiu/member.ts +1 -1
- package/lib/routes/huxiu/moment.ts +1 -1
- package/lib/routes/huxiu/search.ts +1 -1
- package/lib/routes/huxiu/tag.ts +1 -1
- package/lib/routes/hyperdash/namespace.ts +7 -0
- package/lib/routes/hyperdash/templates/description.art +34 -0
- package/lib/routes/hyperdash/top-traders.ts +84 -0
- package/lib/routes/hyperdash/utils.ts +49 -0
- package/lib/routes/idolypride/news.ts +1 -1
- package/lib/routes/ielts/index.ts +1 -1
- package/lib/routes/ifanr/category.ts +1 -1
- package/lib/routes/ifanr/digest.ts +1 -1
- package/lib/routes/ifanr/index.ts +1 -1
- package/lib/routes/imdb/chart.ts +1 -1
- package/lib/routes/infoq/presentations.ts +1 -1
- package/lib/routes/infoq/recommend.ts +1 -1
- package/lib/routes/infoq/topic.ts +17 -14
- package/lib/routes/informedainews/docs.ts +1 -1
- package/lib/routes/inoreader/index.ts +1 -1
- package/lib/routes/inoreader/rss.ts +1 -1
- package/lib/routes/instagram/web-api/index.ts +17 -13
- package/lib/routes/instagram/web-api/utils.ts +46 -63
- package/lib/routes/javbus/index.ts +1 -1
- package/lib/routes/jianshu/collection.ts +1 -1
- package/lib/routes/jianshu/home.ts +1 -1
- package/lib/routes/jianshu/user.ts +1 -1
- package/lib/routes/jike/topic.ts +1 -1
- package/lib/routes/jike/user.ts +1 -1
- package/lib/routes/jin10/index.ts +1 -1
- package/lib/routes/jin10/topic.ts +1 -1
- package/lib/routes/jinse/lives.ts +1 -1
- package/lib/routes/jinse/timeline.ts +1 -1
- package/lib/routes/jiuyangongshe/community.ts +1 -1
- package/lib/routes/jjwxc/book.ts +1 -1
- package/lib/routes/keep/user.ts +1 -1
- package/lib/routes/kemono/const.ts +9 -0
- package/lib/routes/kemono/index.ts +282 -141
- package/lib/routes/kemono/types.ts +31 -0
- package/lib/routes/konachan/post.ts +27 -19
- package/lib/routes/kurogames/wutheringwaves/constants.ts +1 -1
- package/lib/routes/kurogames/wutheringwaves/news.ts +4 -1
- package/lib/routes/laohu8/personal.ts +1 -1
- package/lib/routes/lemmy/index.ts +1 -1
- package/lib/routes/lenovo/drive.ts +65 -0
- package/lib/routes/lenovo/namespace.ts +7 -0
- package/lib/routes/lenovo/templates/drive.art +9 -0
- package/lib/routes/line/publisher.ts +1 -1
- package/lib/routes/line/today.ts +1 -1
- package/lib/routes/lineageos/changes.ts +79 -0
- package/lib/routes/lineageos/namespace.ts +9 -0
- package/lib/routes/linkedin/cn/renderer.ts +1 -1
- package/lib/routes/linkedin/jobs.ts +1 -1
- package/lib/routes/liquipedia/cs-matches.ts +42 -14
- package/lib/routes/liveuamap/index.ts +1 -1
- package/lib/routes/lofter/collection.ts +1 -1
- package/lib/routes/lofter/tag.ts +1 -1
- package/lib/routes/lofter/user.ts +1 -1
- package/lib/routes/macfilos/blog.ts +1 -1
- package/lib/routes/magnumphotos/magazine.ts +1 -1
- package/lib/routes/makerworld/contest.ts +51 -0
- package/lib/routes/makerworld/namespace.ts +7 -0
- package/lib/routes/makerworld/trending.ts +45 -0
- package/lib/routes/makerworld/user-upload.ts +54 -0
- package/lib/routes/makerworld/utils.ts +18 -0
- package/lib/routes/mangadex/_access.ts +111 -0
- package/lib/routes/mangadex/_constants.ts +75 -0
- package/lib/routes/mangadex/_feed.ts +184 -0
- package/lib/routes/mangadex/_profile.ts +47 -0
- package/lib/routes/mangadex/_utils.ts +49 -0
- package/lib/routes/mangadex/index.ts +16 -67
- package/lib/routes/mangadex/mdlist/feed.ts +156 -0
- package/lib/routes/mangadex/namespace.ts +2 -0
- package/lib/routes/mangadex/user/feed.ts +126 -0
- package/lib/routes/mangadex/user/follows.ts +149 -0
- package/lib/routes/mastodon/account-id.ts +1 -1
- package/lib/routes/mastodon/acct.ts +1 -1
- package/lib/routes/mastodon/tag.ts +48 -0
- package/lib/routes/mastodon/timeline-local.ts +1 -1
- package/lib/routes/mastodon/timeline-remote.ts +1 -1
- package/lib/routes/mathpix/blog.ts +155 -0
- package/lib/routes/mathpix/namespace.ts +9 -0
- package/lib/routes/mathpix/templates/description.art +21 -0
- package/lib/routes/matters/namespace.ts +1 -1
- package/lib/routes/mckinsey/cn/index.ts +1 -1
- package/lib/routes/medsci/index.ts +1 -1
- package/lib/routes/meta/ai-blog.ts +121 -0
- package/lib/routes/meta/namespace.ts +6 -0
- package/lib/routes/metacritic/index.ts +2 -2
- package/lib/routes/mihoyo/ys/news.ts +19 -73
- package/lib/routes/mirror/index.ts +1 -1
- package/lib/routes/missav/new.ts +27 -9
- package/lib/routes/misskey/featured-notes.ts +1 -1
- package/lib/routes/misskey/user-timeline.ts +1 -1
- package/lib/routes/mittrchina/index.ts +1 -1
- package/lib/routes/mixcloud/config.ts +129 -0
- package/lib/routes/mixcloud/index.ts +163 -107
- package/lib/routes/mixcloud/user-playlist.ts +31 -0
- package/lib/routes/mixi2/community.ts +72 -0
- package/lib/routes/mixi2/discovery.ts +52 -0
- package/lib/routes/mixi2/home.ts +51 -0
- package/lib/routes/mixi2/namespace.ts +8 -0
- package/lib/routes/mixi2/user.ts +77 -0
- package/lib/routes/mixi2/utils.ts +56 -0
- package/lib/routes/mygopen/index.ts +1 -1
- package/lib/routes/nasa/apod.ts +1 -1
- package/lib/routes/nautil/topics.ts +1 -1
- package/lib/routes/newyorker/news.ts +1 -1
- package/lib/routes/nga/forum.ts +1 -1
- package/lib/routes/nhk/news.ts +1 -1
- package/lib/routes/nifd/research.ts +16 -0
- package/lib/routes/njust/cs.ts +58 -0
- package/lib/routes/njust/utils.ts +1 -1
- package/lib/routes/notefolio/search.ts +1 -1
- package/lib/routes/now/news.ts +93 -33
- package/lib/routes/nuaa/utils/pypasswaf.ts +1 -1
- package/lib/routes/nytimes/book.ts +1 -1
- package/lib/routes/nytimes/daily-briefing-chinese.ts +1 -1
- package/lib/routes/nytimes/index.ts +1 -1
- package/lib/routes/nytimes/rss.ts +1 -1
- package/lib/routes/odaily/activity.ts +1 -1
- package/lib/routes/odaily/newsflash.ts +1 -1
- package/lib/routes/odaily/post.ts +1 -1
- package/lib/routes/odaily/search-news.ts +1 -1
- package/lib/routes/odaily/user.ts +1 -1
- package/lib/routes/panewslab/author.ts +1 -1
- package/lib/routes/panewslab/news.ts +1 -1
- package/lib/routes/panewslab/profundity.ts +1 -1
- package/lib/routes/panewslab/topic.ts +1 -1
- package/lib/routes/paulgraham/article.ts +2 -2
- package/lib/routes/pconline/focus.ts +1 -1
- package/lib/routes/phoronix/index.ts +1 -1
- package/lib/routes/picnob/user.ts +64 -146
- package/lib/routes/picnob/utils.ts +14 -12
- package/lib/routes/picuki/namespace.ts +1 -7
- package/lib/routes/picuki/profile.ts +111 -171
- package/lib/routes/picuki/utils.ts +5 -10
- package/lib/routes/pingwest/status.ts +1 -1
- package/lib/routes/pingwest/tag.ts +1 -1
- package/lib/routes/pingwest/user.ts +1 -1
- package/lib/routes/pixabay/search.ts +1 -1
- package/lib/routes/pixiv/ranking.ts +1 -1
- package/lib/routes/pixiv/search.ts +1 -1
- package/lib/routes/pixiv/user.ts +1 -1
- package/lib/routes/pixivision/index.ts +1 -1
- package/lib/routes/plurk/anonymous.ts +1 -1
- package/lib/routes/plurk/hotlinks.ts +1 -1
- package/lib/routes/plurk/news.ts +1 -1
- package/lib/routes/plurk/search.ts +1 -1
- package/lib/routes/plurk/top.ts +1 -1
- package/lib/routes/plurk/topic.ts +1 -1
- package/lib/routes/plurk/user.ts +1 -1
- package/lib/routes/podwise/collections.ts +1 -1
- package/lib/routes/pornhub/category.ts +1 -1
- package/lib/routes/pornhub/model.ts +1 -1
- package/lib/routes/pornhub/pornstar.ts +1 -1
- package/lib/routes/pornhub/search.ts +1 -1
- package/lib/routes/ps/monthly-games.ts +1 -1
- package/lib/routes/psyche/topic.ts +1 -1
- package/lib/routes/python/namespace.ts +9 -0
- package/lib/routes/python/release.ts +120 -0
- package/lib/routes/qbitai/category.ts +1 -1
- package/lib/routes/qbitai/tag.ts +1 -1
- package/lib/routes/qidian/chapter.ts +1 -1
- package/lib/routes/questmobile/report.ts +1 -1
- package/lib/routes/radio/album.ts +40 -49
- package/lib/routes/radio/templates/description.art +2 -2
- package/lib/routes/readhub/daily.ts +1 -1
- package/lib/routes/readhub/index.ts +1 -1
- package/lib/routes/rebase/geekdaily.ts +1 -1
- package/lib/routes/reuters/common.ts +1 -1
- package/lib/routes/reuters/investigates.ts +1 -1
- package/lib/routes/rsshub/routes.ts +1 -1
- package/lib/routes/samrdprc/namespace.ts +7 -0
- package/lib/routes/samrdprc/news.ts +79 -0
- package/lib/routes/sankei/namespace.ts +7 -0
- package/lib/routes/sankei/news.ts +68 -0
- package/lib/routes/sankei/topics.ts +71 -0
- package/lib/routes/scoop/apps.ts +188 -0
- package/lib/routes/scoop/namespace.ts +9 -0
- package/lib/routes/scoop/templates/description.art +56 -0
- package/lib/routes/sehuatang/index.ts +27 -32
- package/lib/routes/seu/cyber/index.ts +78 -0
- package/lib/routes/simpleinfo/index.ts +1 -1
- package/lib/routes/sjtu/seiee/icisee.ts +67 -0
- package/lib/routes/slowmist/slowmist.ts +1 -1
- package/lib/routes/smartlink/index.ts +84 -0
- package/lib/routes/smartlink/namespace.ts +7 -0
- package/lib/routes/smzdm/article.ts +19 -3
- package/lib/routes/smzdm/baoliao.ts +19 -3
- package/lib/routes/smzdm/haowen-fenlei.ts +19 -3
- package/lib/routes/smzdm/haowen.ts +19 -3
- package/lib/routes/smzdm/keyword.ts +15 -2
- package/lib/routes/smzdm/product.ts +19 -3
- package/lib/routes/smzdm/ranking.ts +172 -156
- package/lib/routes/smzdm/utils.ts +7 -0
- package/lib/routes/sohu/mp.ts +1 -1
- package/lib/routes/solidot/main.ts +1 -1
- package/lib/routes/spotify/artist.ts +1 -1
- package/lib/routes/spotify/playlist.ts +1 -1
- package/lib/routes/spotify/show.ts +1 -1
- package/lib/routes/sspai/activity.ts +1 -1
- package/lib/routes/sspai/author.ts +1 -1
- package/lib/routes/sspai/bookmarks.ts +1 -1
- package/lib/routes/sspai/column.ts +1 -1
- package/lib/routes/sspai/index.ts +1 -1
- package/lib/routes/sspai/matrix.ts +1 -1
- package/lib/routes/sspai/series-update.ts +1 -1
- package/lib/routes/sspai/series.ts +1 -1
- package/lib/routes/sspai/shortcuts-gallery.ts +1 -1
- package/lib/routes/sspai/tag.ts +1 -1
- package/lib/routes/sspai/topic.ts +1 -1
- package/lib/routes/sspai/topics.ts +1 -1
- package/lib/routes/startuplatte/index.ts +1 -1
- package/lib/routes/steam/news.ts +281 -0
- package/lib/routes/stheadline/std/realtime.ts +24 -16
- package/lib/routes/stockedge/daily-news.ts +1 -1
- package/lib/routes/storm/channel.ts +80 -0
- package/lib/routes/tailwindcss/blog.ts +26 -0
- package/lib/routes/tailwindcss/constants.ts +2 -0
- package/lib/routes/tailwindcss/namespace.ts +7 -0
- package/lib/routes/tailwindcss/utils.ts +68 -0
- package/lib/routes/techflowpost/express.ts +1 -1
- package/lib/routes/techflowpost/index.ts +1 -1
- package/lib/routes/telegram/blog.ts +1 -1
- package/lib/routes/telegram/channel.ts +1 -1
- package/lib/routes/test/api-index.ts +13 -0
- package/lib/routes/theblockbeats/index.ts +3 -3
- package/lib/routes/theinitium/app.ts +1 -1
- package/lib/routes/theinitium/author.ts +1 -1
- package/lib/routes/theinitium/channel.ts +1 -1
- package/lib/routes/theinitium/tags.ts +1 -1
- package/lib/routes/themoviedb/seasons.ts +1 -1
- package/lib/routes/thepaper/channel.ts +1 -1
- package/lib/routes/thepaper/factpaper.ts +1 -1
- package/lib/routes/thepaper/featured.ts +1 -1
- package/lib/routes/thepaper/list.ts +1 -1
- package/lib/routes/thepaper/sidebar.ts +1 -1
- package/lib/routes/thepaper/user.ts +1 -1
- package/lib/routes/thepaper/utils.ts +8 -3
- package/lib/routes/thepetcity/index.ts +1 -1
- package/lib/routes/theverge/index.ts +1 -1
- package/lib/routes/threads/index.ts +1 -1
- package/lib/routes/thzt/index.ts +72 -0
- package/lib/routes/thzt/namespace.ts +8 -0
- package/lib/routes/timednews/news.ts +1 -1
- package/lib/routes/tingtingfm/program.ts +1 -1
- package/lib/routes/tju/yzb/index.ts +2 -2
- package/lib/routes/tophub/index.ts +1 -1
- package/lib/routes/tophub/list.ts +1 -1
- package/lib/routes/tver/namespace.ts +7 -0
- package/lib/routes/tver/series.ts +98 -0
- package/lib/routes/twitch/live.ts +1 -1
- package/lib/routes/twitch/video.ts +1 -1
- package/lib/routes/twitter/api/web-api/login.ts +1 -3
- package/lib/routes/twitter/api/web-api/utils.ts +24 -2
- package/lib/routes/twitter/keyword.ts +1 -1
- package/lib/routes/twitter/list.ts +1 -1
- package/lib/routes/twitter/media.ts +1 -1
- package/lib/routes/twitter/namespace.ts +1 -0
- package/lib/routes/twitter/user.ts +1 -1
- package/lib/routes/twitter/utils.ts +24 -16
- package/lib/routes/twreporter/category.ts +1 -1
- package/lib/routes/twreporter/newest.ts +1 -1
- package/lib/routes/udn/breaking-news.ts +1 -1
- package/lib/routes/uestc/auto.ts +1 -1
- package/lib/routes/uestc/cqe.ts +1 -1
- package/lib/routes/uestc/scse.ts +1 -1
- package/lib/routes/uestc/sice.ts +1 -1
- package/lib/routes/uestc/sise.ts +1 -1
- package/lib/routes/unusualwhales/news.ts +10 -8
- package/lib/routes/utgd/category.ts +1 -1
- package/lib/routes/utgd/timeline.ts +1 -1
- package/lib/routes/utgd/topic.ts +1 -1
- package/lib/routes/v2ex/tab.ts +1 -1
- package/lib/routes/v2ex/topics.ts +1 -1
- package/lib/routes/vertikal/latest.ts +1 -1
- package/lib/routes/vimeo/category.ts +1 -1
- package/lib/routes/vimeo/usr-videos.ts +1 -1
- package/lib/routes/visualstudio/code-blog.ts +67 -0
- package/lib/routes/visualstudio/namespace.ts +7 -0
- package/lib/routes/vocus/publication.ts +1 -1
- package/lib/routes/vocus/user.ts +1 -1
- package/lib/routes/voronoiapp/common.ts +1 -1
- package/lib/routes/warhammer-community/namespace.ts +7 -0
- package/lib/routes/warhammer-community/news.ts +73 -0
- package/lib/routes/warp/blog.ts +77 -0
- package/lib/routes/warp/namespace.ts +7 -0
- package/lib/routes/weibo/keyword.ts +1 -1
- package/lib/routes/weibo/search/hot.ts +1 -1
- package/lib/routes/weibo/user.ts +1 -1
- package/lib/routes/windsurf/blog.ts +118 -0
- package/lib/routes/windsurf/changelog.ts +100 -0
- package/lib/routes/windsurf/namespace.ts +9 -0
- package/lib/routes/windsurf/templates/description.art +21 -0
- package/lib/routes/woshipm/popular.ts +3 -2
- package/lib/routes/xiaohongshu/check-cookie.ts +16 -0
- package/lib/routes/xiaohongshu/user.ts +3 -3
- package/lib/routes/xiaohongshu/util.ts +24 -12
- package/lib/routes/xiaoyuzhou/podcast.ts +18 -5
- package/lib/routes/xjtu/ee-jzxx.ts +110 -0
- package/lib/routes/xsijishe/rank.ts +2 -2
- package/lib/routes/xueqiu/cookies.ts +1 -1
- package/lib/routes/xueqiu/user.ts +115 -52
- package/lib/routes/yahoo/news/index.ts +1 -1
- package/lib/routes/yahoo/news/listid.ts +1 -1
- package/lib/routes/yahoo/news/provider-helper.ts +1 -1
- package/lib/routes/yahoo/news/provider.ts +1 -1
- package/lib/routes/yande/post.ts +1 -1
- package/lib/routes/yilinzazhi/index.ts +1 -1
- package/lib/routes/yilinzazhi/latest.ts +1 -1
- package/lib/routes/youtube/api/google.ts +216 -0
- package/lib/routes/youtube/api/youtubei.ts +98 -0
- package/lib/routes/youtube/channel.ts +10 -35
- package/lib/routes/youtube/community.ts +5 -3
- package/lib/routes/youtube/playlist.ts +11 -30
- package/lib/routes/youtube/user.ts +12 -92
- package/lib/routes/youtube/utils.ts +27 -52
- package/lib/routes/youzhiyouxing/materials.ts +1 -1
- package/lib/routes/yuanliao/index.ts +218 -0
- package/lib/routes/yuanliao/namespace.ts +9 -0
- package/lib/routes/yyets/article.ts +1 -1
- package/lib/routes/yyets/today.ts +1 -1
- package/lib/routes/zaimanhua/comic.ts +88 -0
- package/lib/routes/zaimanhua/template/comic.art +3 -0
- package/lib/routes/zaimanhua/update.ts +42 -10
- package/lib/routes/zcool/top.ts +1 -1
- package/lib/routes/zcool/user.ts +1 -1
- package/lib/routes/zed/blog.ts +75 -0
- package/lib/routes/zed/namespace.ts +7 -0
- package/lib/routes/zhihu/activities.ts +1 -1
- package/lib/routes/zhihu/all-collections.ts +10 -1
- package/lib/routes/zhihu/check-cookie.ts +31 -0
- package/lib/routes/zhihu/collection.ts +9 -1
- package/lib/routes/zhihu/execlib/x-zse-96-v3.ts +5 -5
- package/lib/routes/zhihu/hot.ts +12 -79
- package/lib/routes/zhihu/topic.ts +11 -5
- package/lib/routes/zhihu/zhuanlan.ts +7 -2
- package/lib/routes/zhitongcaijing/index.ts +1 -1
- package/lib/routes/zongheng/detail.ts +77 -0
- package/lib/routes/zongheng/namespace.ts +7 -0
- package/lib/types.ts +48 -3
- package/lib/utils/cache/index.ts +2 -2
- package/lib/utils/helpers.test.ts +8 -1
- package/lib/utils/helpers.ts +19 -0
- package/lib/utils/proxy/index.ts +102 -18
- package/lib/utils/proxy/multi-proxy.ts +139 -0
- package/lib/utils/proxy/unify-proxy.ts +3 -1
- package/lib/utils/puppeteer-utils.test.ts +1 -1
- package/lib/utils/puppeteer.test.ts +136 -27
- package/lib/utils/puppeteer.ts +152 -28
- package/lib/utils/readable-social.test.ts +65 -0
- package/lib/utils/readable-social.ts +15 -1
- package/lib/utils/request-rewriter/fetch.ts +42 -4
- package/package.json +54 -56
- package/lib/routes/go/niid/idwr-dl.ts +0 -104
- package/lib/routes/google/templates/description.art +0 -6
- package/lib/routes/mihoyo/templates/ys.art +0 -4
- package/lib/routes/mixcloud/queries.ts +0 -2274
- package/lib/routes/picnob/templates/desc.art +0 -20
- package/lib/routes-deprecated/blogs/hedwig.js +0 -42
- package/lib/routes-deprecated/chiphell/forum.js +0 -67
package/lib/config.ts
CHANGED
|
@@ -37,6 +37,7 @@ export type Config = {
|
|
|
37
37
|
};
|
|
38
38
|
// proxy
|
|
39
39
|
proxyUri?: string;
|
|
40
|
+
proxyUris?: string[];
|
|
40
41
|
proxy: {
|
|
41
42
|
protocol?: string;
|
|
42
43
|
host?: string;
|
|
@@ -44,6 +45,8 @@ export type Config = {
|
|
|
44
45
|
auth?: string;
|
|
45
46
|
url_regex: string;
|
|
46
47
|
strategy: 'on_retry' | 'all';
|
|
48
|
+
failoverTimeout?: number;
|
|
49
|
+
healthCheckInterval?: number;
|
|
47
50
|
};
|
|
48
51
|
pacUri?: string;
|
|
49
52
|
pacScript?: string;
|
|
@@ -226,6 +229,13 @@ export type Config = {
|
|
|
226
229
|
password?: string;
|
|
227
230
|
refreshToken?: string;
|
|
228
231
|
};
|
|
232
|
+
mangadex: {
|
|
233
|
+
username?: string;
|
|
234
|
+
password?: string;
|
|
235
|
+
clientId?: string;
|
|
236
|
+
clientSecret?: string;
|
|
237
|
+
refreshToken?: string;
|
|
238
|
+
};
|
|
229
239
|
manhuagui: {
|
|
230
240
|
cookie?: string;
|
|
231
241
|
};
|
|
@@ -248,6 +258,10 @@ export type Config = {
|
|
|
248
258
|
misskey: {
|
|
249
259
|
accessToken?: string;
|
|
250
260
|
};
|
|
261
|
+
mixi2: {
|
|
262
|
+
authToken?: string;
|
|
263
|
+
authKey?: string;
|
|
264
|
+
};
|
|
251
265
|
mox: {
|
|
252
266
|
cookie: string;
|
|
253
267
|
};
|
|
@@ -401,6 +415,9 @@ export type Config = {
|
|
|
401
415
|
zsxq: {
|
|
402
416
|
accessToken?: string;
|
|
403
417
|
};
|
|
418
|
+
smzdm: {
|
|
419
|
+
cookie?: string;
|
|
420
|
+
};
|
|
404
421
|
};
|
|
405
422
|
|
|
406
423
|
const value: Config | Record<string, any> = {};
|
|
@@ -446,7 +463,7 @@ const calculateValue = () => {
|
|
|
446
463
|
const _value = {
|
|
447
464
|
// app config
|
|
448
465
|
disallowRobot: toBoolean(envs.DISALLOW_ROBOT, false),
|
|
449
|
-
enableCluster: envs.ENABLE_CLUSTER,
|
|
466
|
+
enableCluster: toBoolean(envs.ENABLE_CLUSTER, false),
|
|
450
467
|
isPackage: !!envs.IS_PACKAGE,
|
|
451
468
|
nodeName: envs.NODE_NAME,
|
|
452
469
|
puppeteerWSEndpoint: envs.PUPPETEER_WS_ENDPOINT,
|
|
@@ -477,6 +494,11 @@ const calculateValue = () => {
|
|
|
477
494
|
},
|
|
478
495
|
// proxy
|
|
479
496
|
proxyUri: envs.PROXY_URI,
|
|
497
|
+
proxyUris: envs.PROXY_URIS
|
|
498
|
+
? envs.PROXY_URIS.split(',')
|
|
499
|
+
.map((uri) => uri.trim())
|
|
500
|
+
.filter(Boolean)
|
|
501
|
+
: undefined,
|
|
480
502
|
proxy: {
|
|
481
503
|
protocol: envs.PROXY_PROTOCOL,
|
|
482
504
|
host: envs.PROXY_HOST,
|
|
@@ -484,6 +506,8 @@ const calculateValue = () => {
|
|
|
484
506
|
auth: envs.PROXY_AUTH,
|
|
485
507
|
url_regex: envs.PROXY_URL_REGEX || '.*',
|
|
486
508
|
strategy: envs.PROXY_STRATEGY || 'all', // all / on_retry
|
|
509
|
+
failoverTimeout: toInt(envs.PROXY_FAILOVER_TIMEOUT, 5000),
|
|
510
|
+
healthCheckInterval: toInt(envs.PROXY_HEALTH_CHECK_INTERVAL, 60000),
|
|
487
511
|
},
|
|
488
512
|
pacUri: envs.PAC_URI,
|
|
489
513
|
pacScript: envs.PAC_SCRIPT,
|
|
@@ -667,6 +691,13 @@ const calculateValue = () => {
|
|
|
667
691
|
password: envs.MALAYSIAKINI_PASSWORD,
|
|
668
692
|
refreshToken: envs.MALAYSIAKINI_REFRESHTOKEN,
|
|
669
693
|
},
|
|
694
|
+
mangadex: {
|
|
695
|
+
username: envs.MANGADEX_USERNAME, // required when refresh-token is not set
|
|
696
|
+
password: envs.MANGADEX_PASSWORD, // required when refresh-token is not set
|
|
697
|
+
clientId: envs.MANGADEX_CLIENT_ID,
|
|
698
|
+
clientSecret: envs.MANGADEX_CLIENT_SECRET,
|
|
699
|
+
refreshToken: envs.MANGADEX_REFRESH_TOKEN,
|
|
700
|
+
},
|
|
670
701
|
manhuagui: {
|
|
671
702
|
cookie: envs.MHGUI_COOKIE,
|
|
672
703
|
},
|
|
@@ -689,6 +720,10 @@ const calculateValue = () => {
|
|
|
689
720
|
misskey: {
|
|
690
721
|
accessToken: envs.MISSKEY_ACCESS_TOKEN,
|
|
691
722
|
},
|
|
723
|
+
mixi2: {
|
|
724
|
+
authToken: envs.MIXI2_AUTH_TOKEN,
|
|
725
|
+
authKey: envs.MIXI2_AUTH_KEY,
|
|
726
|
+
},
|
|
692
727
|
mox: {
|
|
693
728
|
cookie: envs.MOX_COOKIE,
|
|
694
729
|
},
|
|
@@ -842,6 +877,9 @@ const calculateValue = () => {
|
|
|
842
877
|
zsxq: {
|
|
843
878
|
accessToken: envs.ZSXQ_ACCESS_TOKEN,
|
|
844
879
|
},
|
|
880
|
+
smzdm: {
|
|
881
|
+
cookie: envs.SMZDM_COOKIE,
|
|
882
|
+
},
|
|
845
883
|
};
|
|
846
884
|
|
|
847
885
|
for (const name in _value) {
|
package/lib/errors/index.tsx
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type NotFoundHandler, type ErrorHandler } from 'hono';
|
|
2
|
+
import { routePath } from 'hono/route';
|
|
2
3
|
import { getDebugInfo, setDebugInfo } from '@/utils/debug-info';
|
|
3
4
|
import { config } from '@/config';
|
|
4
5
|
import * as Sentry from '@sentry/node';
|
|
@@ -11,7 +12,7 @@ import { requestMetric } from '@/utils/otel';
|
|
|
11
12
|
|
|
12
13
|
export const errorHandler: ErrorHandler = (error, ctx) => {
|
|
13
14
|
const requestPath = ctx.req.path;
|
|
14
|
-
const matchedRoute = ctx
|
|
15
|
+
const matchedRoute = routePath(ctx);
|
|
15
16
|
const hasMatchedRoute = matchedRoute !== '/*';
|
|
16
17
|
|
|
17
18
|
const debug = getDebugInfo();
|
package/lib/index.ts
CHANGED
|
@@ -3,26 +3,59 @@ import logger from '@/utils/logger';
|
|
|
3
3
|
import { getLocalhostAddress } from '@/utils/common-utils';
|
|
4
4
|
import { config } from '@/config';
|
|
5
5
|
import app from '@/app';
|
|
6
|
+
import os from 'node:os';
|
|
7
|
+
import cluster from 'node:cluster';
|
|
8
|
+
import process from 'node:process';
|
|
6
9
|
|
|
7
10
|
const port = config.connect.port;
|
|
8
11
|
const hostIPList = getLocalhostAddress();
|
|
9
12
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
let server;
|
|
14
|
+
if (config.enableCluster) {
|
|
15
|
+
if (cluster.isPrimary) {
|
|
16
|
+
logger.info(`🎉 RSSHub is running on port ${port}! Cheers!`);
|
|
17
|
+
logger.info(`🔗 Local: 👉 http://localhost:${port}`);
|
|
18
|
+
if (config.listenInaddrAny) {
|
|
19
|
+
for (const ip of hostIPList) {
|
|
20
|
+
logger.info(`🔗 Network: 👉 http://${ip}:${port}`);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
logger.info(`Primary ${process.pid} is running`);
|
|
25
|
+
|
|
26
|
+
const numCPUs = os.availableParallelism();
|
|
27
|
+
|
|
28
|
+
for (let i = 0; i < numCPUs; i++) {
|
|
29
|
+
cluster.fork();
|
|
30
|
+
}
|
|
31
|
+
} else {
|
|
32
|
+
logger.info(`Worker ${process.pid} is running`);
|
|
33
|
+
serve({
|
|
34
|
+
fetch: app.fetch,
|
|
35
|
+
hostname: config.listenInaddrAny ? '::' : '127.0.0.1',
|
|
36
|
+
port,
|
|
37
|
+
serverOptions: {
|
|
38
|
+
maxHeaderSize: 1024 * 32,
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
} else {
|
|
43
|
+
logger.info(`🎉 RSSHub is running on port ${port}! Cheers!`);
|
|
44
|
+
logger.info(`🔗 Local: 👉 http://localhost:${port}`);
|
|
45
|
+
if (config.listenInaddrAny) {
|
|
46
|
+
for (const ip of hostIPList) {
|
|
47
|
+
logger.info(`🔗 Network: 👉 http://${ip}:${port}`);
|
|
48
|
+
}
|
|
16
49
|
}
|
|
17
|
-
}
|
|
18
50
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
51
|
+
server = serve({
|
|
52
|
+
fetch: app.fetch,
|
|
53
|
+
hostname: config.listenInaddrAny ? '::' : '127.0.0.1',
|
|
54
|
+
port,
|
|
55
|
+
serverOptions: {
|
|
56
|
+
maxHeaderSize: 1024 * 32,
|
|
57
|
+
},
|
|
58
|
+
});
|
|
59
|
+
}
|
|
27
60
|
|
|
28
61
|
export default server;
|
package/lib/middleware/debug.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MiddlewareHandler } from 'hono';
|
|
2
|
+
import { routePath } from 'hono/route';
|
|
2
3
|
import { getDebugInfo, setDebugInfo } from '@/utils/debug-info';
|
|
3
4
|
|
|
4
5
|
const middleware: MiddlewareHandler = async (ctx, next) => {
|
|
@@ -17,11 +18,12 @@ const middleware: MiddlewareHandler = async (ctx, next) => {
|
|
|
17
18
|
|
|
18
19
|
{
|
|
19
20
|
const debug = getDebugInfo();
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
const rPath = routePath(ctx);
|
|
22
|
+
const hasMatchedRoute = rPath !== '/*';
|
|
23
|
+
if (!debug.routes[rPath] && hasMatchedRoute) {
|
|
24
|
+
debug.routes[rPath] = 0;
|
|
23
25
|
}
|
|
24
|
-
hasMatchedRoute && debug.routes[
|
|
26
|
+
hasMatchedRoute && debug.routes[rPath]++;
|
|
25
27
|
|
|
26
28
|
if (ctx.res.headers.get('RSSHub-Cache-Status')) {
|
|
27
29
|
debug.hitCache++;
|
|
@@ -23,6 +23,7 @@ describe('header', () => {
|
|
|
23
23
|
expect(response.headers.get('rsshub-node')).toBe('mock');
|
|
24
24
|
expect(response.headers.get('etag')).not.toBe(undefined);
|
|
25
25
|
etag = response.headers.get('etag');
|
|
26
|
+
expect(response.headers.get('x-rsshub-route')).toBe('/test/:id/:params?');
|
|
26
27
|
});
|
|
27
28
|
|
|
28
29
|
it(`etag`, async () => {
|
package/lib/middleware/header.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { MiddlewareHandler } from 'hono';
|
|
2
|
+
import { routePath } from 'hono/route';
|
|
2
3
|
import etagCalculate from 'etag';
|
|
3
4
|
import { config } from '@/config';
|
|
4
5
|
import { Data } from '@/types';
|
|
@@ -24,6 +25,11 @@ const middleware: MiddlewareHandler = async (ctx, next) => {
|
|
|
24
25
|
ctx.header('Access-Control-Allow-Origin', config.allowOrigin || new URL(ctx.req.url).host);
|
|
25
26
|
|
|
26
27
|
await next();
|
|
28
|
+
const rPath = routePath(ctx);
|
|
29
|
+
|
|
30
|
+
if (rPath !== '/*') {
|
|
31
|
+
ctx.header('X-RSSHub-Route', rPath);
|
|
32
|
+
}
|
|
27
33
|
|
|
28
34
|
const data: Data = ctx.get('data');
|
|
29
35
|
if (!data || ctx.res.headers.get('ETag')) {
|
|
@@ -114,4 +114,12 @@ describe('template', () => {
|
|
|
114
114
|
expect(response.status).toBe(301);
|
|
115
115
|
expect(response.headers.get('location')).toBe('/test/1');
|
|
116
116
|
});
|
|
117
|
+
|
|
118
|
+
it(`api`, async () => {
|
|
119
|
+
const response = await app.request('/api/test');
|
|
120
|
+
expect(response.status).toBe(200);
|
|
121
|
+
expect(await response.json()).toEqual({
|
|
122
|
+
code: 0,
|
|
123
|
+
});
|
|
124
|
+
});
|
|
117
125
|
});
|
|
@@ -14,6 +14,11 @@ const middleware: MiddlewareHandler = async (ctx, next) => {
|
|
|
14
14
|
const ttl = (cacheModule.status.available && Math.trunc(config.cache.routeExpire / 60)) || 1;
|
|
15
15
|
await next();
|
|
16
16
|
|
|
17
|
+
const apiData = ctx.get('apiData');
|
|
18
|
+
if (apiData) {
|
|
19
|
+
return ctx.json(apiData);
|
|
20
|
+
}
|
|
21
|
+
|
|
17
22
|
const data: Data = ctx.get('data');
|
|
18
23
|
const outputType = ctx.req.query('format') || 'rss';
|
|
19
24
|
|
package/lib/registry.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import type { Namespace, Route } from '@/types';
|
|
1
|
+
import type { APIRoute, Namespace, Route } from '@/types';
|
|
2
2
|
import { directoryImport } from 'directory-import';
|
|
3
3
|
import { Hono, type Handler } from 'hono';
|
|
4
|
+
import { routePath } from 'hono/route';
|
|
4
5
|
import path from 'node:path';
|
|
5
6
|
import { serveStatic } from '@hono/node-server/serve-static';
|
|
6
7
|
import { config } from '@/config';
|
|
@@ -9,6 +10,7 @@ import index from '@/routes/index';
|
|
|
9
10
|
import healthz from '@/routes/healthz';
|
|
10
11
|
import robotstxt from '@/routes/robots.txt';
|
|
11
12
|
import metrics from '@/routes/metrics';
|
|
13
|
+
import logger from '@/utils/logger';
|
|
12
14
|
|
|
13
15
|
const __dirname = import.meta.dirname;
|
|
14
16
|
|
|
@@ -22,6 +24,12 @@ let namespaces: Record<
|
|
|
22
24
|
location: string;
|
|
23
25
|
}
|
|
24
26
|
>;
|
|
27
|
+
apiRoutes: Record<
|
|
28
|
+
string,
|
|
29
|
+
APIRoute & {
|
|
30
|
+
location: string;
|
|
31
|
+
}
|
|
32
|
+
>;
|
|
25
33
|
}
|
|
26
34
|
> = {};
|
|
27
35
|
|
|
@@ -48,6 +56,9 @@ if (Object.keys(modules).length) {
|
|
|
48
56
|
}
|
|
49
57
|
| {
|
|
50
58
|
namespace: Namespace;
|
|
59
|
+
}
|
|
60
|
+
| {
|
|
61
|
+
apiRoute: APIRoute;
|
|
51
62
|
};
|
|
52
63
|
const namespace = module.split(/[/\\]/)[1];
|
|
53
64
|
if ('namespace' in content) {
|
|
@@ -63,6 +74,7 @@ if (Object.keys(modules).length) {
|
|
|
63
74
|
namespaces[namespace] = {
|
|
64
75
|
name: namespace,
|
|
65
76
|
routes: {},
|
|
77
|
+
apiRoutes: {},
|
|
66
78
|
};
|
|
67
79
|
}
|
|
68
80
|
if (Array.isArray(content.route.path)) {
|
|
@@ -78,6 +90,27 @@ if (Object.keys(modules).length) {
|
|
|
78
90
|
location: module.split(/[/\\]/).slice(2).join('/'),
|
|
79
91
|
};
|
|
80
92
|
}
|
|
93
|
+
} else if ('apiRoute' in content) {
|
|
94
|
+
if (!namespaces[namespace]) {
|
|
95
|
+
namespaces[namespace] = {
|
|
96
|
+
name: namespace,
|
|
97
|
+
routes: {},
|
|
98
|
+
apiRoutes: {},
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
if (Array.isArray(content.apiRoute.path)) {
|
|
102
|
+
for (const path of content.apiRoute.path) {
|
|
103
|
+
namespaces[namespace].apiRoutes[path] = {
|
|
104
|
+
...content.apiRoute,
|
|
105
|
+
location: module.split(/[/\\]/).slice(2).join('/'),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
} else {
|
|
109
|
+
namespaces[namespace].apiRoutes[content.apiRoute.path] = {
|
|
110
|
+
...content.apiRoute,
|
|
111
|
+
location: module.split(/[/\\]/).slice(2).join('/'),
|
|
112
|
+
};
|
|
113
|
+
}
|
|
81
114
|
}
|
|
82
115
|
}
|
|
83
116
|
}
|
|
@@ -126,6 +159,7 @@ for (const namespace in namespaces) {
|
|
|
126
159
|
|
|
127
160
|
for (const [path, routeData] of sortedRoutes) {
|
|
128
161
|
const wrappedHandler: Handler = async (ctx) => {
|
|
162
|
+
logger.debug(`Matched route: ${routePath(ctx)}`);
|
|
129
163
|
if (!ctx.get('data')) {
|
|
130
164
|
if (typeof routeData.handler !== 'function') {
|
|
131
165
|
if (process.env.NODE_ENV === 'test') {
|
|
@@ -143,6 +177,42 @@ for (const namespace in namespaces) {
|
|
|
143
177
|
}
|
|
144
178
|
}
|
|
145
179
|
|
|
180
|
+
for (const namespace in namespaces) {
|
|
181
|
+
const subApp = app.basePath(`/api/${namespace}`);
|
|
182
|
+
|
|
183
|
+
const namespaceData = namespaces[namespace];
|
|
184
|
+
if (!namespaceData || !namespaceData.apiRoutes) {
|
|
185
|
+
continue;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
const sortedRoutes = Object.entries(namespaceData.apiRoutes) as [
|
|
189
|
+
string,
|
|
190
|
+
APIRoute & {
|
|
191
|
+
location: string;
|
|
192
|
+
module?: () => Promise<{ apiRoute: APIRoute }>;
|
|
193
|
+
},
|
|
194
|
+
][];
|
|
195
|
+
|
|
196
|
+
for (const [path, routeData] of sortedRoutes) {
|
|
197
|
+
const wrappedHandler: Handler = async (ctx) => {
|
|
198
|
+
if (!ctx.get('apiData')) {
|
|
199
|
+
if (typeof routeData.handler !== 'function') {
|
|
200
|
+
if (process.env.NODE_ENV === 'test') {
|
|
201
|
+
const { apiRoute } = await import(`./routes/${namespace}/${routeData.location}`);
|
|
202
|
+
routeData.handler = apiRoute.handler;
|
|
203
|
+
} else if (routeData.module) {
|
|
204
|
+
const { apiRoute } = await routeData.module();
|
|
205
|
+
routeData.handler = apiRoute.handler;
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
const data = await routeData.handler(ctx);
|
|
209
|
+
ctx.set('apiData', data);
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
subApp.get(path, wrappedHandler);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
|
|
146
216
|
app.get('/', index);
|
|
147
217
|
app.get('/healthz', healthz);
|
|
148
218
|
app.get('/robots.txt', robotstxt);
|
package/lib/router.js
CHANGED
|
@@ -1002,9 +1002,6 @@ router.get('/haohaozhu/discover/:keyword?', lazyloadRouteHandler('./routes/haoha
|
|
|
1002
1002
|
router.get('/magireco/announcements', lazyloadRouteHandler('./routes/magireco/announcements'));
|
|
1003
1003
|
router.get('/magireco/event_banner', lazyloadRouteHandler('./routes/magireco/event-banner'));
|
|
1004
1004
|
|
|
1005
|
-
// 我有一片芝麻地
|
|
1006
|
-
router.get('/blogs/hedwig/:type', lazyloadRouteHandler('./routes/blogs/hedwig'));
|
|
1007
|
-
|
|
1008
1005
|
// 拉勾
|
|
1009
1006
|
router.get('/lagou/jobs/:position/:city', lazyloadRouteHandler('./routes/lagou/jobs'));
|
|
1010
1007
|
|
|
@@ -1026,9 +1023,6 @@ router.get('/jnu/yw/:type?', lazyloadRouteHandler('./routes/universities/jnu/yw/
|
|
|
1026
1023
|
// moxingfans
|
|
1027
1024
|
router.get('/moxingfans', lazyloadRouteHandler('./routes/moxingfans'));
|
|
1028
1025
|
|
|
1029
|
-
// Chiphell
|
|
1030
|
-
router.get('/chiphell/forum/:forumId?', lazyloadRouteHandler('./routes/chiphell/forum'));
|
|
1031
|
-
|
|
1032
1026
|
// 考研帮调剂信息
|
|
1033
1027
|
router.get('/kaoyan', lazyloadRouteHandler('./routes/kaoyan/kaoyan'));
|
|
1034
1028
|
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { Route } from '@/types';
|
|
2
|
+
import { defaultDomain, getApiUrl, getRootUrl, processApiItems } from './utils';
|
|
3
|
+
import { art } from '@/utils/render';
|
|
4
|
+
import path from 'node:path';
|
|
2
5
|
import cache from '@/utils/cache';
|
|
3
|
-
import got from '@/utils/got';
|
|
4
|
-
import { load } from 'cheerio';
|
|
5
|
-
import { parseDate } from '@/utils/parse-date';
|
|
6
|
-
|
|
7
|
-
import { defaultDomain, getRootUrl } from './utils';
|
|
8
6
|
|
|
9
7
|
export const route: Route = {
|
|
10
8
|
path: '/album/:id',
|
|
@@ -37,71 +35,68 @@ async function handler(ctx) {
|
|
|
37
35
|
const id = ctx.req.param('id');
|
|
38
36
|
const { domain = defaultDomain } = ctx.req.query();
|
|
39
37
|
const rootUrl = getRootUrl(domain);
|
|
40
|
-
|
|
41
38
|
const currentUrl = `${rootUrl}/album/${id}`;
|
|
42
39
|
|
|
43
|
-
const
|
|
44
|
-
method: 'get',
|
|
45
|
-
url: currentUrl,
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
const $ = load(response.data);
|
|
40
|
+
const apiUrl = `${getApiUrl()}/album?id=${id}`;
|
|
49
41
|
|
|
50
|
-
const
|
|
51
|
-
.first()
|
|
52
|
-
.find('a')
|
|
53
|
-
.toArray()
|
|
54
|
-
.map((c) => $(c).text());
|
|
55
|
-
const author = $('span[data-type="author"]')
|
|
56
|
-
.first()
|
|
57
|
-
.find('a')
|
|
58
|
-
.toArray()
|
|
59
|
-
.map((a) => $(a).text())
|
|
60
|
-
.join(', ');
|
|
42
|
+
const apiResult = await processApiItems(apiUrl);
|
|
61
43
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
44
|
+
const category = apiResult.tags;
|
|
45
|
+
const author = apiResult.author.join(', ');
|
|
46
|
+
const description = apiResult.description;
|
|
47
|
+
const addTime = apiResult.addtime;
|
|
48
|
+
let results: any[] = [];
|
|
49
|
+
if (apiResult.series.length === 0) {
|
|
50
|
+
results.push({
|
|
51
|
+
title: apiResult.name,
|
|
52
|
+
link: `${rootUrl}/photo/${id}`,
|
|
53
|
+
guid: `${rootUrl}/photo/${id}`,
|
|
54
|
+
updated: new Date(addTime * 1000),
|
|
55
|
+
pubDate: new Date(addTime * 1000),
|
|
56
|
+
category,
|
|
57
|
+
author,
|
|
58
|
+
description: art(path.join(__dirname, 'templates/description.art'), {
|
|
59
|
+
introduction: description,
|
|
60
|
+
// 不取图片,因为专辑的图片会被分割排序,所以只取封面图
|
|
61
|
+
images: [`https://cdn-msp3.${domain}/media/albums/${id}_3x4.jpg`],
|
|
62
|
+
cover: `https://cdn-msp3.${domain}/media/albums/${id}_3x4.jpg`,
|
|
63
|
+
category,
|
|
64
|
+
}),
|
|
75
65
|
});
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
66
|
+
} else {
|
|
67
|
+
results = await Promise.all(
|
|
68
|
+
apiResult.series.map((item, index) =>
|
|
69
|
+
cache.tryGet(`18comic:album:${item.id}`, async () => {
|
|
70
|
+
const chapterApiUrl = `${getApiUrl()}/chapter?id=${item.id}`;
|
|
71
|
+
const chapterResult = await processApiItems(chapterApiUrl);
|
|
72
|
+
const result = {};
|
|
73
|
+
const chapterNum = index + 1;
|
|
74
|
+
result.title = `第${String(chapterNum)}話 ${item.name === '' ? `${String(chapterNum)}` : item.name}`;
|
|
75
|
+
result.link = `${rootUrl}/photo/${item.id}`;
|
|
76
|
+
result.guid = `${rootUrl}/photo/${item.id}`;
|
|
77
|
+
result.updated = new Date(chapterResult.addtime * 1000);
|
|
78
|
+
result.pubDate = addTime;
|
|
79
|
+
result.category = category;
|
|
80
|
+
result.author = author;
|
|
81
|
+
result.description = art(path.join(__dirname, 'templates/description.art'), {
|
|
82
|
+
introduction: description,
|
|
83
|
+
// 不取图片,因为专辑的图片会被分割排序,所以只取封面图
|
|
84
|
+
images: [`https://cdn-msp3.${domain}/media/albums/${item.id}_3x4.jpg`],
|
|
85
|
+
cover: `https://cdn-msp3.${domain}/media/albums/${item.id}_3x4.jpg`,
|
|
86
|
+
category,
|
|
87
|
+
});
|
|
88
|
+
return result;
|
|
89
|
+
})
|
|
90
|
+
)
|
|
91
|
+
);
|
|
92
|
+
results = results.reverse();
|
|
93
|
+
}
|
|
100
94
|
|
|
101
95
|
return {
|
|
102
|
-
title:
|
|
103
|
-
link: currentUrl,
|
|
104
|
-
item:
|
|
105
|
-
|
|
96
|
+
title: `${apiResult.name} - 禁漫天堂`,
|
|
97
|
+
link: currentUrl.replace(/\?$/, ''),
|
|
98
|
+
item: results,
|
|
99
|
+
allowEmpty: true,
|
|
100
|
+
description,
|
|
106
101
|
};
|
|
107
102
|
}
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import { Route } from '@/types';
|
|
2
|
-
import { defaultDomain, getRootUrl,
|
|
2
|
+
import { apiMapCategory, defaultDomain, getApiUrl, getRootUrl, processApiItems } from './utils';
|
|
3
|
+
import { parseDate } from '@/utils/parse-date';
|
|
4
|
+
import { art } from '@/utils/render';
|
|
5
|
+
import path from 'node:path';
|
|
6
|
+
import cache from '@/utils/cache';
|
|
3
7
|
|
|
4
8
|
export const route: Route = {
|
|
5
9
|
path: '/search/:option?/:category?/:keyword?/:time?/:order?',
|
|
@@ -40,11 +44,56 @@ async function handler(ctx) {
|
|
|
40
44
|
const category = ctx.req.param('category') ?? 'all';
|
|
41
45
|
const keyword = ctx.req.param('keyword') ?? '';
|
|
42
46
|
const time = ctx.req.param('time') ?? 'a';
|
|
43
|
-
const order = ctx.req.param('order') ?? 'mr';
|
|
44
47
|
const { domain = defaultDomain } = ctx.req.query();
|
|
45
48
|
const rootUrl = getRootUrl(domain);
|
|
46
|
-
|
|
49
|
+
let order = ctx.req.param('order') ?? 'mr';
|
|
47
50
|
const currentUrl = `${rootUrl}/search/${option}${category === 'all' ? '' : `/${category}`}${keyword ? `?search_query=${keyword}` : '?'}${time === 'a' ? '' : `&t=${time}`}${order === 'mr' ? '' : `&o=${order}`}`;
|
|
51
|
+
const limit = ctx.req.query('limit') ? Number.parseInt(ctx.req.query('limit')) : 20;
|
|
52
|
+
|
|
53
|
+
let apiUrl = getApiUrl();
|
|
54
|
+
order = time === 'a' ? order : `${order}_${time}`;
|
|
55
|
+
apiUrl = `${apiUrl}/search?search_query=${keyword}&o=${order}`;
|
|
56
|
+
let apiResult = await processApiItems(apiUrl);
|
|
57
|
+
let filteredItemsByCategory = apiResult.content;
|
|
58
|
+
// Filter items by category if not 'all'
|
|
59
|
+
if (category !== 'all') {
|
|
60
|
+
filteredItemsByCategory = apiResult.content.filter((item) => item.category.title === apiMapCategory(category));
|
|
61
|
+
}
|
|
62
|
+
filteredItemsByCategory = filteredItemsByCategory.slice(0, limit);
|
|
63
|
+
const results = await Promise.all(
|
|
64
|
+
filteredItemsByCategory.map((item) =>
|
|
65
|
+
cache.tryGet(`18comic:search:${item.id}`, async () => {
|
|
66
|
+
const result = {};
|
|
67
|
+
result.title = item.name;
|
|
68
|
+
result.link = `${rootUrl}/album/${item.id}`;
|
|
69
|
+
result.guid = `18comic:/album/${item.id}`;
|
|
70
|
+
result.updated = parseDate(item.update_at);
|
|
71
|
+
apiUrl = `${getApiUrl()}/album?id=${item.id}`;
|
|
72
|
+
apiResult = await processApiItems(apiUrl);
|
|
73
|
+
result.pubDate = new Date(apiResult.addtime * 1000);
|
|
74
|
+
result.category = apiResult.tags.map((tag) => tag);
|
|
75
|
+
result.author = apiResult.author.map((a) => a).join(', ');
|
|
76
|
+
result.description = art(path.join(__dirname, 'templates/description.art'), {
|
|
77
|
+
introduction: apiResult.description,
|
|
78
|
+
images: [
|
|
79
|
+
`https://cdn-msp3.${domain}/media/albums/${item.id}_3x4.jpg`,
|
|
80
|
+
// 取得的预览图片会被分割排序,所以先只取封面图
|
|
81
|
+
// `https://cdn-msp3.${domain}/media/photos/${item.id}/00001.webp`,
|
|
82
|
+
// `https://cdn-msp3.${domain}/media/photos/${item.id}/00002.webp`,
|
|
83
|
+
// `https://cdn-msp3.${domain}/media/photos/${item.id}/00003.webp`,
|
|
84
|
+
],
|
|
85
|
+
cover: `https://cdn-msp3.${domain}/media/albums/${item.id}_3x4.jpg`,
|
|
86
|
+
category: result.category,
|
|
87
|
+
});
|
|
88
|
+
return result;
|
|
89
|
+
})
|
|
90
|
+
)
|
|
91
|
+
);
|
|
48
92
|
|
|
49
|
-
return
|
|
93
|
+
return {
|
|
94
|
+
title: `Search Results For '${keyword}' - 禁漫天堂`,
|
|
95
|
+
link: currentUrl.replace(/\?$/, ''),
|
|
96
|
+
item: results,
|
|
97
|
+
allowEmpty: true,
|
|
98
|
+
};
|
|
50
99
|
}
|