Skip to content

Instantly share code, notes, and snippets.

@sapslaj
Last active December 8, 2015 16:11
Show Gist options
  • Select an option

  • Save sapslaj/edb51218357fa33b6c4c to your computer and use it in GitHub Desktop.

Select an option

Save sapslaj/edb51218357fa33b6c4c to your computer and use it in GitHub Desktop.
youtube-dl.rb example getting the filename
def download(url)
video = YoutubeDL.download(url)
video.filename # => "Adele - Hello-YQHsXMglC9A.f137.mp4"
video_with_title = Youtube.download(url, output: '%(title)s.%(ext)s')
video_with_title.filename # => "Adele - Hello.mp4"
title = YoutubeDL::Runner.new(url, get_title: true).run
title # => "Adele - Hello"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment