forked from Homebrew/homebrew-core
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes Homebrew#68693. Signed-off-by: rui <[email protected]> Signed-off-by: Carlo Cabrera <[email protected]>
- Loading branch information
Showing
1 changed file
with
48 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
class GalleryDl < Formula | ||
include Language::Python::Virtualenv | ||
|
||
desc "Command-line downloader for image-hosting site galleries and collections" | ||
homepage "https://github.com/mikf/gallery-dl" | ||
url "https://files.pythonhosted.org/packages/7e/bb/09e57d6ea4d478331bf6b344e0c4fcc276b99ff7d80e65d2e1f2a09aa936/gallery_dl-1.16.3.tar.gz" | ||
sha256 "5926794d7a602cb9d4edf0a2094b266b790033db0a62689fa01e5272d7388587" | ||
license "GPL-2.0-only" | ||
head "https://github.com/mikf/gallery-dl.git" | ||
|
||
depends_on "[email protected]" | ||
|
||
resource "certifi" do | ||
url "https://files.pythonhosted.org/packages/06/a9/cd1fd8ee13f73a4d4f491ee219deeeae20afefa914dfb4c130cfc9dc397a/certifi-2020.12.5.tar.gz" | ||
sha256 "1a4995114262bffbc2413b159f2a1a480c969de6e6eb13ee966d470af86af59c" | ||
end | ||
|
||
resource "chardet" do | ||
url "https://files.pythonhosted.org/packages/ee/2d/9cdc2b527e127b4c9db64b86647d567985940ac3698eeabc7ffaccb4ea61/chardet-4.0.0.tar.gz" | ||
sha256 "0d6f53a15db4120f2b08c94f11e7d93d2c911ee118b6b30a04ec3ee8310179fa" | ||
end | ||
|
||
resource "idna" do | ||
url "https://files.pythonhosted.org/packages/ea/b7/e0e3c1c467636186c39925827be42f16fee389dc404ac29e930e9136be70/idna-2.10.tar.gz" | ||
sha256 "b307872f855b18632ce0c21c5e45be78c0ea7ae4c15c828c20788b26921eb3f6" | ||
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/29/e6/d1a1d78c439cad688757b70f26c50a53332167c364edb0134cadd280e234/urllib3-1.26.2.tar.gz" | ||
sha256 "19188f96923873c92ccb987120ec4acaa12f0461fa9ce5d3d0772bc965a39e08" | ||
end | ||
|
||
def install | ||
virtualenv_install_with_resources | ||
end | ||
|
||
test do | ||
system bin/"gallery-dl", "https://imgur.com/a/dyvohpF" | ||
expected_sum = "126fa3d13c112c9c49d563b00836149bed94117edb54101a1a4d9c60ad0244be" | ||
file_sum = Digest::SHA256.hexdigest File.read(testpath/"gallery-dl/imgur/dyvohpF/imgur_dyvohpF_001_ZTZ6Xy1.png") | ||
assert_equal expected_sum, file_sum | ||
end | ||
end |