Skip to content

Commit b62eb2b

Browse files
authored
[Bugfix] Improve YouTube shorts detection for new YouTube pants (#618)
* Update youtube shorts detection to support youtube pants * Updates a test
1 parent 464a595 commit b62eb2b

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/pinchflat/yt_dlp/media.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ defmodule Pinchflat.YtDlp.Media do
151151
#
152152
# These don't fail if duration or aspect_ratio are missing
153153
# due to Elixir's comparison semantics
154-
response["duration"] <= 60 && response["aspect_ratio"] <= 0.85
154+
response["duration"] <= 180 && response["aspect_ratio"] <= 0.85
155155
end
156156
end
157157

test/pinchflat/yt_dlp/media_test.exs

+1-1
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ defmodule Pinchflat.YtDlp.MediaTest do
269269
response = %{
270270
"original_url" => "https://www.youtube.com/watch?v=TiZPUDkDYbk",
271271
"aspect_ratio" => 0.5,
272-
"duration" => 59,
272+
"duration" => 150,
273273
"upload_date" => "20210101"
274274
}
275275

0 commit comments

Comments
 (0)