Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Ok so I found this answer to someones question about how to download youtube videos via youtube-dl. It had all of the information that I needed, except how to open the video.

Here is what I have so far:

sudo apt-get update
sudo apt-get install youtube-dl
youtube-dl youtube-video-link

It downloads ok, I just don't know how to open it. Again, thanks for your help.

share|improve this question
1  
Double click over file? –  Lucio May 4 at 23:36
    
No it is not a link, it is a terminal program. –  BJsgoodlife May 4 at 23:38
    
So you do youtube-dl URL, where URL is the URL of the video. –  Nattgew May 4 at 23:39
    
Yes I did this too, all it says is the video has already been downloaded. What I am wondering is how to open the downloaded video. –  BJsgoodlife May 4 at 23:42
    
"I found this answer to someones question" Could you give the link? This answer is what you are looking for. –  Lucio May 4 at 23:43

3 Answers 3

up vote 1 down vote accepted

You can specify the directory where the video will be saved using the -o option.

Example:

youtube-dl -o "/home/<User>/Downloads/%(title)s" {URL}

The syntax to open any file in its default application is:

xdg-open $file

If you are using VLC player, you can use so:

cd /path/videos
vlc "Videoname.avi"

If VLC Player is not installed, you can install it so:

sudo add-apt-repository ppa:videolan/stable-daily
sudo apt-get update
sudo apt-get install vlc
share|improve this answer

Ok I found the answer. As Lucio stated, you double click on the file, I just didn't know where to find it to do this, and it is in the home folder.

share|improve this answer

Perhaps the best way to set the location of all of your downloaded files is to set this from within youtube-dl's configuration file which can be located as $HOME/.config/youtube-dl.conf. Syntax is:

--output "~/media/%(title)s.%(ext)s"

and of course change the path to suit your needs (and the extension template details if you wish). Otherwise youtube-dl will simply download the requested file in the working directory. This will only work with relatively recent versions of youtube-dl so it would be best to update your copy before trying this with the following command:

sudo youtube-dl --update

And now hopefully your files will not be lost again :)

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.