diff --git a/internal/reader/subscription/finder.go b/internal/reader/subscription/finder.go index 945fd1c6262..514b7ffc68e 100644 --- a/internal/reader/subscription/finder.go +++ b/internal/reader/subscription/finder.go @@ -25,7 +25,6 @@ import ( ) var ( - youtubeHostRegex = regexp.MustCompile(`youtube\.com$`) youtubeChannelRegex = regexp.MustCompile(`channel/(.*)$`) ) @@ -284,7 +283,7 @@ func (f *SubscriptionFinder) FindSubscriptionsFromYouTubeChannelPage(websiteURL return nil, locale.NewLocalizedErrorWrapper(err, "error.invalid_site_url", err) } - if !youtubeHostRegex.MatchString(decodedUrl.Host) { + if !strings.HasSuffix(decodedUrl.Host, "youtube.com") { slog.Debug("This website is not a YouTube page, the regex doesn't match", slog.String("website_url", websiteURL)) return nil, nil } @@ -303,7 +302,7 @@ func (f *SubscriptionFinder) FindSubscriptionsFromYouTubePlaylistPage(websiteURL return nil, locale.NewLocalizedErrorWrapper(err, "error.invalid_site_url", err) } - if !youtubeHostRegex.MatchString(decodedUrl.Host) { + if !strings.HasSuffix(decodedUrl.Host, "youtube.com") { slog.Debug("This website is not a YouTube page, the regex doesn't match", slog.String("website_url", websiteURL)) return nil, nil }