[Bugfix] Improve YouTube shorts detection for new YouTube pants (#618)
* Update youtube shorts detection to support youtube pants * Updates a test
This commit is contained in:
@@ -151,7 +151,7 @@ defmodule Pinchflat.YtDlp.Media do
|
||||
#
|
||||
# These don't fail if duration or aspect_ratio are missing
|
||||
# due to Elixir's comparison semantics
|
||||
response["duration"] <= 60 && response["aspect_ratio"] <= 0.85
|
||||
response["duration"] <= 180 && response["aspect_ratio"] <= 0.85
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -269,7 +269,7 @@ defmodule Pinchflat.YtDlp.MediaTest do
|
||||
response = %{
|
||||
"original_url" => "https://www.youtube.com/watch?v=TiZPUDkDYbk",
|
||||
"aspect_ratio" => 0.5,
|
||||
"duration" => 59,
|
||||
"duration" => 150,
|
||||
"upload_date" => "20210101"
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user