[Enhancement] Allow custom yt-dlp options (#176)

* Added option for yt-dlp config file usage

* renamed yt-dlp config file

* refactored to use a precedence-based approach

* Updated README
This commit is contained in:
Kieran
2024-04-10 20:17:22 -07:00
committed by GitHub
parent 0fcdd1df84
commit 8fbcc8b289
7 changed files with 172 additions and 25 deletions
@@ -27,7 +27,7 @@ defmodule Pinchflat.Boot.PreJobStartupTasksTest do
end
end
describe "create_blank_cookie_file" do
describe "create_blank_yt_dlp_files" do
test "creates a blank cookie file" do
base_dir = Application.get_env(:pinchflat, :extras_directory)
filepath = Path.join(base_dir, "cookies.txt")
@@ -39,6 +39,18 @@ defmodule Pinchflat.Boot.PreJobStartupTasksTest do
assert File.exists?(filepath)
end
test "creates a blank yt-dlp config file" do
base_dir = Application.get_env(:pinchflat, :extras_directory)
filepath = Path.join([base_dir, "yt-dlp-configs", "base-config.txt"])
File.rm(filepath)
refute File.exists?(filepath)
PreJobStartupTasks.init(%{})
assert File.exists?(filepath)
end
end
describe "apply_default_settings" do