Class: YoutubeDownloader

Inherits:
Object
  • Object
show all
Defined in:
lib/youtube_downloader.rb

Class Method Summary collapse

Class Method Details

.download_audio(url, outdir, filename) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/youtube_downloader.rb', line 3

def self.download_audio(url, outdir, filename)
  system "    cd \#{outdir} && \\\n    youtube-dl \\\n        --extract-audio \\\n        --prefer-ffmpeg \\\n        --audio-format mp3 \\\n        --yes-playlist \\\n        --output \#{filename} \\\n        --audio-quality 3 \\\n      \#{url} \\\n      &>/dev/null\n  SH\nend\n"

.download_playlist(url, outdir, filename) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/youtube_downloader.rb', line 18

def self.download_playlist(url, outdir, filename)
  system "    cd \#{outdir} && \\\n    youtube-dl \\\n        --extract-audio \\\n        --prefer-ffmpeg \\\n        --audio-format mp3 \\\n        --audio-quality 3 \\\n        --output \#{filename} \\\n      \#{url} \\\n      &>/dev/null\n  SH\nend\n"