Last active
December 8, 2015 16:11
-
-
Save sapslaj/edb51218357fa33b6c4c to your computer and use it in GitHub Desktop.
youtube-dl.rb example getting the filename
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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