83 lines
3.4 KiB
Ruby
83 lines
3.4 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/65/32/ec0bace91cc59001f75043611cc5693ee716e226e318c5143fe729c07994/svtplay-dl-2.2.tar.gz"
|
|
sha256 "5c21675a54ca1690e1ab19a116ba922818129e1994bb7379c084df2b03e287f0"
|
|
|
|
bottle do
|
|
cellar :any
|
|
sha256 "02b6f3f2b9a47033e3f660c4c03d5f239fbae31e626365757ce40dd4c6ce2b49" => :mojave
|
|
sha256 "426c6fe2fa8523c7449eff7c7977e454e738a0fffa58d7d1c8a7d428ea376216" => :high_sierra
|
|
sha256 "6964649a72a2b6de7e2d64850982f8c06a700c186abaa1f3a2d691c4f3259498" => :sierra
|
|
end
|
|
|
|
depends_on "openssl"
|
|
depends_on "python"
|
|
|
|
resource "six" do
|
|
url "https://files.pythonhosted.org/packages/dd/bf/4138e7bfb757de47d1f4b6994648ec67a51efe58fa907c1e11e350cddfca/six-1.12.0.tar.gz"
|
|
sha256 "d16a0141ec1a18405cd4ce8b4613101da75da0e9a7aec5bdd4fa804d0e0eba73"
|
|
end
|
|
|
|
resource "cryptography" do
|
|
url "https://files.pythonhosted.org/packages/c2/95/f43d02315f4ec074219c6e3124a87eba1d2d12196c2767fadfdc07a83884/cryptography-2.7.tar.gz"
|
|
sha256 "e6347742ac8f35ded4a46ff835c60e68c22a536a8ae5c4422966d06946b6d4c6"
|
|
end
|
|
|
|
resource "certifi" do
|
|
url "https://files.pythonhosted.org/packages/c5/67/5d0548226bcc34468e23a0333978f0e23d28d0b3f0c71a151aef9c3f7680/certifi-2019.6.16.tar.gz"
|
|
sha256 "945e3ba63a0b9f577b1395204e13c3a231f9bc0223888be653286534e5873695"
|
|
end
|
|
|
|
resource "chardet" do
|
|
url "https://files.pythonhosted.org/packages/fc/bb/a5768c230f9ddb03acc9ef3f0d4a3cf93462473795d18e9535498c8f929d/chardet-3.0.4.tar.gz"
|
|
sha256 "84ab92ed1c4d4f16916e05906b6b75a6c0fb5db821cc65e70cbd64a3e2a5eaae"
|
|
end
|
|
|
|
resource "idna" do
|
|
url "https://files.pythonhosted.org/packages/ad/13/eb56951b6f7950cadb579ca166e448ba77f9d24efc03edd7e55fa57d04b7/idna-2.8.tar.gz"
|
|
sha256 "c357b3f628cf53ae2c4c05627ecc484553142ca23264e593d327bcde5e9c3407"
|
|
end
|
|
|
|
resource "PySocks" do
|
|
url "https://files.pythonhosted.org/packages/15/ab/35824cfdee1aac662e3298275fa1e6cbedb52126d1785f8977959b769ccf/PySocks-1.7.0.tar.gz"
|
|
sha256 "d9031ea45fdfacbe59a99273e9f0448ddb33c1580fe3831c1b09557c5718977c"
|
|
end
|
|
|
|
resource "requests" do
|
|
url "https://files.pythonhosted.org/packages/01/62/ddcf76d1d19885e8579acb1b1df26a852b03472c0e46d2b959a714c90608/requests-2.22.0.tar.gz"
|
|
sha256 "11e007a8a2aa0323f5a921e9e6a2d7e4e67d9877e85773fba9ba6419025cbeb4"
|
|
end
|
|
|
|
resource "urllib3" do
|
|
url "https://files.pythonhosted.org/packages/4c/13/2386233f7ee40aa8444b47f7463338f3cbdf00c316627558784e3f542f07/urllib3-1.25.3.tar.gz"
|
|
sha256 "dbe59173209418ae49d485b87d1681aefa36252ee85884c31346debd19463232"
|
|
end
|
|
|
|
resource "pyyaml" do
|
|
url "https://files.pythonhosted.org/packages/e3/e8/b3212641ee2718d556df0f23f78de8303f068fe29cdaa7a91018849582fe/PyYAML-5.1.2.tar.gz"
|
|
sha256 "01adf0b6c6f61bd11af6e10ca52b7d4057dd0be0343eb9283c878cf3af56aee4"
|
|
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
|