From 39d83bc28c90943bcb951d37b31fa1d9ec128cd1 Mon Sep 17 00:00:00 2001 From: haowenwu Date: Wed, 23 Oct 2024 05:37:28 +0800 Subject: [PATCH] fix(route/douban): remove parameter to avoid duplicate (#17251) --- lib/routes/douban/other/topic.ts | 4 ++-- lib/routes/douban/people/status.ts | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/lib/routes/douban/other/topic.ts b/lib/routes/douban/other/topic.ts index f4a239010b469d..99119dc2caca79 100644 --- a/lib/routes/douban/other/topic.ts +++ b/lib/routes/douban/other/topic.ts @@ -54,7 +54,7 @@ async function handler(ctx) { let link; let title; if (type === 'status') { - link = item.target.status.sharing_url; + link = item.target.status.sharing_url.split('&')[0]; author = item.target.status.author.name; title = author + '的广播'; date = item.target.status.create_time; @@ -67,7 +67,7 @@ async function handler(ctx) { } } } else if (type === 'topic') { - link = item.target.group.sharing_url; + link = item.target.sharing_url; author = item.target.status.author.name; title = item.target.title; date = item.target.create_time; diff --git a/lib/routes/douban/people/status.ts b/lib/routes/douban/people/status.ts index 140776bf32c838..ad996d63809187 100644 --- a/lib/routes/douban/people/status.ts +++ b/lib/routes/douban/people/status.ts @@ -95,6 +95,10 @@ function tryFixStatus(status) { } } + if (status.sharing_url) { + status.sharing_url = status.sharing_url.split('&')[0]; + } + if (!result.isFixSuccess) { status.sharing_url = 'https://www.douban.com?rsshub_failed=' + now.getTime().toString(); if (!status.create_time) {