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.

stderr
  • 221
  • 1
  • 7
BJsgoodlife
  • 1,160
  • 5
  • 31
  • 59

3 Answers3

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
stderr
  • 221
  • 1
  • 7
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.

BJsgoodlife
  • 1,160
  • 5
  • 31
  • 59
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 :)

andrew.46
  • 38,003
  • 27
  • 156
  • 232