1

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.

7
  • 1
    Double click over file?
    – Lucio
    Commented May 4, 2014 at 23:36
  • No it is not a link, it is a terminal program. Commented May 4, 2014 at 23:38
  • So you do youtube-dl URL, where URL is the URL of the video.
    – Nattgew
    Commented May 4, 2014 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. Commented May 4, 2014 at 23:42
  • "I found this answer to someones question" Could you give the link? This answer is what you are looking for.
    – Lucio
    Commented May 4, 2014 at 23:43

3 Answers 3

2

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
0

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.

0

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

Now you will be able to easily find your downloaded files and play them back with VLC, SMPlayer or whatever your favoured media playback application is :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .