class YtDlp < Formula include Language::Python::Virtualenv desc "Feature-rich command-line audio/video downloader" homepage "https://github.com/yt-dlp/yt-dlp" url "https://files.pythonhosted.org/packages/47/c5/9972af4b472b0d55badf841ebafd2f98944cb0ae0f46e11d01f363ea5b91/yt_dlp-2026.7.4.tar.gz" sha256 "b094813404f87a9dd2186f00815231df32e5fd8a5403be0f807b3bb2d21a4432" license "Unlicense" compatibility_version 1 bottle do sha256 cellar: :any_skip_relocation, arm64_tahoe: "ad651b881a46884cf03b4f0ac50d6f0b68bacb5d53399b044836b1977c5c3d09" sha256 cellar: :any_skip_relocation, arm64_sequoia: "b5b0a32b475768167a1d418a2efab3460460fb94a5d02e68b51a5f4654a8c4d8" sha256 cellar: :any_skip_relocation, arm64_sonoma: "574000450b3c4110caef19b9437c06086a33d8ffc1da4042a95776c4bfd80ec5" sha256 cellar: :any_skip_relocation, sonoma: "f26aef35b7917210285c684f43709c8cd65810fda21982b1c8f8f03a9c2d98cd" sha256 cellar: :any, arm64_linux: "e9db309b2f9b21404bfb4d3ce946bc14865644c110a05a0a7bb2c7bf4efa4e13" sha256 cellar: :any, x86_64_linux: "ff38e3f015e366a1dfd8371abeec683d8016f5553a765ed7f8e22528e5354a9f" end head do url "https://github.com/yt-dlp/yt-dlp.git", branch: "master" depends_on "pandoc" => :build end depends_on "certifi" depends_on "deno" depends_on "python@3.14" pypi_packages package_name: "yt-dlp[default]", exclude_packages: "certifi" resource "brotli" do url "https://files.pythonhosted.org/packages/f7/16/c92ca344d646e71a43b8bb353f0a6490d7f6e06210f8554c8f874e454285/brotli-1.2.0.tar.gz" sha256 "e310f77e41941c13340a95976fe66a8a95b01e783d430eeaf7a2f87e0a57dd0a" end resource "charset-normalizer" do url "https://files.pythonhosted.org/packages/e7/a1/67fe25fac3c7642725500a3f6cfe5821ad557c3abb11c9d20d12c7008d3e/charset_normalizer-3.4.7.tar.gz" sha256 "ae89db9e5f98a11a4bf50407d4363e7b09b31e55bc117b4f7d80aab97ba009e5" end resource "idna" do url "https://files.pythonhosted.org/packages/cd/63/9496c57188a2ee585e0f1db071d75089a11e98aa86eb99d9d7618fc1edce/idna-3.18.tar.gz" sha256 "ffb385a7e039654cef1ab9ef32c6fafe283c0c0467bba1d9029738ce4a14a848" end resource "mutagen" do url "https://files.pythonhosted.org/packages/df/70/1675da133ea92227da41bf5b24e1c66be597ff736a1533ade41da986852f/mutagen-1.48.1.tar.gz" sha256 "8f95637ab9f6f305cec6bd1294e197debe207998e3e068596563c74f86b0a173" end resource "pycryptodomex" do url "https://files.pythonhosted.org/packages/c9/85/e24bf90972a30b0fcd16c73009add1d7d7cd9140c2498a68252028899e41/pycryptodomex-3.23.0.tar.gz" sha256 "71909758f010c82bc99b0abf4ea12012c98962fbf0583c2164f8b84533c2e4da" end resource "requests" do url "https://files.pythonhosted.org/packages/ac/c3/e2a2b89f2d3e2179abd6d00ebd70bff6273f37fb3e0cc209f48b39d00cbf/requests-2.34.2.tar.gz" sha256 "f288924cae4e29463698d6d60bc6a4da69c89185ad1e0bcc4104f584e960b9ed" end resource "urllib3" do url "https://files.pythonhosted.org/packages/53/0c/06f8b233b8fd13b9e5ee11424ef85419ba0d8ba0b3138bf360be2ff56953/urllib3-2.7.0.tar.gz" sha256 "231e0ec3b63ceb14667c67be60f2f2c40a518cb38b03af60abc813da26505f4c" end resource "websockets" do url "https://files.pythonhosted.org/packages/04/24/4b2031d72e840ce4c1ccb255f693b15c334757fc50023e4db9537080b8c4/websockets-16.0.tar.gz" sha256 "5f6261a5e56e8d5c42a4497b364ea24d94d9563e8fbd44e78ac40879c60179b5" end resource "yt-dlp-ejs" do url "https://files.pythonhosted.org/packages/d3/e6/cceb9530e8f4e5940f6f7822d90e9d94f1b85343329a16baaf47bbbb3de1/yt_dlp_ejs-0.8.0.tar.gz" sha256 "d5fa1639f63b5c4af8d932495f60689d5370f1a095782c944f7f62a303eb104e" end def install system "make", "lazy-extractors", "pypi-files" if build.head? virtualenv_install_with_resources bash_completion.install libexec/"share/bash-completion/completions/yt-dlp" zsh_completion.install libexec/"share/zsh/site-functions/_yt-dlp" fish_completion.install libexec/"share/fish/vendor_completions.d/yt-dlp.fish" end test do system bin/"yt-dlp", "https://raw.githubusercontent.com/Homebrew/brew/refs/heads/master/Library/Homebrew/test/support/fixtures/test.gif" system bin/"yt-dlp", "--simulate", "https://x.com/X/status/1922008207133671652" end end