Improved robustness of file downloads (#225)

This commit is contained in:
Kieran
2024-05-03 09:15:12 -07:00
committed by GitHub
parent 7090349abd
commit f655a8ae01
9 changed files with 99 additions and 17 deletions
+11
View File
@@ -199,5 +199,16 @@ defmodule Pinchflat.YtDlp.MediaTest do
assert %Media{duration_seconds: nil} = Media.response_to_struct(response)
end
test "sets livestream to false if the was_live field isn't present" do
response = %{
"webpage_url" => "https://www.youtube.com/watch?v=TiZPUDkDYbk",
"aspect_ratio" => 1.0,
"duration" => 60,
"upload_date" => "20210101"
}
assert %Media{livestream: false} = Media.response_to_struct(response)
end
end
end