From 5e0a93e1d7205d6af635e7d74ba9f0d63db7cfd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=B2?= Date: Sat, 17 Aug 2024 23:38:39 +0800 Subject: [PATCH] fix(docs): xiaohongshu doc missing (#16405) * fix(docs): xiaohongshu docs missing * fix(docs): xiaohongshu doc missing - params options * fix(docs): xiaohongshu doc missing - misspell * Update lib/routes/xiaohongshu/user.ts Co-authored-by: Tony * Update lib/routes/xiaohongshu/user.ts Co-authored-by: Tony * Update lib/routes/xiaohongshu/user.ts Co-authored-by: Tony * fix(docs): xiaohongshu doc missing - category enum * docs: add anti crawler --------- --- lib/routes/xiaohongshu/notes.ts | 12 ++++++++++-- lib/routes/xiaohongshu/user.ts | 25 +++++++++++++++++++++++-- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/lib/routes/xiaohongshu/notes.ts b/lib/routes/xiaohongshu/notes.ts index fa0267322..a4d85a5d5 100644 --- a/lib/routes/xiaohongshu/notes.ts +++ b/lib/routes/xiaohongshu/notes.ts @@ -10,9 +10,17 @@ export const route: Route = { target: '/user/:user_id/notes', }, ], - name: 'Unknown', - maintainers: [], + name: '用户笔记 全文', + maintainers: ['howerhe'], handler, + example: '/xiaohongshu/user/52d8c541b4c4d60e6c867480/notes/fulltext', + features: { + antiCrawler: true, + requirePuppeteer: true, + }, + parameters: { + user_id: 'user id, length 24 characters', + }, }; async function handler(ctx) { diff --git a/lib/routes/xiaohongshu/user.ts b/lib/routes/xiaohongshu/user.ts index 96b03405f..e5c02cfb9 100644 --- a/lib/routes/xiaohongshu/user.ts +++ b/lib/routes/xiaohongshu/user.ts @@ -5,9 +5,30 @@ import InvalidParameterError from '@/errors/types/invalid-parameter'; export const route: Route = { path: '/user/:user_id/:category', - name: 'Unknown', - maintainers: [], + name: '用户笔记', + maintainers: ['lotosbin'], handler, + example: '/xiaohongshu/user/593032945e87e77791e03696/notes', + features: { + antiCrawler: true, + requirePuppeteer: true, + }, + parameters: { + user_id: 'user id, length 24 characters', + category: { + description: 'category, notes or collect', + options: [ + { + value: 'notes', + label: 'notes', + }, + { + value: 'collect', + label: 'collect', + }, + ], + }, + }, }; async function handler(ctx) {