1
0
Fork 0

feat: add support for base element when discovering feeds

This commit is contained in:
Frédéric Guillot 2024-07-25 20:31:30 -07:00
parent 29387f2d60
commit f6dc952551

View file

@ -147,6 +147,13 @@ func (f *SubscriptionFinder) FindSubscriptionsFromWebPage(websiteURL, contentTyp
return nil, locale.NewLocalizedErrorWrapper(err, "error.unable_to_parse_html_document", err)
}
if hrefValue, exists := doc.Find("head base").First().Attr("href"); exists {
hrefValue = strings.TrimSpace(hrefValue)
if urllib.IsAbsoluteURL(hrefValue) {
websiteURL = hrefValue
}
}
var subscriptions Subscriptions
subscriptionURLs := make(map[string]bool)
for query, kind := range queries {