homebrew-core/Formula/yt-dlp.rb

67 lines
3.2 KiB
Ruby

class YtDlp < Formula
include Language::Python::Virtualenv
desc "Fork of youtube-dl with additional features and fixes"
homepage "https://github.com/yt-dlp/yt-dlp"
url "https://files.pythonhosted.org/packages/06/60/c4146cecfe7f480fc3cb1a8608ba123b7c1e0b74813db77b8f04fd7a7280/yt-dlp-2022.5.18.tar.gz"
sha256 "3a7b59d2fb4b39ce8ba8e0b9c5a37fe20e5624f46a2346b4ae66ab1320e35134"
license "Unlicense"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "8f63849abe19e91012e0b5fcd909b181279e952e916582bc2a1cbfb055166af0"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "d693bcef7b6006197b4c74a7d02fdbc0b28b678faf4fd03c3e3eb24614f54003"
sha256 cellar: :any_skip_relocation, monterey: "b92d4d5aa770eaaafb4dbef5ff0c80f83e2068bd6fc26665739a1cfe4457b9db"
sha256 cellar: :any_skip_relocation, big_sur: "4a64c1860c682ceb7d580cf252ed3411041c66bcc5cedf6b5757e1b27e17c386"
sha256 cellar: :any_skip_relocation, catalina: "1769d05051e03e9b4cdd6df8ebf2fe5a1678806199bceb9fdf44d4f2f497c299"
sha256 cellar: :any_skip_relocation, x86_64_linux: "d1d9601761bf800cd44ec964834ef887a75dc4eba0d694dc864bdcc227818349"
end
head do
url "https://github.com/yt-dlp/yt-dlp.git", branch: "master"
depends_on "pandoc" => :build
end
depends_on "python@3.10"
resource "Brotli" do
url "https://files.pythonhosted.org/packages/2a/18/70c32fe9357f3eea18598b23aa9ed29b1711c3001835f7cf99a9818985d0/Brotli-1.0.9.zip"
sha256 "4d1b810aa0ed773f81dceda2cc7b403d01057458730e309856356d4ef4188438"
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/6c/ae/d26450834f0acc9e3d1f74508da6df1551ceab6c2ce0766a593362d6d57f/certifi-2021.10.8.tar.gz"
sha256 "78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872"
end
resource "mutagen" do
url "https://files.pythonhosted.org/packages/f3/d9/2232a4cb9a98e2d2501f7e58d193bc49c956ef23756d7423ba1bd87e386d/mutagen-1.45.1.tar.gz"
sha256 "6397602efb3c2d7baebd2166ed85731ae1c1d475abca22090b7141ff5034b3e1"
end
resource "pycryptodomex" do
url "https://files.pythonhosted.org/packages/24/40/e249ac3845a2333ce50f1bb02299ffb766babdfe80ca9d31e0158ad06afd/pycryptodomex-3.14.1.tar.gz"
sha256 "2ce76ed0081fd6ac8c74edc75b9d14eca2064173af79843c24fa62573263c1f2"
end
resource "websockets" do
url "https://files.pythonhosted.org/packages/f8/a3/622d9acbfb9a71144b5d7609906bc648c62e3ca5fdbb1c8cca222949d82c/websockets-10.3.tar.gz"
sha256 "fc06cc8073c8e87072138ba1e431300e2d408f054b27047d047b549455066ff4"
end
def install
system "make", "pypi-files" if build.head?
virtualenv_install_with_resources
man1.install_symlink libexec/"share/man/man1/yt-dlp.1"
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
# "History of homebrew-core", uploaded 3 Feb 2020
system "#{bin}/yt-dlp", "--simulate", "https://www.youtube.com/watch?v=pOtd1cbOP7k"
# "homebrew", playlist last updated 3 Mar 2020
system "#{bin}/yt-dlp", "--simulate", "--yes-playlist", "https://www.youtube.com/watch?v=pOtd1cbOP7k&list=PLMsZ739TZDoLj9u_nob8jBKSC-mZb0Nhj"
end
end