feat:add RSSHub RSSHubAccessKey

This commit is contained in:
Twelveeee
2025-11-07 14:27:29 +08:00
parent 6c4223de92
commit 584f94e1ef

View File

@@ -48,6 +48,12 @@ func (c *ScrapeSourceRSS) Validate() error {
}
// Append access key as query parameter if provided
c.appendAccessKey()
return nil
}
func (c *ScrapeSourceRSS) appendAccessKey() {
if c.RSSHubEndpoint != "" && c.RSSHubAccessKey != "" && !strings.Contains(c.URL, "key=") {
if strings.Contains(c.URL, "?") {
c.URL += "&key=" + c.RSSHubAccessKey
@@ -55,8 +61,6 @@ func (c *ScrapeSourceRSS) Validate() error {
c.URL += "?key=" + c.RSSHubAccessKey
}
}
return nil
}
// --- Factory code block ---