[Bugfix] Respect cookies preference when performing download pre-check (#517)

* Updated get_downloadable_status to pass yt cookies

* Updated tests
This commit is contained in:
Kieran authored and GitHub committed 2024-12-17 11:18:47 -08:00
1 parent 0be469dcb0
commit a2a70fcce2
5 files changed
+222 -156

No files matched your search

+5 -2
View File
@@ -55,8 +55,11 @@ defmodule Pinchflat.YtDlp.Media do
Returns {:ok, :downloadable | :ignorable} | {:error, any}
"""
def get_downloadable_status(url) do
case backend_runner().run(url, :get_downloadable_status, [:simulate, :skip_download], "%(.{live_status})j") do
def get_downloadable_status(url, addl_opts \\ []) do
action = :get_downloadable_status
command_opts = [:simulate, :skip_download]
case backend_runner().run(url, action, command_opts, "%(.{live_status})j", addl_opts) do
{:ok, output} ->
output
|> Phoenix.json_library().decode!()