Created
March 2, 2013 13:39
-
-
Save neurotech/5071025 to your computer and use it in GitHub Desktop.
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
| require "viddl-rb" | |
| ViddlRb.io = $stdout | |
| Shoes.app :title => 'Viddl', :width => 300, :height => 150, :margin => 10, :resizable => false do | |
| stack do | |
| para "Enter Video URL:" | |
| edit_line do |e| | |
| @url = e.text | |
| end | |
| button "Save to..." do | |
| destination = ask_open_folder | |
| end | |
| end | |
| button "Download!" do | |
| begin | |
| ViddlRb.get_urls(@url) | |
| rescue ViddlRb::DownloadError => e | |
| alert "Could not get download url: #{e.message}" | |
| rescue ViddlRb::PluginError => e | |
| alert "Plugin blew up! #{e.message}\n" + "Backtrace:\n#{e.backtrace.join("\n")}" | |
| end | |
| end | |
| end |
Author
Right. Should I just use Shoes' own Download on the URL returned by ViddlRb.get_urls, or can I do that with viddl-rb?
You MIGHT run into problems trying to download this yourself.
Some providers expect certain User-Agents when downloading (and youtube needs a few retries sometimes).
You can certainly give the shoes downloader a try, but depending on what you try to do in the end, shelling out to viddl-rb might not be the worst thing.
The "library"-functionality of viddl-rb is more of an afterthought :)
Author
This is mainly a personal "hobby" program to make it easy to get YouTube videos as audio files.
Is it possible to call the CLI for viddl-rb from ruby?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This will just give you the URLs it found.