Explorar el Código

feat(finder): generate feeds for stable youtube playlists

Mateusz Jabłoński hace 4 meses
padre
commit
88f9f279e6

+ 4 - 13
internal/reader/subscription/finder.go

@@ -68,7 +68,7 @@ func (f *subscriptionFinder) FindSubscriptions(websiteURL, rssBridgeURL string,
 		f.feedDownloaded = true
 		return Subscriptions{NewSubscription(responseHandler.EffectiveURL(), responseHandler.EffectiveURL(), feedFormat)}, nil
 	}
-	
+
 	// Step 2) Find the canonical URL of the website.
 	slog.Debug("Try to find the canonical URL of the website", slog.String("website_url", websiteURL))
 	websiteURL = f.findCanonicalURL(websiteURL, responseHandler.ContentType(), bytes.NewReader(responseBody))
@@ -285,15 +285,6 @@ func (f *subscriptionFinder) findSubscriptionsFromYouTube(websiteURL string) (Su
 		{"UULF", "Videos"},
 		{"UUSH", "Short videos"},
 		{"UULV", "Live streams"},
-
-		{"UULP", "Popular videos"},
-		{"UUPS", "Popular short videos"},
-		{"UUPV", "Popular live streams"},
-		
-		{"UUMO", "Members-only contents (videos, short videos and live streams)"},
-		{"UUMF", "Members-only videos"},
-		{"UUMS", "Members-only short videos"},
-		{"UUMV", "Members-only live streams"},
 	}
 
 	decodedURL, err := url.Parse(websiteURL)
@@ -308,15 +299,15 @@ func (f *subscriptionFinder) findSubscriptionsFromYouTube(websiteURL string) (Su
 
 	if _, baseID, found := strings.Cut(decodedURL.Path, "channel/UC"); found {
 		var subscriptions Subscriptions
-		
+
 		channelFeedURL := "https://www.youtube.com/feeds/videos.xml?channel_id=UC" + baseID
 		subscriptions = append(subscriptions, NewSubscription("Channel", channelFeedURL, parser.FormatAtom))
-			
+
 		for _, playlist := range playlistPrefixes {
 			playlistFeedURL := "https://www.youtube.com/feeds/videos.xml?playlist_id=" + playlist.prefix + baseID
 			subscriptions = append(subscriptions, NewSubscription(playlist.title, playlistFeedURL, parser.FormatAtom))
 		}
-		
+
 		return subscriptions, nil
 	}
 

+ 0 - 7
internal/reader/subscription/finder_test.go

@@ -39,13 +39,6 @@ func TestFindYoutubeFeed(t *testing.T) {
 				"https://www.youtube.com/feeds/videos.xml?playlist_id=UULF-Qj80avWItNRjkZ41rzHyw",
 				"https://www.youtube.com/feeds/videos.xml?playlist_id=UUSH-Qj80avWItNRjkZ41rzHyw",
 				"https://www.youtube.com/feeds/videos.xml?playlist_id=UULV-Qj80avWItNRjkZ41rzHyw",
-				"https://www.youtube.com/feeds/videos.xml?playlist_id=UULP-Qj80avWItNRjkZ41rzHyw",
-				"https://www.youtube.com/feeds/videos.xml?playlist_id=UUPS-Qj80avWItNRjkZ41rzHyw",
-				"https://www.youtube.com/feeds/videos.xml?playlist_id=UUPV-Qj80avWItNRjkZ41rzHyw",
-				"https://www.youtube.com/feeds/videos.xml?playlist_id=UUMO-Qj80avWItNRjkZ41rzHyw",
-				"https://www.youtube.com/feeds/videos.xml?playlist_id=UUMF-Qj80avWItNRjkZ41rzHyw",
-				"https://www.youtube.com/feeds/videos.xml?playlist_id=UUMS-Qj80avWItNRjkZ41rzHyw",
-				"https://www.youtube.com/feeds/videos.xml?playlist_id=UUMV-Qj80avWItNRjkZ41rzHyw",
 			},
 		},
 		// Channel URL with name