79 lines
3.2 KiB
Ruby
79 lines
3.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/1f/95/5ef43ad627206dbfbca43e377a855a37aa8d005f136ff43974ba6b30fd3e/svtplay-dl-2.1.tar.gz"
|
|
sha256 "acac0cb6435e3243b98b154958d799cbb65b64335cd0e2bfb1ae0a81b640c17c"
|
|
|
|
bottle do
|
|
cellar :any_skip_relocation
|
|
sha256 "85060c9198141d0c704d33dc40478245b0c6acca2ec0a0ab6a98395a8ee11b1c" => :mojave
|
|
sha256 "6aadadb0d4b41e792d67f833997d667844bcd41bed1d867f9f8e6207912dad04" => :high_sierra
|
|
sha256 "b73aadf29b0db1d2eee80d9659c1c51651911a18363a1104ff4995ee48520034" => :sierra
|
|
end
|
|
|
|
depends_on "openssl"
|
|
depends_on "python"
|
|
depends_on "rtmpdump"
|
|
|
|
resource "pycryptodome" do
|
|
url "https://files.pythonhosted.org/packages/46/57/3901d4d3c03c3a7cefc570c01dfca3ec5eb086fc6e918b4aa451cb63fcdf/pycryptodome-3.7.0.tar.gz"
|
|
sha256 "4444a26fc3830c0d438bca6975ff10d1eb9c0b88f747fdc25b5ab81fb46713d7"
|
|
end
|
|
|
|
resource "certifi" do
|
|
url "https://files.pythonhosted.org/packages/41/b6/4f0cefba47656583217acd6cd797bc2db1fede0d53090fdc28ad2c8e0716/certifi-2018.10.15.tar.gz"
|
|
sha256 "6d58c986d22b038c8c0df30d639f23a3e6d172a05c3583e766f4c0b785c0986a"
|
|
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/65/c4/80f97e9c9628f3cac9b98bfca0402ede54e0563b56482e3e6e45c43c4935/idna-2.7.tar.gz"
|
|
sha256 "684a38a6f903c1d71d6d5fac066b58d7768af4de2b832e426ec79c30daa94a16"
|
|
end
|
|
|
|
resource "PySocks" do
|
|
url "https://files.pythonhosted.org/packages/53/12/6bf1d764f128636cef7408e8156b7235b150ea31650d0260969215bb8e7d/PySocks-1.6.8.tar.gz"
|
|
sha256 "3fe52c55890a248676fd69dc9e3c4e811718b777834bcaab7a8125cf9deac672"
|
|
end
|
|
|
|
resource "requests" do
|
|
url "https://files.pythonhosted.org/packages/97/10/92d25b93e9c266c94b76a5548f020f3f1dd0eb40649cb1993532c0af8f4c/requests-2.20.0.tar.gz"
|
|
sha256 "99dcfdaaeb17caf6e526f32b6a7b780461512ab3f1d992187801694cba42770c"
|
|
end
|
|
|
|
resource "urllib3" do
|
|
url "https://files.pythonhosted.org/packages/b1/53/37d82ab391393565f2f831b8eedbffd57db5a718216f82f1a8b4d381a1c1/urllib3-1.24.1.tar.gz"
|
|
sha256 "de9529817c93f27c8ccbfead6985011db27bd0ddfcdb2d86f3f663385c6a9c22"
|
|
end
|
|
|
|
resource "pyyaml" do
|
|
url "https://files.pythonhosted.org/packages/9e/a3/1d13970c3f36777c583f136c136f804d70f500168edc1edea6daa7200769/PyYAML-3.13.tar.gz"
|
|
sha256 "3ef3092145e9b70e3ddd2c7ad59bdd0252a94dfe3949721633e41344de00a6bf"
|
|
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
|