Revision of Watch YouTube videos using youtube-dl from Sun, 08/04/2013 - 05:12

The revisions let you track differences between multiple versions of a post.

Trisquel includes Gnash by default, so YouTube videos should work most of the time. However, watching YouTube videos this way requires the user to run proprietary JavaScript and ActionScript and also requires more system resources than downloading the videos and viewing them with a video player such as Totem or SMPlayer.

YouTube videos can be downloaded on Trisquel via youtube-dl. youtube-dl is free software and is capable of downloading videos from YouTube and other video websites.

Installing youtube-dl

  • Open up Terminal
  • Use the following command to download the youtube-dl program:
sudo aptitude install youtube-dl
  • Update to a more recent version (do this step whenever youtube-dl stops working due to changes in the YouTube website):
sudo youtube-dl -U
  • The first time you update youtube-dl using this method you will need to run it as root:
sudo youtube-dl

Now you can use the youtube-dl command to download YouTube videos. First find out which formats are available by using this command (replace the YouTube URL by the URL you wish to download):

youtube-dl -F https://www.youtube.com/watch?v=8p9IU4zp7mU

The output will look like this:

[youtube] Setting language

[youtube] 8p9IU4zp7mU: Downloading video webpage

[youtube] 8p9IU4zp7mU: Downloading video info webpage

[youtube] 8p9IU4zp7mU: Extracting video information

Available formats:

34 : flv [360x640]

18 : mp4 [360x640]

43 : webm [360x640]

5 : flv [240x400]

17 : mp4 [144x176]

In order to download the WebM format (which is preferred as it is not patent-encumbered) run the following command (the " -o '%(title)s.%(ext)s' " part tells youtube-dl to save the video using the video's original title - more saving options can be found by running "youtube-dl -h"):

youtube-dl -f 43 https://www.youtube.com/watch?v=8p9IU4zp7mU -o '%(title)s.%(ext)s'

youtube-dl will then start downloading the video. The output will look something like this:

[youtube] Setting language

[youtube] 8p9IU4zp7mU: Downloading video webpage

[youtube] 8p9IU4zp7mU: Downloading video info webpage

[youtube] 8p9IU4zp7mU: Extracting video information

[download] Destination: Richard Stallman - DRM.webm

[download] 100.0% of 3.88MiB at 1.33MiB/s ETA 00:00

Revisions

11/22/2012 - 07:51
andrew
07/08/2013 - 06:55
aloniv
08/13/2013 - 18:19
lloydsmart
02/05/2014 - 18:51
ssdclickofdeath
09/04/2014 - 02:53
muhammed
10/09/2014 - 11:07
a1l3erto
08/17/2017 - 05:43
calher
09/21/2024 - 14:35
knife