diff --git a/lib/pinchflat/fast_indexing/youtube_api.ex b/lib/pinchflat/fast_indexing/youtube_api.ex index e6309f5..ef033be 100644 --- a/lib/pinchflat/fast_indexing/youtube_api.ex +++ b/lib/pinchflat/fast_indexing/youtube_api.ex @@ -33,7 +33,9 @@ defmodule Pinchflat.FastIndexing.YoutubeApi do # Use a well-known public playlist (YouTube's "Popular Right Now" uploads playlist) # to test if the API key is valid test_playlist_id = "PLrAXtmErZgOeiKm4sgNOknGvNjby9efdf" - url = "https://youtube.googleapis.com/youtube/v3/playlistItems?part=id&maxResults=1&playlistId=#{test_playlist_id}&key=#{api_key}" + + url = + "https://youtube.googleapis.com/youtube/v3/playlistItems?part=id&maxResults=1&playlistId=#{test_playlist_id}&key=#{api_key}" case http_client().get(url, accept: "application/json") do {:ok, response} -> diff --git a/lib/pinchflat/fast_indexing/youtube_rss.ex b/lib/pinchflat/fast_indexing/youtube_rss.ex index cb83fa9..db34c08 100644 --- a/lib/pinchflat/fast_indexing/youtube_rss.ex +++ b/lib/pinchflat/fast_indexing/youtube_rss.ex @@ -19,6 +19,15 @@ defmodule Pinchflat.FastIndexing.YoutubeRss do @impl YoutubeBehaviour def enabled?(), do: true + @doc """ + RSS feeds don't use API keys, so this always returns :ok. + Used to satisfy the `YoutubeBehaviour` behaviour. + + Returns :ok + """ + @impl YoutubeBehaviour + def test_api_key(_api_key), do: :ok + @doc """ Fetches the recent media IDs from a YouTube RSS feed for a given source.