From a1322b845ded4a9de396ef7127f4d17a6b2667f2 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Thu, 27 Jun 2024 03:24:02 +0800 Subject: [PATCH] feat: clear popular docs --- lib/routes/bilibili/dynamic.ts | 27 ++++----- lib/routes/bilibili/namespace.ts | 2 +- lib/routes/bilibili/video.ts | 3 - lib/routes/dockerhub/build.ts | 5 +- lib/routes/instagram/private-api/index.ts | 11 +++- lib/routes/pixiv/ranking.ts | 72 ++++++++++++++++++++--- lib/routes/telegram/channel.ts | 59 ++++++++++--------- lib/routes/weibo/friends.ts | 1 + lib/routes/weibo/group.ts | 1 + lib/routes/weibo/user-bookmarks.ts | 1 + lib/routes/weibo/user.ts | 14 +++-- 11 files changed, 128 insertions(+), 68 deletions(-) diff --git a/lib/routes/bilibili/dynamic.ts b/lib/routes/bilibili/dynamic.ts index 0e14ff925..455a816d5 100644 --- a/lib/routes/bilibili/dynamic.ts +++ b/lib/routes/bilibili/dynamic.ts @@ -12,7 +12,18 @@ export const route: Route = { path: '/user/dynamic/:uid/:routeParams?', categories: ['social-media', 'popular'], example: '/bilibili/user/dynamic/2267573', - parameters: { uid: '用户 id, 可在 UP 主主页中找到', routeParams: '额外参数;请参阅以下说明和表格' }, + parameters: { + uid: '用户 id, 可在 UP 主主页中找到', + routeParams: ` +| 键 | 含义 | 接受的值 | 默认值 | +| ------------ | --------------------------------- | -------------- | ------ | +| showEmoji | 显示或隐藏表情图片 | 0/1/true/false | false | +| disableEmbed | 关闭内嵌视频 | 0/1/true/false | false | +| useAvid | 视频链接使用 AV 号 (默认为 BV 号) | 0/1/true/false | false | +| directLink | 使用内容直链 | 0/1/true/false | false | + +用例:\`/bilibili/user/dynamic/2267573/showEmoji=1&disableEmbed=1&useAvid=1\``, + }, features: { requireConfig: [ { @@ -40,20 +51,6 @@ export const route: Route = { name: 'UP 主动态', maintainers: ['DIYgod', 'zytomorrow', 'CaoMeiYouRen', 'JimenezLi'], handler, - description: `| 键 | 含义 | 接受的值 | 默认值 | - | ------------ | --------------------------------- | -------------- | ------ | - | showEmoji | 显示或隐藏表情图片 | 0/1/true/false | false | - | disableEmbed | 关闭内嵌视频 | 0/1/true/false | false | - | useAvid | 视频链接使用 AV 号 (默认为 BV 号) | 0/1/true/false | false | - | directLink | 使用内容直链 | 0/1/true/false | false | - - 用例:\`/bilibili/user/dynamic/2267573/showEmoji=1&disableEmbed=1&useAvid=1\` - - :::tip 动态的专栏显示全文 - 动态的专栏显示全文请使用通用参数里的 \`mode=fulltext\` - - 举例: bilibili 专栏全文输出 /bilibili/user/dynamic/2267573/?mode=fulltext - :::`, }; const getTitle = (data: Modules): string => { diff --git a/lib/routes/bilibili/namespace.ts b/lib/routes/bilibili/namespace.ts index cc6da5657..fba152698 100644 --- a/lib/routes/bilibili/namespace.ts +++ b/lib/routes/bilibili/namespace.ts @@ -1,6 +1,6 @@ import type { Namespace } from '@/types'; export const namespace: Namespace = { - name: 'Bilibili', + name: '哔哩哔哩 bilibili', url: 'www.bilibili.com', }; diff --git a/lib/routes/bilibili/video.ts b/lib/routes/bilibili/video.ts index 02adf3ec7..762786f78 100644 --- a/lib/routes/bilibili/video.ts +++ b/lib/routes/bilibili/video.ts @@ -26,9 +26,6 @@ export const route: Route = { name: 'UP 主投稿', maintainers: ['DIYgod'], handler, - description: `:::tip 动态的专栏显示全文 - 可以使用 [UP 主动态](#bilibili-up-zhu-dong-tai)路由作为代替绕过反爬限制 - :::`, }; async function handler(ctx) { diff --git a/lib/routes/dockerhub/build.ts b/lib/routes/dockerhub/build.ts index 0a6945a2f..d4565b642 100644 --- a/lib/routes/dockerhub/build.ts +++ b/lib/routes/dockerhub/build.ts @@ -7,7 +7,7 @@ export const route: Route = { categories: ['program-update', 'popular'], example: '/dockerhub/build/wangqiru/ttrss', parameters: { - owner: 'Image owner', + owner: 'Image owner, the owner of the official image fills in the library, for example: /dockerhub/build/library/mysql', image: 'Image name', tag: { description: 'Image tag', @@ -25,9 +25,6 @@ export const route: Route = { name: 'Image New Build', maintainers: ['HenryQW'], handler, - description: `:::warning - The owner of the official image fills in the library, for example: [https://rsshub.app/dockerhub/build/library/mysql](https://rsshub.app/dockerhub/build/library/mysql) - :::`, }; async function handler(ctx) { diff --git a/lib/routes/instagram/private-api/index.ts b/lib/routes/instagram/private-api/index.ts index 137c873f6..93c427ea6 100644 --- a/lib/routes/instagram/private-api/index.ts +++ b/lib/routes/instagram/private-api/index.ts @@ -68,6 +68,14 @@ export const route: Route = { optional: true, description: '', }, + { + name: 'IG_USERNAME', + description: 'Instagram username', + }, + { + name: 'IG_PASSWORD', + description: 'Instagram password, due to [Instagram Private API](https://github.com/dilame/instagram-private-api) restrictions, you have to setup your credentials on the server. 2FA is not supported.', + }, ], requirePuppeteer: false, antiCrawler: true, @@ -78,9 +86,6 @@ export const route: Route = { name: 'User Profile / Hashtag - Private API', maintainers: ['oppilate', 'DIYgod'], handler, - description: `:::warning -Due to [Instagram Private API](https://github.com/dilame/instagram-private-api) restrictions, you have to setup your credentials on the server. 2FA is not supported. See [deployment guide](https://docs.rsshub.app/deploy/) for more. -:::`, }; async function handler(ctx) { diff --git a/lib/routes/pixiv/ranking.ts b/lib/routes/pixiv/ranking.ts index 022814e93..8138a31ef 100644 --- a/lib/routes/pixiv/ranking.ts +++ b/lib/routes/pixiv/ranking.ts @@ -62,7 +62,70 @@ export const route: Route = { path: '/ranking/:mode/:date?', categories: ['social-media', 'popular'], example: '/pixiv/ranking/week', - parameters: { mode: 'rank type', date: 'format: `2018-4-25`' }, + parameters: { + mode: { + description: 'rank type', + options: [ + { + value: 'day', + label: 'daily rank', + }, + { + value: 'week', + label: 'weekly rank', + }, + { + value: 'month', + label: 'monthly rank', + }, + { + value: 'day_male', + label: 'male rank', + }, + { + value: 'day_felame', + label: 'female rank', + }, + { + value: 'day_ai', + label: 'AI-generated work Rankings', + }, + { + value: 'week_original', + label: 'original rank', + }, + { + value: 'week_rookie', + label: 'rookie user rank', + }, + { + value: 'day_r18', + label: 'R-18 daily rank', + }, + { + value: 'day_r18_ai', + label: 'R-18 AI-generated work', + }, + { + value: 'day_male_r18', + label: 'R-18 male rank', + }, + { + value: 'day_female_r18', + label: 'R-18 female rank', + }, + { + value: 'week_r18', + label: 'R-18 weekly rank', + }, + { + value: 'week_r18g', + label: 'R-18G rank', + }, + ], + }, + date: 'format: `2018-4-25`', + }, features: { requireConfig: false, requirePuppeteer: false, @@ -74,13 +137,6 @@ export const route: Route = { name: 'Rankings', maintainers: ['EYHN'], handler, - description: `| daily rank | weekly rank | monthly rank | male rank | female rank | AI-generated work Rankings | original rank | rookie user rank | - | ---------- | ----------- | ------------ | --------- | ----------- | -------------------------- | -------------- | ---------------- | - | day | week | month | day\_male | day\_female | day\_ai | week\_original | week\_rookie | - - | R-18 daily rank | R-18 AI-generated work | R-18 male rank | R-18 female rank | R-18 weekly rank | R-18G rank | - | --------------- | ---------------------- | -------------- | ---------------- | ---------------- | ---------- | - | day\_r18 | day\_r18\_ai | day\_male\_r18 | day\_female\_r18 | week\_r18 | week\_r18g |`, }; async function handler(ctx) { diff --git a/lib/routes/telegram/channel.ts b/lib/routes/telegram/channel.ts index b36b56705..b86ae5cf6 100644 --- a/lib/routes/telegram/channel.ts +++ b/lib/routes/telegram/channel.ts @@ -59,7 +59,37 @@ export const route: Route = { path: '/channel/:username/:routeParams?', categories: ['social-media', 'popular'], example: '/telegram/channel/awesomeDIYgod/searchQuery=twitter', - parameters: { username: 'channel username', routeParams: 'extra parameters, see the table below' }, + parameters: { + username: 'channel username', + routeParams: `extra parameters, see the table below +| Key | Description | Accepts | Defaults to | +| ---------------------- | --------------------------------------------------------------------- | -------------------------------------------------- | ------------ | +| showLinkPreview | Show the link preview from Telegram | 0/1/true/false | true | +| showViaBot | For messages sent via bot, show the bot | 0/1/true/false | true | +| showReplyTo | For reply messages, show the target of the reply | 0/1/true/false | true | +| showFwdFrom | For forwarded messages, show the forwarding source | 0/1/true/false | true | +| showFwdFromAuthor | For forwarded messages, show the author of the forwarding source | 0/1/true/false | true | +| showInlineButtons | Show inline buttons | 0/1/true/false | false | +| showMediaTagInTitle | Show media tags in the title | 0/1/true/false | true | +| showMediaTagAsEmoji | Show media tags as emoji | 0/1/true/false | true | +| showHashtagAsHyperlink | Show hashtags as hyperlinks (\`https://t.me/s/channel?q=%23hashtag\`) | 0/1/true/false | true | +| includeFwd | Include forwarded messages | 0/1/true/false | true | +| includeReply | Include reply messages | 0/1/true/false | true | +| includeServiceMsg | Include service messages (e.g. message pinned, channel photo updated) | 0/1/true/false | true | +| includeUnsupportedMsg | Include messages unsupported by t.me | 0/1/true/false | false | +| searchQuery | search query | keywords; replace \`#hashtag\` with \`%23hashtag\` | (no keyword) | + +Specify different option values than default values can meet different needs, URL + +\`\`\` +https://rsshub.app/telegram/channel/NewlearnerChannel/showLinkPreview=0&showViaBot=0&showReplyTo=0&showFwdFrom=0&showFwdFromAuthor=0&showInlineButtons=0&showMediaTagInTitle=1&showMediaTagAsEmoji=1&includeFwd=0&includeReply=1&includeServiceMsg=0&includeUnsupportedMsg=0 +\`\`\` + +generates an RSS without any link previews and annoying metadata, with emoji media tags in the title, without forwarded messages (but with reply messages), and without messages you don't care about (service messages and unsupported messages), for people who prefer pure subscriptions. + +For backward compatibility reasons, invalid \`routeParams\` will be treated as \`searchQuery\` . +`, + }, features: { requireConfig: false, requirePuppeteer: false, @@ -78,34 +108,7 @@ export const route: Route = { maintainers: ['DIYgod', 'Rongronggg9'], handler, description: ` - | Key | Description | Accepts | Defaults to | - | ---------------------- | --------------------------------------------------------------------- | -------------------------------------------------- | ------------ | - | showLinkPreview | Show the link preview from Telegram | 0/1/true/false | true | - | showViaBot | For messages sent via bot, show the bot | 0/1/true/false | true | - | showReplyTo | For reply messages, show the target of the reply | 0/1/true/false | true | - | showFwdFrom | For forwarded messages, show the forwarding source | 0/1/true/false | true | - | showFwdFromAuthor | For forwarded messages, show the author of the forwarding source | 0/1/true/false | true | - | showInlineButtons | Show inline buttons | 0/1/true/false | false | - | showMediaTagInTitle | Show media tags in the title | 0/1/true/false | true | - | showMediaTagAsEmoji | Show media tags as emoji | 0/1/true/false | true | - | showHashtagAsHyperlink | Show hashtags as hyperlinks (\`https://t.me/s/channel?q=%23hashtag\`) | 0/1/true/false | true | - | includeFwd | Include forwarded messages | 0/1/true/false | true | - | includeReply | Include reply messages | 0/1/true/false | true | - | includeServiceMsg | Include service messages (e.g. message pinned, channel photo updated) | 0/1/true/false | true | - | includeUnsupportedMsg | Include messages unsupported by t.me | 0/1/true/false | false | - | searchQuery | search query | keywords; replace \`#hashtag\` with \`%23hashtag\` | (no keyword) | - - Specify different option values than default values can meet different needs, URL - - \`\`\` - https://rsshub.app/telegram/channel/NewlearnerChannel/showLinkPreview=0&showViaBot=0&showReplyTo=0&showFwdFrom=0&showFwdFromAuthor=0&showInlineButtons=0&showMediaTagInTitle=1&showMediaTagAsEmoji=1&includeFwd=0&includeReply=1&includeServiceMsg=0&includeUnsupportedMsg=0 - \`\`\` - - generates an RSS without any link previews and annoying metadata, with emoji media tags in the title, without forwarded messages (but with reply messages), and without messages you don't care about (service messages and unsupported messages), for people who prefer pure subscriptions. - :::tip - For backward compatibility reasons, invalid \`routeParams\` will be treated as \`searchQuery\` . - Due to Telegram restrictions, some channels involving pornography, copyright, and politics cannot be subscribed. You can confirm by visiting \`https://t.me/s/:username\`. :::`, }; diff --git a/lib/routes/weibo/friends.ts b/lib/routes/weibo/friends.ts index 3cb5cbe34..8e7756762 100644 --- a/lib/routes/weibo/friends.ts +++ b/lib/routes/weibo/friends.ts @@ -16,6 +16,7 @@ export const route: Route = { requireConfig: [ { name: 'WEIBO_COOKIES', + optional: true, description: '', }, ], diff --git a/lib/routes/weibo/group.ts b/lib/routes/weibo/group.ts index ad00e817d..ab762e4e2 100644 --- a/lib/routes/weibo/group.ts +++ b/lib/routes/weibo/group.ts @@ -16,6 +16,7 @@ export const route: Route = { requireConfig: [ { name: 'WEIBO_COOKIES', + optional: true, description: '', }, ], diff --git a/lib/routes/weibo/user-bookmarks.ts b/lib/routes/weibo/user-bookmarks.ts index 4c2fb7804..367152c92 100644 --- a/lib/routes/weibo/user-bookmarks.ts +++ b/lib/routes/weibo/user-bookmarks.ts @@ -18,6 +18,7 @@ export const route: Route = { requireConfig: [ { name: 'WEIBO_COOKIES', + optional: true, description: '', }, ], diff --git a/lib/routes/weibo/user.ts b/lib/routes/weibo/user.ts index 93f08c36a..e356b8988 100644 --- a/lib/routes/weibo/user.ts +++ b/lib/routes/weibo/user.ts @@ -14,7 +14,13 @@ export const route: Route = { example: '/weibo/user/1195230310', parameters: { uid: '用户 id, 博主主页打开控制台执行 `$CONFIG.oid` 获取', routeParams: '额外参数;请参阅上面的说明和表格;特别地,当 `routeParams=1` 时开启微博视频显示' }, features: { - requireConfig: false, + requireConfig: [ + { + name: 'WEIBO_COOKIES', + optional: true, + description: '', + }, + ], requirePuppeteer: false, antiCrawler: true, supportBT: false, @@ -31,11 +37,7 @@ export const route: Route = { maintainers: ['DIYgod', 'iplusx', 'Rongronggg9'], handler, description: `:::warning - 部分博主仅登录可见,未提供 Cookie 的情况下不支持订阅,可以通过打开 \`https://m.weibo.cn/u/:uid\` 验证。如需要订阅该部分博主,可配置 Cookie 后订阅。 - - 未提供 Cookie 的情况下偶尔会触发反爬限制,提供 Cookie 可缓解该情况。 - - 微博用户 Cookie 的配置可参照部署文档 + 部分博主仅登录可见,未提供 Cookie 的情况下不支持订阅,可以通过打开 \`https://m.weibo.cn/u/:uid\` 验证 :::`, };