Module: YtDlp
- Included in:
- YtDlp
- Defined in:
- lib/yt-dlp.rb,
lib/yt-dlp/video.rb,
lib/yt-dlp/runner.rb,
lib/yt-dlp/options.rb,
lib/yt-dlp/support.rb,
lib/yt-dlp/version.rb
Overview
Version file If you are updating this code, make sure you are updating lib/yt-dlp/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'
Instance Method Summary collapse
-
#binary_version ⇒ String
Returns yt-dlp’s version.
-
#download(urls, options = {}) ⇒ YtDlp::Video, Array
(also: #get)
Downloads given array of URLs with any options passed.
-
#extractors ⇒ Array
Lists extractors.
- #information(urls, options = {}) ⇒ Object
-
#user_agent ⇒ String
Returns user agent.
Methods included from Support
quoted, terrapin_line, usable_executable_path_for, which
Instance Method Details
#binary_version ⇒ String
Returns yt-dlp’s version
51 52 53 |
# File 'lib/yt-dlp.rb', line 51 def binary_version @binary_version ||= terrapin_line('--version').run.strip end |
#download(urls, options = {}) ⇒ YtDlp::Video, Array Also known as: get
Downloads given array of URLs with any options passed
23 24 25 26 27 28 29 |
# File 'lib/yt-dlp.rb', line 23 def download(urls, = {}) if urls.is_a? Array urls.map { |url| YtDlp::Video.get(url, ) } else YtDlp::Video.get(urls, ) # Urls should be singular but oh well. url = urls. There. Go cry in a corner. end end |
#extractors ⇒ Array
Lists extractors
44 45 46 |
# File 'lib/yt-dlp.rb', line 44 def extractors @extractors ||= terrapin_line('--list-extractors').run.split("\n") end |
#information(urls, options = {}) ⇒ Object
33 34 35 36 37 38 39 |
# File 'lib/yt-dlp.rb', line 33 def information(urls, = {}) if urls.is_a? Array urls.map { |url| YtDlp::Video.information(url, ) } else YtDlp::Video.information(urls, ) # Urls should be singular but oh well. url = urls. There. Go cry in a corner. end end |
#user_agent ⇒ String
Returns user agent
58 59 60 |
# File 'lib/yt-dlp.rb', line 58 def user_agent @user_agent ||= terrapin_line('--dump-user-agent').run.strip end |