Downloading videos to an external drive with youtube-dl

8,622

Solution 1

How about:

cd '/media/New Volume/Youtube Downloads'
youtube-dl URL1...
youtube-dl URL2...

...

Solution 2

This simple function would save "Nyan Cat 10 hours (original).mp4" from YouTube in the Videos folder:

video(){  
    youtube-dl -o "/Users/daniel/Videos/%(title)s.%(ext)s" $1 -f mp4  
}

Usage from your terminal:

video https://www.youtube.com/watch?v=wZZ7oFKsKzY
Share:
8,622

Related videos on Youtube

Wilson Canda
Author by

Wilson Canda

Interested in computation, language, philosophy and psychology. And other things, but more on that later.

Updated on September 18, 2022

Comments

  • Wilson Canda
    Wilson Canda over 1 year

    My Hard drive has very little free space left. Thus I am trying to get youtube-dl to save the videos onto my external drive. With no luck, so far. Has anyone tried that? Or any ideas on how to proceed? I am new to linux and my interactions with the command prompt can be found below.

    me@mycomputer:/$ youtube-dl -o 'media/New Volume/Youtube Downloads' http://www.youtube.com/watch?v=123456789
    me@mycomputer:/$ youtube-dl -o '/media/New\ Volume/Youtube\ Downloads' http://www.youtube.com/watch?v=123456789
    

    I thought that would save the videos on the external drive, but instead the things are getting saved in my home folder under ~/media/New Volume/Youtube Downloads. Any help is welcome!

    • Admin
      Admin over 5 years
      Sames issue. I have two windows machines. I use the same code to execute on both. One downloads to the expected directory, one to the home folder. Appears to be some kind of bug system mis configuration from my end but not able to identify. Admin access is not an issue. I guess the 255 character limit or some such thing.
  • Wilson Canda
    Wilson Canda about 11 years
    wow. didn't know the folder from which the program was being executed, mattered. thanks a lot.
  • Admin
    Admin over 10 years
    It should have %(title)s.%(ext)s to also write the extension of the file.
  • Admin
    Admin over 10 years
    @DannyRe, I had a bad experience yesterday when the video I downloaded tried to open in Geany because the system thought it was a TROFF document (whatever that is) and the CPU usage rocketed :(. I repeated the download but this time took care to use an extension in the command!