aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Formula/youtube-dl.rb
blob: efb364aa57afbb5ed6971d70f3c19790f8e8a9a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
require "formula"

# Please only update to versions that are published on PyPi as there are too
# many releases for us to update to every single one:
# https://pypi.python.org/pypi/youtube_dl
class YoutubeDl < Formula
  homepage "http://rg3.github.io/youtube-dl/"
  url "https://yt-dl.org/downloads/2014.04.21.6/youtube-dl-2014.04.21.6.tar.gz"
  sha1 "a78288e990b4d9f3708313ba6c53ebc323868527"

  depends_on "rtmpdump" => :optional

  def install
    system "make", "youtube-dl", "PREFIX=#{prefix}"
    bin.install "youtube-dl"
    man1.install "youtube-dl.1"
    bash_completion.install "youtube-dl.bash-completion"
  end

  def caveats
    "To use post-processing options, `brew install ffmpeg`."
  end

  test do
    system "#{bin}/youtube-dl", "--simulate", "http://www.youtube.com/watch?v=he2a4xK8ctk"
  end
end