From 3760d45c6d4b78cc19c3ecb100dac57fce5fa049 Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Tue, 12 Mar 2024 12:11:57 -0700 Subject: [PATCH] Updated other occurance --- lib/pinchflat/yt_dlp/media_collection.ex | 5 ++++- test/pinchflat/yt_dlp/media_collection_test.exs | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/pinchflat/yt_dlp/media_collection.ex b/lib/pinchflat/yt_dlp/media_collection.ex index c83ec04..5fb957c 100644 --- a/lib/pinchflat/yt_dlp/media_collection.ex +++ b/lib/pinchflat/yt_dlp/media_collection.ex @@ -22,7 +22,10 @@ defmodule Pinchflat.YtDlp.MediaCollection do """ def get_media_attributes_for_collection(url, addl_opts \\ []) do runner = Application.get_env(:pinchflat, :yt_dlp_runner) - command_opts = [:simulate, :skip_download] + # `ignore_no_formats_error` is necessary because yt-dlp will error out if + # the first video has not released yet (ie: is a premier). We don't care about + # available formats since we're just getting the media details + command_opts = [:simulate, :skip_download, :ignore_no_formats_error] output_template = YtDlpMedia.indexing_output_template() output_filepath = FilesystemHelpers.generate_metadata_tmpfile(:json) file_listener_handler = Keyword.get(addl_opts, :file_listener_handler, false) diff --git a/test/pinchflat/yt_dlp/media_collection_test.exs b/test/pinchflat/yt_dlp/media_collection_test.exs index 41a0145..2867954 100644 --- a/test/pinchflat/yt_dlp/media_collection_test.exs +++ b/test/pinchflat/yt_dlp/media_collection_test.exs @@ -22,7 +22,7 @@ defmodule Pinchflat.YtDlp.MediaCollectionTest do test "it passes the expected default args" do expect(YtDlpRunnerMock, :run, fn _url, opts, ot, _addl_opts -> - assert opts == [:simulate, :skip_download] + assert opts == [:simulate, :skip_download, :ignore_no_formats_error] assert ot == Media.indexing_output_template() {:ok, ""}