1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-01 17:38:37 +00:00

fix: panic during YouTube channel feed discovery

Regression introduced in commit e54825b
This commit is contained in:
Frédéric Guillot 2024-07-13 09:53:22 -07:00
parent f847c3e754
commit 79ea9e28b5

View file

@ -87,10 +87,11 @@ func (f *SubscriptionFinder) FindSubscriptions(websiteURL, rssBridgeURL string)
return Subscriptions{NewSubscription(responseHandler.EffectiveURL(), responseHandler.EffectiveURL(), feedFormat)}, nil
}
subscriptions := make(Subscriptions, 1)
var subscriptions Subscriptions
// Step 2) Parse URL to find feeds from YouTube.
kind, _, err := youtubeURLIDExtractor(websiteURL)
slog.Debug("YouTube URL ID extraction", slog.String("website_url", websiteURL), slog.Any("kind", kind), slog.Any("err", err))
// If YouTube url has been detected, return the YouTube feed
if err == nil || !errors.Is(err, errNotYoutubeUrl) {
@ -393,6 +394,6 @@ func youtubeURLIDExtractor(websiteURL string) (idKind youtubeKind, id string, er
id = decodedUrl.Query().Get("list")
return
}
err = fmt.Errorf("unable to extract youtube id from URL: %s", websiteURL)
err = fmt.Errorf("finder: unable to extract youtube id from URL: %s", websiteURL)
return
}