Added support for ytdlp cache (#245)
This commit is contained in:
parent
8d9bd11882
commit
dcf033f10a
2 changed files with 11 additions and 1 deletions
|
|
@ -71,7 +71,11 @@ defmodule Pinchflat.YtDlp.CommandRunner do
|
||||||
end
|
end
|
||||||
|
|
||||||
defp global_options do
|
defp global_options do
|
||||||
[:windows_filenames, :quiet]
|
[
|
||||||
|
:windows_filenames,
|
||||||
|
:quiet,
|
||||||
|
cache_dir: Path.join(Application.get_env(:pinchflat, :tmpfile_directory), "yt-dlp-cache")
|
||||||
|
]
|
||||||
end
|
end
|
||||||
|
|
||||||
defp cookie_file_options do
|
defp cookie_file_options do
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,12 @@ defmodule Pinchflat.YtDlp.CommandRunnerTest do
|
||||||
|
|
||||||
assert String.contains?(output, "--quiet")
|
assert String.contains?(output, "--quiet")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "sets the cache directory" do
|
||||||
|
assert {:ok, output} = Runner.run(@media_url, [], "")
|
||||||
|
|
||||||
|
assert String.contains?(output, "--cache-dir /tmp/test/tmpfiles/yt-dlp-cache")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "version/0" do
|
describe "version/0" do
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue