92 lines
3.9 KiB
Ruby
92 lines
3.9 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/11/33/a0b88b83e47aab139d17b9abf196e670986252533a4ebc54b84deaf2c9c2/svtplay-dl-3.8.tar.gz"
|
|
sha256 "321035b3e7e8fc41eefc9ad1c9762c639b8d03230fe1babdffc7e8b19acccf32"
|
|
license "MIT"
|
|
|
|
bottle do
|
|
sha256 cellar: :any, arm64_big_sur: "197060e2390b4dbf0f3d8a34e7ae76cd575e6e03decad45b2e2721a6e0572c8a"
|
|
sha256 cellar: :any, big_sur: "aca99bc3720ca135adfb7a5bb06e97b15864f3a1dcc77e2df4bf59053983d850"
|
|
sha256 cellar: :any, catalina: "8d55a7dbb0d0e8a9a6b97b3925324c8cd9ab8874272d7ec9eace827d0c65689e"
|
|
sha256 cellar: :any, mojave: "9a4e9cdf935f93fdbfaa852c7c06b37461f13804ae82299d047617b0ec4a08fd"
|
|
end
|
|
|
|
depends_on "rust" => :build
|
|
depends_on "openssl@1.1"
|
|
depends_on "python@3.9"
|
|
|
|
resource "certifi" do
|
|
url "https://files.pythonhosted.org/packages/06/a9/cd1fd8ee13f73a4d4f491ee219deeeae20afefa914dfb4c130cfc9dc397a/certifi-2020.12.5.tar.gz"
|
|
sha256 "1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c"
|
|
end
|
|
|
|
resource "cffi" do
|
|
url "https://files.pythonhosted.org/packages/a8/20/025f59f929bbcaa579704f443a438135918484fffaacfaddba776b374563/cffi-1.14.5.tar.gz"
|
|
sha256 "fd78e5fee591709f32ef6edb9a015b4aa1a5022598e36227500c8f4e02328d9c"
|
|
end
|
|
|
|
resource "chardet" do
|
|
url "https://files.pythonhosted.org/packages/ee/2d/9cdc2b527e127b4c9db64b86647d567985940ac3698eeabc7ffaccb4ea61/chardet-4.0.0.tar.gz"
|
|
sha256 "0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa"
|
|
end
|
|
|
|
resource "cryptography" do
|
|
url "https://files.pythonhosted.org/packages/9b/77/461087a514d2e8ece1c975d8216bc03f7048e6090c5166bc34115afdaa53/cryptography-3.4.7.tar.gz"
|
|
sha256 "3d10de8116d25649631977cb37da6cbdd2d6fa0e0281d014a5b7d337255ca713"
|
|
end
|
|
|
|
resource "idna" do
|
|
url "https://files.pythonhosted.org/packages/ea/b7/e0e3c1c467636186c39925827be42f16fee389dc404ac29e930e9136be70/idna-2.10.tar.gz"
|
|
sha256 "b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6"
|
|
end
|
|
|
|
resource "pycparser" do
|
|
url "https://files.pythonhosted.org/packages/0f/86/e19659527668d70be91d0369aeaa055b4eb396b0f387a4f92293a20035bd/pycparser-2.20.tar.gz"
|
|
sha256 "2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"
|
|
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/a0/a4/d63f2d7597e1a4b55aa3b4d6c5b029991d3b824b5bd331af8d4ab1ed687d/PyYAML-5.4.1.tar.gz"
|
|
sha256 "607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"
|
|
end
|
|
|
|
resource "requests" do
|
|
url "https://files.pythonhosted.org/packages/6b/47/c14abc08432ab22dc18b9892252efaf005ab44066de871e72a38d6af464b/requests-2.25.1.tar.gz"
|
|
sha256 "27973dd4a904a4f13b263a19c866c13b92a39ed1c964655f025f3f8d3d75b804"
|
|
end
|
|
|
|
resource "urllib3" do
|
|
url "https://files.pythonhosted.org/packages/cb/cf/871177f1fc795c6c10787bc0e1f27bb6cf7b81dbde399fd35860472cecbc/urllib3-1.26.4.tar.gz"
|
|
sha256 "e7b021f7241115872f92f43c6508082facffbd1c048e3c6e2bb9c2a157e28937"
|
|
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
|