From cb7f39eaeab4ce6634adf4f37a5bd88e4bb0d3c7 Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Thu, 20 Feb 2025 15:30:29 -0800 Subject: [PATCH 1/2] Update youtube shorts detection to support youtube pants --- lib/pinchflat/yt_dlp/media.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pinchflat/yt_dlp/media.ex b/lib/pinchflat/yt_dlp/media.ex index d936041c..9abf8e59 100644 --- a/lib/pinchflat/yt_dlp/media.ex +++ b/lib/pinchflat/yt_dlp/media.ex @@ -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 From 518ea01a6d3fd2f4bf15bffbc939cf22cf65657b Mon Sep 17 00:00:00 2001 From: Kieran Eglin Date: Thu, 20 Feb 2025 15:31:19 -0800 Subject: [PATCH 2/2] Updates a test --- test/pinchflat/yt_dlp/media_test.exs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/pinchflat/yt_dlp/media_test.exs b/test/pinchflat/yt_dlp/media_test.exs index 70dc26e0..4f5025d7 100644 --- a/test/pinchflat/yt_dlp/media_test.exs +++ b/test/pinchflat/yt_dlp/media_test.exs @@ -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" }