homebrew-core/Formula/streamlink.rb

102 lines
4.9 KiB
Ruby

class Streamlink < Formula
include Language::Python::Virtualenv
desc "CLI for extracting streams from various websites to a video player"
homepage "https://streamlink.github.io/"
url "https://files.pythonhosted.org/packages/e6/7b/54dc30d9f9b3547a2d8112f5e7a166de5aebbb42f87819cdad2a0bb5bcdf/streamlink-5.1.0.tar.gz"
sha256 "950f81602e26d796aa0d0d3fcb3cfb9e069ee884c3857cc2d1e4d54a5bc13fdf"
license "BSD-2-Clause"
head "https://github.com/streamlink/streamlink.git", branch: "master"
bottle do
sha256 cellar: :any, arm64_ventura: "225213ce13d4a73b242a7f07c39ab8c513398e581abd141a4d0fb165cf0206ca"
sha256 cellar: :any, arm64_monterey: "084b22e72bae985614ed7bde1112be392eda131a1af44671ba3ad626109e80b6"
sha256 cellar: :any, arm64_big_sur: "86654e260d11761340368c807d2ccfb98997e88af4720337ec6ff31effd82c4f"
sha256 cellar: :any, ventura: "35ac6199c4378355a1a5e8a7c1094294d4e6e63674453124e33cb26bc686e469"
sha256 cellar: :any, monterey: "b0fa70c8fe455dae4138c2abea88d2b82e5221b3c2e1eb8e3a1111c1cca671b6"
sha256 cellar: :any, big_sur: "b585fa39dec2a6f31aa5450db5ee26b6e4cd50269a94fff908d312fa2148b9cf"
sha256 cellar: :any, catalina: "de27603fff59fda5b64a0926c48f7bc73e69af69aee7a65480896420a1c7e7aa"
sha256 cellar: :any_skip_relocation, x86_64_linux: "ffeed540d04cc5539b4a6707711ee1e35670d69cc3e8cf92ab1976e92e58ddcd"
end
depends_on "libxml2" # https://github.com/Homebrew/homebrew-core/issues/98468
depends_on "python@3.11"
depends_on "six"
uses_from_macos "libffi"
uses_from_macos "libxslt"
on_linux do
depends_on "pkg-config" => :build
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/cb/a4/7de7cd59e429bd0ee6521ba58a75adaec136d32f91a761b28a11d8088d44/certifi-2022.9.24.tar.gz"
sha256 "0d9c601124e5a6ba9712dbc60d9c53c21e34f5f641fe83002317394311bdce14"
end
resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/a1/34/44964211e5410b051e4b8d2869c470ae8a68ae274953b1c7de6d98bbcf94/charset-normalizer-2.1.1.tar.gz"
sha256 "5a3d016c7c547f69d6f81fb0db9449ce888b418b5b9952cc5e6e66843e9dd845"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/8b/e1/43beb3d38dba6cb420cefa297822eac205a277ab43e5ba5d5c46faf96438/idna-3.4.tar.gz"
sha256 "814f528e8dead7d329833b91c5faa87d60bf71824cd12a7530b5526063d02cb4"
end
resource "isodate" do
url "https://files.pythonhosted.org/packages/db/7a/c0a56c7d56c7fa723988f122fa1f1ccf8c5c4ccc48efad0d214b49e5b1af/isodate-0.6.1.tar.gz"
sha256 "48c5881de7e8b0a0d648cb024c8062dc84e7b840ed81e864c7614fd3c127bde9"
end
resource "lxml" do
url "https://files.pythonhosted.org/packages/70/bb/7a2c7b4f8f434aa1ee801704bf08f1e53d7b5feba3d5313ab17003477808/lxml-4.9.1.tar.gz"
sha256 "fe749b052bb7233fe5d072fcb549221a8cb1a16725c47c37e42b0b9cb3ff2c3f"
end
resource "pycountry" do
url "https://files.pythonhosted.org/packages/33/24/033604d30f6cf82d661c0f9dfc2c71d52cafc2de516616f80d3b0600cb7c/pycountry-22.3.5.tar.gz"
sha256 "b2163a246c585894d808f18783e19137cb70a0c18fb36748dc01fc6f109c1646"
end
resource "pycryptodome" do
url "https://files.pythonhosted.org/packages/11/e4/a8e8056a59c39f8c9ddd11d3bc3e1a67493abe746df727e531f66ecede9e/pycryptodome-3.15.0.tar.gz"
sha256 "9135dddad504592bcc18b0d2d95ce86c3a5ea87ec6447ef25cfedea12d6018b8"
end
resource "PySocks" do
url "https://files.pythonhosted.org/packages/bd/11/293dd436aea955d45fc4e8a35b6ae7270f5b8e00b53cf6c024c83b657a11/PySocks-1.7.1.tar.gz"
sha256 "3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/a5/61/a867851fd5ab77277495a8709ddda0861b28163c4613b011bc00228cc724/requests-2.28.1.tar.gz"
sha256 "7c5599b102feddaa661c826c56ab4fee28bfd17f5abca1ebbe3e7f19d7c97983"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/b2/56/d87d6d3c4121c0bcec116919350ca05dc3afd2eeb7dc88d07e8083f8ea94/urllib3-1.26.12.tar.gz"
sha256 "3fa96cf423e6987997fc326ae8df396db2a8b7c667747d47ddd8ecba91f4a74e"
end
resource "websocket-client" do
url "https://files.pythonhosted.org/packages/75/af/1d13b93e7a21aca7f8ab8645fcfcfad21fc39716dc9dce5dc2a97f73ff78/websocket-client-1.4.2.tar.gz"
sha256 "d6e8f90ca8e2dd4e8027c4561adeb9456b54044312dba655e7cae652ceb9ae59"
end
def install
virtualenv_install_with_resources
man1.install_symlink libexec/"share/man/man1/streamlink.1"
end
test do
system "#{bin}/streamlink", "https://vimeo.com/189776460", "360p", "-o", "video.mp4"
assert_match "video.mp4: ISO Media, MP4 v2", shell_output("file video.mp4")
output = shell_output("#{bin}/streamlink -l debug 'https://ok.ru/video/3388934659879'")
assert_match "Available streams:", output
refute_match "error", output
refute_match "Could not find metadata", output
end
end