homebrew-core/Formula/svtplay-dl.rb

94 lines
4.2 KiB
Ruby

class SvtplayDl < Formula
include Language::Python::Virtualenv
desc "Download videos from https://www.svtplay.se/"
homepage "https://svtplay-dl.se/"
url "https://files.pythonhosted.org/packages/de/14/adbf488e846e76b2a6cfcb9ae19549bd0e6852ad2d9389b449284d010df4/svtplay-dl-4.10.tar.gz"
sha256 "2a7e764f3ec6eaee097010626e11b039310babd89b1f2ae39eedf4aeb19b6b0a"
license "MIT"
bottle do
sha256 cellar: :any, arm64_monterey: "a4d6de81c1d8735b838cd23c2ce3b4b1d72c5403419c75c47cf46c53aa95b39a"
sha256 cellar: :any, arm64_big_sur: "f660e5368a6c939e8a0fb6e2fbfcb1b0b8a0bc202af26bf9ad4747abcf011b3d"
sha256 cellar: :any, monterey: "af454c841097eb1ef47e1e1534d02c8c7073ff790fc6287fe0bcc94d0fd374a4"
sha256 cellar: :any, big_sur: "aee1f31b4801c93ee34d8f44024c8f3564332653c923660f35aaf2cdfc88f1cf"
sha256 cellar: :any, catalina: "c020edcde683363492ec065b220f7ef9b33598622edd6c64f72fb4fda915670d"
sha256 cellar: :any_skip_relocation, x86_64_linux: "6dcc5c04941db7cd2797b459c25438cd6eecdf3fa3aa76cd85dca6dd897348d8"
end
depends_on "rust" => :build
depends_on "openssl@1.1"
depends_on "python@3.10"
resource "certifi" do
url "https://files.pythonhosted.org/packages/6c/ae/d26450834f0acc9e3d1f74508da6df1551ceab6c2ce0766a593362d6d57f/certifi-2021.10.8.tar.gz"
sha256 "78884e7c1d4b00ce3cea67b44566851c4343c120abd683433ce934a68ea58872"
end
resource "cffi" do
url "https://files.pythonhosted.org/packages/00/9e/92de7e1217ccc3d5f352ba21e52398372525765b2e0c4530e6eb2ba9282a/cffi-1.15.0.tar.gz"
sha256 "920f0d66a896c2d99f0adbb391f990a84091179542c205fa53ce5787aff87954"
end
resource "charset-normalizer" do
url "https://files.pythonhosted.org/packages/68/e4/e014e7360fc6d1ccc507fe0b563b4646d00e0d4f9beec4975026dd15850b/charset-normalizer-2.0.9.tar.gz"
sha256 "b0b883e8e874edfdece9c28f314e3dd5badf067342e42fb162203335ae61aa2c"
end
resource "cryptography" do
url "https://files.pythonhosted.org/packages/f9/4b/1cf8e281f7ae4046a59e5e39dd7471d46db9f61bb564fddbff9084c4334f/cryptography-36.0.1.tar.gz"
sha256 "53e5c1dc3d7a953de055d77bef2ff607ceef7a2aac0353b5d630ab67f7423638"
end
resource "idna" do
url "https://files.pythonhosted.org/packages/62/08/e3fc7c8161090f742f504f40b1bccbfc544d4a4e09eb774bf40aafce5436/idna-3.3.tar.gz"
sha256 "9d643ff0a55b762d5cdb124b8eaa99c66322e2157b69160bc32796e824360e6d"
end
resource "pycparser" do
url "https://files.pythonhosted.org/packages/5e/0b/95d387f5f4433cb0f53ff7ad859bd2c6051051cebbb564f139a999ab46de/pycparser-2.21.tar.gz"
sha256 "e644fdec12f7872f86c58ff790da456218b10f863970249516d60a5eaca77206"
end
resource "PySocks" do
url "https://files.pythonhosted.org/packages/bd/11/293dd436aea955d45fc4e8a35b6ae7270f5b8e00b53cf6c024c83b657a11/PySocks-1.7.1.tar.gz"
sha256 "3f8804571ebe159c380ac6de37643bb4685970655d3bba243530d6558b799aa0"
end
resource "PyYAML" do
url "https://files.pythonhosted.org/packages/36/2b/61d51a2c4f25ef062ae3f74576b01638bebad5e045f747ff12643df63844/PyYAML-6.0.tar.gz"
sha256 "68fb519c14306fec9720a2a5b45bc9f0c8d1b9c72adf45c37baedfcd949c35a2"
end
resource "requests" do
url "https://files.pythonhosted.org/packages/e7/01/3569e0b535fb2e4a6c384bdbed00c55b9d78b5084e0fb7f4d0bf523d7670/requests-2.26.0.tar.gz"
sha256 "b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7"
end
resource "urllib3" do
url "https://files.pythonhosted.org/packages/80/be/3ee43b6c5757cabea19e75b8f46eaf05a2f5144107d7db48c7cf3a864f73/urllib3-1.26.7.tar.gz"
sha256 "4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece"
end
def install
virtualenv_install_with_resources
end
def caveats
<<~EOS
To use post-processing options:
`brew install ffmpeg` or `brew install libav`.
EOS
end
test do
url = "https://tv.aftonbladet.se/abtv/articles/244248"
match = <<~EOS
https://absvpvod-vh.akamaihd.net/i/2018/02/cdaefe0533c2561f00a41c52a2d790bd
/,1280_720_2800,960_540_1500,640_360_800,480_270_300,.mp4.csmil
/index_0_av.m3u8
EOS
assert_match match.delete!("\n"), shell_output("#{bin}/svtplay-dl -g #{url}")
end
end