Module: YoutubeDL
- Included in:
- YoutubeDL
- Defined in:
- lib/youtube-dl.rb,
lib/youtube-dl/video.rb,
lib/youtube-dl/runner.rb,
lib/youtube-dl/options.rb,
lib/youtube-dl/support.rb,
lib/youtube-dl/version.rb
Overview
Version file If you are updating this code, make sure you are updating lib/youtube-dl/version.rb as well as the Rakefile.
Defined Under Namespace
Modules: Support Classes: Options, Runner, Video
Constant Summary collapse
- VERSION =
Semantic Version as well as the bundled binary version. “(major).(minor).(teeny).(pre-release).(binary-version)”
'0.3.1.2016.09.11.1'.freeze
Instance Method Summary collapse
-
#binary_version ⇒ String
Returns youtube-dl’s version.
-
#download(urls, options = {}) ⇒ YoutubeDL::Video, Array
(also: #get)
Downloads given array of URLs with any options passed.
-
#extractors ⇒ Array
Lists extractors.
-
#user_agent ⇒ String
Returns user agent.
Methods included from Support
cocaine_line, quoted, usable_executable_path_for, which
Instance Method Details
#binary_version ⇒ String
Returns youtube-dl’s version
41 42 43 |
# File 'lib/youtube-dl.rb', line 41 def binary_version @binary_version ||= cocaine_line('--version').run.strip end |
#download(urls, options = {}) ⇒ YoutubeDL::Video, Array Also known as: get
Downloads given array of URLs with any options passed
21 22 23 24 25 26 27 |
# File 'lib/youtube-dl.rb', line 21 def download(urls, = {}) if urls.is_a? Array urls.map { |url| YoutubeDL::Video.get(url, ) } else YoutubeDL::Video.get(urls, ) # Urls should be singular but oh well. url = urls. There. Go cry in a corner. end end |
#extractors ⇒ Array
Lists extractors
34 35 36 |
# File 'lib/youtube-dl.rb', line 34 def extractors @extractors ||= cocaine_line('--list-extractors').run.split("\n") end |
#user_agent ⇒ String
Returns user agent
48 49 50 |
# File 'lib/youtube-dl.rb', line 48 def user_agent @user_agent ||= cocaine_line('--dump-user-agent').run.strip end |