Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into sd0ric4-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sd0ric4 committed Oct 5, 2024
2 parents 674d144 + f163b4e commit 6ed23af
Show file tree
Hide file tree
Showing 305 changed files with 14,465 additions and 2,649 deletions.
5 changes: 0 additions & 5 deletions .github/FUNDING.yml

This file was deleted.

2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ WORKDIR /app
ARG USE_CHINA_NPM_REGISTRY=0
RUN \
set -ex && \
corepack enable pnpm && \
if [ "$USE_CHINA_NPM_REGISTRY" = 1 ]; then \
echo 'use npm mirror' && \
npm config set registry https://registry.npmmirror.com && \
Expand All @@ -23,7 +24,6 @@ COPY ./package.json /app/
RUN \
set -ex && \
export PUPPETEER_SKIP_DOWNLOAD=true && \
corepack enable pnpm && \
pnpm install --frozen-lockfile && \
pnpm rb

Expand Down
61 changes: 13 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,29 +12,15 @@
[![Test coverage](https://img.shields.io/codecov/c/github/DIYgod/RSSHub.svg?style=flat-square&logo=codecov)](https://app.codecov.io/gh/DIYgod/RSSHub/branch/master)
[![Visitors](https://hits.seeyoufarm.com/api/count/incr/badge.svg?url=https%3A%2F%2Fgithub.com%2FDIYgod%2FRSSHub&count_bg=%23FF752E&title_bg=%23555555&icon=rss.svg&icon_color=%23FF752E&title=RSS+lovers&edge_flat=true)](https://github.com/DIYgod/RSSHub)

[![Telegram group](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.swo.moe%2Fstats%2Ftelegram%2Frsshub&query=count&color=2CA5E0&label=Telegram%20Group&logo=telegram&cacheSeconds=3600&style=flat-square)](https://t.me/rsshub) [![Telegram channel](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.swo.moe%2Fstats%2Ftelegram%2FawesomeRSSHub&query=count&color=2CA5E0&label=Telegram%20Channel&logo=telegram&cacheSeconds=3600&style=flat-square)](https://t.me/awesomeRSSHub) [![Twitter](https://img.shields.io/badge/any_text-Follow-blue?color=2CA5E0&label=Twitter&logo=twitter&cacheSeconds=3600&style=flat-square)](https://x.com/intent/follow?screen_name=_RSSHub)
[![Telegram group](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.swo.moe%2Fstats%2Ftelegram%2Frsshub&query=count&color=2CA5E0&label=Telegram%20Group&logo=telegram&cacheSeconds=3600&style=flat-square)](https://t.me/rsshub) [![Telegram channel](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fapi.swo.moe%2Fstats%2Ftelegram%2FawesomeRSSHub&query=count&color=2CA5E0&label=Telegram%20Channel&logo=telegram&cacheSeconds=3600&style=flat-square)](https://t.me/awesomeRSSHub) [![X (Twitter)](https://img.shields.io/badge/any_text-Follow-blue?color=2CA5E0&label=Twitter&logo=X&cacheSeconds=3600&style=flat-square)](https://x.com/intent/follow?screen_name=_RSSHub)

## Introduction

RSSHub is an open source, easy to use, and extensible RSS feed generator. It's capable of generating RSS feeds from pretty much everything.
RSSHub is the world's largest RSS network, consisting of over 5,000 global instances.

RSSHub delivers millions of contents aggregated from all kinds of sources, our vibrant open source community is ensuring the deliver of RSSHub's new routes, new features and bug fixes.

RSSHub can be used with browser extension [RSSHub Radar](https://github.com/DIYgod/RSSHub-Radar) and mobile auxiliary app [RSSBud](https://github.com/Cay-Zhang/RSSBud) (iOS) and [RSSAid](https://github.com/LeetaoGoooo/RSSAid) (Android)

[English docs](https://docs.rsshub.app) | [Telegram Group](https://t.me/rsshub) | [Telegram Channel](https://t.me/awesomeRSSHub) | [Twitter](https://x.com/intent/follow?screen_name=_RSSHub) | [中文文档](https://docs.rsshub.app/zh/)

## Special Thanks

### Contributors

[![](https://opencollective.com/RSSHub/contributors.svg?width=890)](https://github.com/DIYgod/RSSHub/graphs/contributors)

Logo designer [sheldonrrr](https://dribbble.com/sheldonrrr)

### Backers

<a href="https://www.cloudflare.com" target="_blank"><img height="50px" src="https://i.imgur.com/7Ph27Fq.png"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://www.netlify.com" target="_blank"><img height="40px" src="https://i.imgur.com/cU01915.png"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://1password.com" target="_blank"><img height="40px" src="https://i.imgur.com/a2XjflO.png"></a>
[Documentation](https://docs.rsshub.app) | [Telegram Group](https://t.me/rsshub) | [Telegram Channel](https://t.me/awesomeRSSHub) | [X (Twitter)](https://x.com/intent/follow?screen_name=_RSSHub)

## Related Projects

Expand All @@ -43,53 +29,32 @@ Logo designer [sheldonrrr](https://dribbble.com/sheldonrrr)
- [RSSAid](https://github.com/LeetaoGoooo/RSSAid) | RSSHub Radar for Android platform built with Flutter.
- [DocSearch](https://github.com/Fatpandac/DocSearch) | Link RSSHub DocSearch into Raycast

## Join Us
## Contribute

We welcome all pull requests. Suggestions and feedback are also welcomed [here](https://github.com/DIYgod/RSSHub/issues).

Refer to [Join Us](https://docs.rsshub.app/joinus/)
Refer to [Quick Start](https://docs.rsshub.app/joinus/)

## Deployment

Refer to [Deployment](https://docs.rsshub.app/deploy/)

## Support RSSHub

Refer to [Support RSSHub](https://docs.rsshub.app/sponsor/)

RSSHub is open source and completely free under the MIT license. However, just like any other open source project, as the project grows, the hosting, development and maintenance requires funding support.

You can support RSSHub via donations.

### Recurring Donation

Recurring donors will be rewarded via express issue response, or even have your name displayed on our GitHub page and website.

- Become a Sponser on [GitHub](https://github.com/sponsors/DIYgod)
- Become a Sponser on [Patreon](https://www.patreon.com/DIYgod)
- Become a Sponser on [Open Collective](https://opencollective.com/RSSHub)
- Become a Sponser on [爱发电](https://afdian.net/@diygod)
- Contact us directly: <i@diygod.me>
## Special Thanks

### One-time Donation
<div align="center">

We accept donations via the following ways:
[![](https://opencollective.com/RSSHub/contributors.svg?width=890)](https://github.com/DIYgod/RSSHub/graphs/contributors)

- [WeChat Pay](https://archive.diygod.me/images/wx.jpg)
- [Alipay](https://archive.diygod.me/images/zfb.jpg)
- [Paypal](https://www.paypal.me/DIYgod)
Logo designer [sheldonrrr](https://dribbble.com/sheldonrrr)

Open source is a very expensive thing. RSSHub would not be possible without the help of these individuals and organizations.
[![](https://raw.githubusercontent.com/DIYgod/sponsors/main/sponsors.simple.svg)](https://github.com/DIYgod/sponsors)

<p align="center">
<a href="https://github.com/DIYgod/sponsors">
<img src="https://raw.githubusercontent.com/DIYgod/sponsors/main/sponsors.wide.svg" />
</a>
</p>
<a href="https://www.cloudflare.com" target="_blank"><img height="50px" src="https://i.imgur.com/7Ph27Fq.png"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://www.netlify.com" target="_blank"><img height="40px" src="https://i.imgur.com/cU01915.png"></a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://1password.com" target="_blank"><img height="40px" src="https://i.imgur.com/a2XjflO.png"></a>
</div>

## Author

**RSSHub** © [DIYgod](https://github.com/DIYgod), Released under the [MIT](./LICENSE) License.<br>
Authored and maintained by DIYgod with help from contributors ([list](https://github.com/DIYgod/RSSHub/contributors)).

> Blog [@DIYgod](https://diygod.cc) · GitHub [@DIYgod](https://github.com/DIYgod) · Twitter [@DIYgod](https://x.com/DIYgod) · Telegram Channel [@awesomeDIYgod](https://t.me/awesomeDIYgod)
> Blog [@DIYgod](https://diygod.cc) · GitHub [@DIYgod](https://github.com/DIYgod) · X (Twitter) [@DIYgod](https://x.com/DIYgod) · Telegram Channel [@awesomeDIYgod](https://t.me/awesomeDIYgod)
1 change: 1 addition & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ export default [{
}],

'unicorn/prefer-code-point': 'warn',
'unicorn/prefer-global-this': 'off',
'unicorn/prefer-logical-operator-over-ternary': 'warn',
'unicorn/prefer-module': 'off',
'unicorn/prefer-node-protocol': 'off',
Expand Down
26 changes: 26 additions & 0 deletions lib/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ export type Config = {
debugInfo: string;
loggerLevel: string;
noLogfiles?: boolean;
otel: {
seconds_bucket?: string;
milliseconds_bucket?: string;
};
showLoggerTimestamp?: boolean;
sentry: {
dsn?: string;
Expand Down Expand Up @@ -179,6 +183,11 @@ export type Config = {
lightnovel: {
cookie?: string;
};
malaysiakini: {
email?: string;
password?: string;
refreshToken?: string;
};
manhuagui: {
cookie?: string;
};
Expand Down Expand Up @@ -275,6 +284,10 @@ export type Config = {
authenticationSecret?: string[];
authToken?: string[];
};
uestc: {
bbsCookie?: string;
bbsAuthStr?: string;
};
weibo: {
app_key?: string;
app_secret?: string;
Expand Down Expand Up @@ -414,6 +427,10 @@ const calculateValue = () => {
debugInfo: envs.DEBUG_INFO || 'true',
loggerLevel: envs.LOGGER_LEVEL || 'info',
noLogfiles: toBoolean(envs.NO_LOGFILES, false),
otel: {
seconds_bucket: envs.OTEL_SECONDS_BUCKET || '0.01,0.1,1,2,5,15,30,60',
milliseconds_bucket: envs.OTEL_MILLISECONDS_BUCKET || '10,20,50,100,250,500,1000,5000,15000',
},
showLoggerTimestamp: toBoolean(envs.SHOW_LOGGER_TIMESTAMP, false),
sentry: {
dsn: envs.SENTRY,
Expand Down Expand Up @@ -550,6 +567,11 @@ const calculateValue = () => {
lightnovel: {
cookie: envs.SECURITY_KEY,
},
malaysiakini: {
email: envs.MALAYSIAKINI_EMAIL,
password: envs.MALAYSIAKINI_PASSWORD,
refreshToken: envs.MALAYSIAKINI_REFRESHTOKEN,
},
manhuagui: {
cookie: envs.MHGUI_COOKIE,
},
Expand Down Expand Up @@ -650,6 +672,10 @@ const calculateValue = () => {
authenticationSecret: envs.TWITTER_AUTHENTICATION_SECRET?.split(','),
authToken: envs.TWITTER_AUTH_TOKEN?.split(','),
},
uestc: {
bbsCookie: envs.UESTC_BBS_COOKIE,
bbsAuthStr: envs.UESTC_BBS_AUTH_STR,
},
weibo: {
app_key: envs.WEIBO_APP_KEY,
app_secret: envs.WEIBO_APP_SECRET,
Expand Down
2 changes: 1 addition & 1 deletion lib/errors/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('httperror', () => {
it(`httperror`, async () => {
const response = await request.get('/test/httperror');
expect(response.status).toBe(503);
expect(response.text).toMatch('FetchError: [GET] &quot;https://httpbingo.org/status/404&quot;: 404 Not Found');
expect(response.text).toContain('FetchError: [GET] &quot;https://httpbingo.org/status/404&quot;: 404 Not Found');
}, 20000);
});

Expand Down
2 changes: 1 addition & 1 deletion lib/errors/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const errorHandler: ErrorHandler = (error, ctx) => {
const message = `${error.name}: ${errorMessage}`;

logger.error(`Error in ${requestPath}: ${message}`);
requestMetric.error({ path: requestPath, method: ctx.req.method, status: ctx.res.status });
requestMetric.error({ path: matchedRoute, method: ctx.req.method, status: ctx.res.status });

return config.isPackage || ctx.req.query('format') === 'json'
? ctx.json({
Expand Down
2 changes: 1 addition & 1 deletion lib/middleware/anti-hotlink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const matchPath = (path: string, paths: string[]) => {
return false;
};

// return ture if the path needs to be processed
// return true if the path needs to be processed
const filterPath = (path: string) => {
const include = config.hotlink.includePaths;
const exclude = config.hotlink.excludePaths;
Expand Down
4 changes: 2 additions & 2 deletions lib/middleware/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const colorStatus = (status: number) => {
};

const middleware: MiddlewareHandler = async (ctx, next) => {
const { method, raw } = ctx.req;
const { method, raw, routePath } = ctx.req;
const path = getPath(raw);

logger.info(`${LogPrefix.Incoming} ${method} ${path}`);
Expand All @@ -38,7 +38,7 @@ const middleware: MiddlewareHandler = async (ctx, next) => {
const status = ctx.res.status;

logger.info(`${LogPrefix.Outgoing} ${method} ${path} ${colorStatus(status)} ${time(start)}`);
requestMetric.success(Date.now() - start, { path, method, status });
requestMetric.success(Date.now() - start, { path: routePath, method, status });
};

export default middleware;
10 changes: 1 addition & 9 deletions lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,14 +47,6 @@ router.get('/huya/live/:id', lazyloadRouteHandler('./routes/huya/live'));
// f-droid
// router.get('/fdroid/apprelease/:app', lazyloadRouteHandler('./routes/fdroid/apprelease'));

// konachan
router.get('/konachan/post/popular_recent', lazyloadRouteHandler('./routes/konachan/post-popular-recent'));
router.get('/konachan.com/post/popular_recent', lazyloadRouteHandler('./routes/konachan/post-popular-recent'));
router.get('/konachan.net/post/popular_recent', lazyloadRouteHandler('./routes/konachan/post-popular-recent'));
router.get('/konachan/post/popular_recent/:period', lazyloadRouteHandler('./routes/konachan/post-popular-recent'));
router.get('/konachan.com/post/popular_recent/:period', lazyloadRouteHandler('./routes/konachan/post-popular-recent'));
router.get('/konachan.net/post/popular_recent/:period', lazyloadRouteHandler('./routes/konachan/post-popular-recent'));

// PornHub
// router.get('/pornhub/category/:caty', lazyloadRouteHandler('./routes/pornhub/category'));
// router.get('/pornhub/search/:keyword', lazyloadRouteHandler('./routes/pornhub/search'));
Expand Down Expand Up @@ -361,7 +353,7 @@ router.get('/ltaaa/:category?', lazyloadRouteHandler('./routes/ltaaa/index'));
router.get('/autotrader/:query', lazyloadRouteHandler('./routes/autotrader'));

// 极客公园
router.get('/geekpark/breakingnews', lazyloadRouteHandler('./routes/geekpark/breakingnews'));
// router.get('/geekpark/breakingnews', lazyloadRouteHandler('./routes/geekpark/breakingnews'));

// 搜狗
// router.get('/sogou/doodles', lazyloadRouteHandler('./routes/sogou/doodles'));
Expand Down
25 changes: 0 additions & 25 deletions lib/routes-deprecated/anime1/anime.js

This file was deleted.

25 changes: 0 additions & 25 deletions lib/routes-deprecated/anime1/search.js

This file was deleted.

60 changes: 0 additions & 60 deletions lib/routes-deprecated/dykszx/news.js

This file was deleted.

Loading

0 comments on commit 6ed23af

Please sign in to comment.