homebrew-core/Formula/yle-dl.rb

76 lines
3.5 KiB
Ruby

class YleDl < Formula
include Language::Python::Virtualenv
desc "Download Yle videos from the command-line"
homepage "https://aajanki.github.io/yle-dl/index-en.html"
url "https://files.pythonhosted.org/packages/ae/7f/4682d0486ce1e3837f9503f0eecc3013e5d96ac222d2892abcd95687f500/yle-dl-20220830.tar.gz"
sha256 "e5e6b4527c2024aff3c37a96300741303419556292837ae30b3f51acf6732a72"
license "GPL-3.0-or-later"
head "https://github.com/aajanki/yle-dl.git", branch: "master"
bottle do
sha256 cellar: :any_skip_relocation, arm64_monterey: "4c2bc3c3aa041142b5b8668a2597b3de7c94479d6065b18c2bb26ceb9fb536af"
sha256 cellar: :any_skip_relocation, arm64_big_sur: "eba47946f2aded81e9375f2dd0a975afc0a6483c78d9947d304347ed894e3e80"
sha256 cellar: :any_skip_relocation, monterey: "e5f989783ce3f466ac83ce2db2d81b3cf1242be63716ef0e5229ba8f51b0e9e4"
sha256 cellar: :any_skip_relocation, big_sur: "71b570964eddcaf79b4b6e47e8f52a5d7613fdeda8e0b351df91d731e44b5f93"
sha256 cellar: :any_skip_relocation, catalina: "5afca4e60fba62dc447aaa27b225d2cbb37474ba6115842b8b8b0915d397f11e"
sha256 cellar: :any_skip_relocation, x86_64_linux: "e5ef4088f1b31b08c2d739543d2a1f21d155e66417263ef155146da53d03d71c"
end
depends_on "ffmpeg"
depends_on "python@3.10"
depends_on "rtmpdump"
uses_from_macos "libxslt"
resource "attrs" do
url "https://files.pythonhosted.org/packages/1a/cb/c4ffeb41e7137b23755a45e1bfec9cbb76ecf51874c6f1d113984ecaa32c/attrs-22.1.0.tar.gz"
sha256 "29adc2665447e5191d0e7c568fde78b21f9672d344281d0c6e1ab085429b22b6"
end
resource "certifi" do
url "https://files.pythonhosted.org/packages/cc/85/319a8a684e8ac6d87a1193090e06b6bbb302717496380e225ee10487c888/certifi-2022.6.15.tar.gz"
sha256 "84c85a9078b11105f04f3036a9482ae10e4621616db313fe045dd24743a0820d"
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 "ConfigArgParse" do
url "https://files.pythonhosted.org/packages/16/05/385451bc8d20a3aa1d8934b32bd65847c100849ebba397dbf6c74566b237/ConfigArgParse-1.5.3.tar.gz"
sha256 "1b0b3cbf664ab59dada57123c81eff3d9737e0d11d8cf79e3d6eb10823f1739f"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/62/08/e3fc7c8161090f742f504f40b1bccbfc544d4a4e09eb774bf40aafce5436/idna-3.3.tar.gz"
sha256 "9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"
end
resource "lxml" do
url "https://files.pythonhosted.org/packages/70/bb/7a2c7b4f8f434aa1ee801704bf08f1e53d7b5feba3d5313ab17003477808/lxml-4.9.1.tar.gz"
sha256 "fe749b052bb7233fe5d072fcb549221a8cb1a16725c47c37e42b0b9cb3ff2c3f"
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
def install
virtualenv_install_with_resources
end
test do
output = shell_output("#{bin}/yle-dl --showtitle https://areena.yle.fi/1-1570236")
assert_match "Traileri:", output
assert_match "2012-05-30T10:51", output
end
end