From 174847db12e0fd299de01791fab237eb4594f5e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Guillot?= Date: Sat, 13 Jul 2024 09:53:22 -0700 Subject: [PATCH] fix: panic during YouTube channel feed discovery Regression introduced in commit e54825b --- internal/reader/subscription/finder.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/internal/reader/subscription/finder.go b/internal/reader/subscription/finder.go index 085467fd2b6..6f71859cca9 100644 --- a/internal/reader/subscription/finder.go +++ b/internal/reader/subscription/finder.go @@ -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 }