From f67db8ea8668a1ef4ddc40a91922d8bb627c2521 Mon Sep 17 00:00:00 2001 From: Twelveeee Date: Thu, 6 Nov 2025 11:06:26 +0800 Subject: [PATCH] feat:add RSSHub RSSHubAccessKey --- pkg/config/config.go | 1 - pkg/scrape/scraper/rss.go | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/config/config.go b/pkg/config/config.go index cd14d06..cbfc2a4 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -134,7 +134,6 @@ type ScrapeSource struct { type ScrapeSourceRSS struct { URL string `yaml:"url,omitempty" json:"url,omitempty" desc:"The URL of the RSS feed. e.g. http://localhost:1200/github/trending/daily/any. You can not set it when rsshub_route_path is set."` RSSHubRoutePath string `yaml:"rsshub_route_path,omitempty" json:"rsshub_route_path,omitempty" desc:"The RSSHub route path of the RSS feed. e.g. github/trending/daily/any. It will be joined with the rsshub_endpoint as the final URL."` - // RSSHubAccessKey string `yaml:"rsshub_access_key,omitempty" json:"rsshub_access_key,omitempty" desc:"The access key for accessing RSSHub routes. If set, it will be appended as a query parameter to the URL."` } type RewriteRule struct { diff --git a/pkg/scrape/scraper/rss.go b/pkg/scrape/scraper/rss.go index 4820e6f..0b7de2b 100644 --- a/pkg/scrape/scraper/rss.go +++ b/pkg/scrape/scraper/rss.go @@ -48,7 +48,7 @@ func (c *ScrapeSourceRSS) Validate() error { } // Append access key as query parameter if provided - if c.RSSHubAccessKey != "" && !strings.Contains(c.URL, "key=") { + if c.RSSHubEndpoint != "" && c.RSSHubAccessKey != "" && !strings.Contains(c.URL, "key=") { if strings.Contains(c.URL, "?") { c.URL += "&key=" + c.RSSHubAccessKey } else {