[SOLVED] youtube-dl - Directory? Audio and Video separate?

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
User avatar
SyncroScales
Level 4
Level 4
Posts: 369
Joined: Thu Jul 20, 2017 4:30 am
Location: Canada

[SOLVED] youtube-dl - Directory? Audio and Video separate?

Post by SyncroScales »

Hi,

I tried to download a videow tih youtube-dl. It worked. I don't know where it is. I looked in the /etc folder and ther eis not a youtube-dl folder.

And i noticed that I could not download an autio file, incase the video and audio are separate. How do I do that?

Thanks.
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Desktop:ASUS M3N78-VM, AMD Phenom II 965 3.4GHz, 3.5GBRAM(4GB), XP SP3/Vista SP2/LinuxMintCinnamon64-bit, nVidia GeForce GT 430. Laptop:AMD Athlon 64 X2 DualCore 3800+ 2GHz(AMD QL-62), 3GB RAM, Vista SP2/LinuxMintCinnamon64-bit, ATI 3100.
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: youtube-dl - Directory? Audio and Video separate?

Post by JoeFootball »

SyncroScales wrote: I tried to download a videow tih youtube-dl. It worked. I don't know where it is. I looked in the /etc folder and ther eis not a youtube-dl folder.
I should be in whatever directory you executed youtube-dl from.
SyncroScales wrote: And i noticed that I could not download an autio file, incase the video and audio are separate. How do I do that?
You can download audio from a video via the -x or --extract-audio option. youtube-dl --help will list all the options available.

Lastly, note that development of youtube-dl has been suspended, at least for the foreseeable future. As such, an ongoing fork is available at ...

https://github.com/yt-dlp/yt-dlp
User avatar
SyncroScales
Level 4
Level 4
Posts: 369
Joined: Thu Jul 20, 2017 4:30 am
Location: Canada

Re: youtube-dl - Directory? Audio and Video separate?

Post by SyncroScales »

youtube-dl was included with linux xfce 20.2 or where the software manager put it.
Desktop:ASUS M3N78-VM, AMD Phenom II 965 3.4GHz, 3.5GBRAM(4GB), XP SP3/Vista SP2/LinuxMintCinnamon64-bit, nVidia GeForce GT 430. Laptop:AMD Athlon 64 X2 DualCore 3800+ 2GHz(AMD QL-62), 3GB RAM, Vista SP2/LinuxMintCinnamon64-bit, ATI 3100.
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: youtube-dl - Directory? Audio and Video separate?

Post by JoeFootball »

SyncroScales wrote: youtube-dl was included with linux xfce 20.2 or where the software manager put it.
Where youtube-dl is actually installed within the directory structure does not dictate where things are downloaded to. It's where it's executed from which determines that.

For example, if I'm at a terminal in my Videos directory, and I execute the youtube-dl command from there, whatever is downloaded will be in my Videos directory.
User avatar
SyncroScales
Level 4
Level 4
Posts: 369
Joined: Thu Jul 20, 2017 4:30 am
Location: Canada

Re: youtube-dl - Directory? Audio and Video separate?

Post by SyncroScales »

Open Terminlal in Mint xfce 20.2
(Name of desktop):~$ youtube-dl
Desktop:ASUS M3N78-VM, AMD Phenom II 965 3.4GHz, 3.5GBRAM(4GB), XP SP3/Vista SP2/LinuxMintCinnamon64-bit, nVidia GeForce GT 430. Laptop:AMD Athlon 64 X2 DualCore 3800+ 2GHz(AMD QL-62), 3GB RAM, Vista SP2/LinuxMintCinnamon64-bit, ATI 3100.
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: youtube-dl - Directory? Audio and Video separate?

Post by JoeFootball »

SyncroScales wrote: (Name of desktop):~$ youtube-dl
Then that would be your Home directory. i.e., /home/Your_User_Name_Here.

And if you executed cd Videos after you opened your terminal, you'd be in your Videos directory. i.e., /home/Your_User_Name_Here/Videos. Then if you executed your youtube-dl command from there, your content would result in that directory.

For example, after you open the terminal, execute cd Videos, then execute youtube-dl URL_Of_Video_To_Download_Here, where the resulting video file would be in your Videos directory.
User avatar
SyncroScales
Level 4
Level 4
Posts: 369
Joined: Thu Jul 20, 2017 4:30 am
Location: Canada

Re: youtube-dl - Directory? Audio and Video separate?

Post by SyncroScales »

If I wanted a specific folder, it would be in the script or config file? I just have to edit that? Or would I have to use that command everytime to setup using youtube-dl (Or it seems similar with the fork at https://github.com/yt-dlp/yt-dlp).

Thanks.
Desktop:ASUS M3N78-VM, AMD Phenom II 965 3.4GHz, 3.5GBRAM(4GB), XP SP3/Vista SP2/LinuxMintCinnamon64-bit, nVidia GeForce GT 430. Laptop:AMD Athlon 64 X2 DualCore 3800+ 2GHz(AMD QL-62), 3GB RAM, Vista SP2/LinuxMintCinnamon64-bit, ATI 3100.
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: youtube-dl - Directory? Audio and Video separate?

Post by JoeFootball »

SyncroScales wrote: If I wanted a specific folder, it would be in the script or config file?
I just run it in whatever directory I want the downloads to go to, but apparently there are such configuration options ...

https://duckduckgo.com/?q=youtube-dl+co ... d+location
Suwakoto
Level 2
Level 2
Posts: 55
Joined: Wed Jun 09, 2021 2:07 pm

Re: youtube-dl - Directory? Audio and Video separate?

Post by Suwakoto »

Like JoeFootball is saying, youtube-dl downloads wherever it is executed from. So if my terminal shows [user@machine]:~/Desktop$ youtube-dl [YouTube link], the file will be downloaded to ~/Desktop (that is, /home/[user]/Desktop). If it's [user@machine]:~/Videos/YouTube$ youtube-dl [YouTube link] then it'll download to ~/Videos/YouTube/, and so on.

You possibly could change this behaviour with some sort of script, but it's probably not worth the hassle. Just go to whatever folder you want to save the videos in, right-click, Open in Terminal and execute the command. Or if you want to do everything in the console, you can get youtube-dl to download to a specific folder X by executing cd [path to X] and then using the program.

Now, in regards to separate audio and video, are you trying to download them separately, but find that one doesn't work? If so, what I've experienced is that, sometimes, the formats just collide. Suppose you download the video track and it gets saved in a WEBM file. If you try to download the audio track and it also wants to save it to a WEBM file, it'll notice that such a file is already present and just say that the thing's already been downloaded, even though that's actually a different file you're trying too get. To see if this is the case, just rename the first file you get.

Or this might not be it. In which case, we need more information as to what exactly happens and when. Console inputs and outputs.
User avatar
kato181
Level 9
Level 9
Posts: 2577
Joined: Fri Mar 24, 2017 12:33 am
Location: Frederickton NSW

Re: youtube-dl - Directory? Audio and Video separate?

Post by kato181 »

You can select what folder you want the video/music to d/l to.
You can extract the audio from video by clicking on the lantern icon then select the following to extract audio..
options-->formats-->post-process options
I save my audio as webm and then use sound converter to convert them to mp3 without any sound loss.
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: youtube-dl - Directory? Audio and Video separate?

Post by JoeFootball »

kato181 wrote: ... clicking on the lantern icon ...
Sound like you're referring to a GUI app for youtube-dl, or otherwise? I believe the OP is using the CLI youtube-dl itself.
User avatar
all41
Level 19
Level 19
Posts: 9523
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: youtube-dl - Directory? Audio and Video separate?

Post by all41 »

You can specify a fixed youtube-dl output directory--
Make a new Document in ~/.config and name it youtube-dl.conf
Paste this entry specifying the target location
o /path_for _desired_output/%(title)s.%(ext)s
as example:
o /storage/yt_videos/%(title)s.%(ext)s

If you want to keep audio and video files without formatting end your
youtube-dl <url> with -k
as example:
youtube-dl https://www.youtube.com/watch?v=Ryh9h2FIV4Q -k
You can look at the formats for audio/video by using the F switch:
example:
youtube-dl -F <url>
Everything in life was difficult before it became easy.
mikeflan
Level 17
Level 17
Posts: 7148
Joined: Sun Apr 26, 2020 9:28 am
Location: Houston, TX

Re: youtube-dl - Directory? Audio and Video separate?

Post by mikeflan »

That youtube link is broke.
User avatar
all41
Level 19
Level 19
Posts: 9523
Joined: Tue Dec 31, 2013 9:12 am
Location: Computer, Car, Cage

Re: youtube-dl - Directory? Audio and Video separate?

Post by all41 »

mikeflan wrote: Sun Oct 17, 2021 8:53 am
That youtube link is broke.
It is an imaginary link - just an example of how the command is used
Everything in life was difficult before it became easy.
User avatar
SyncroScales
Level 4
Level 4
Posts: 369
Joined: Thu Jul 20, 2017 4:30 am
Location: Canada

Re: youtube-dl - Directory? Audio and Video separate?

Post by SyncroScales »

Now, in regards to separate audio and video, are you trying to download them separately, but find that one doesn't work? If so, what I've experienced is that, sometimes, the formats just collide. Suppose you download the video track and it gets saved in a WEBM file. If you try to download the audio track and it also wants to save it to a WEBM file, it'll notice that such a file is already present and just say that the thing's already been downloaded, even though that's actually a different file you're trying too get. To see if this is the case, just rename the first file you get.
Yes. I noticed this when using the terminal. I am not using a GUI. I didn't know there was a GUI.

When looking at the web-site help section and using the command in the terminal, it is overloaded. Since I don't understand all of the commands, and how to sequence them or correctly name files (if I have to) with the correct %'s and other characters - It's a lot.

So should I uninstall youtube-dl and use the fork? Is it more updated or stable?

I was concerned about the separate audio and video because the documentation seemed to say I would have to combine them. I am aware from using other programs that audio might not be included with video, this can happen and it's something the YouTube has done for various reasons on their servers. I was thinking that the higher bit-rate audio could be a better choice and after using VLC media player to check the Codec Information and looking at the files in Windows, I think that youtube-dl and xtreme download manager are doing their jobs. Not taking one quality/resolution less like EagleGet (or other apps) might do.

JoeFootball: I found the test file in the Home directory.

Is there any reason that youtube-dl downloads the .webm file and Extreme Download Manager downloads .mkv? It doesn't seem there is a conversion and quality loss. I saw in the terminal while using youtube-dl the list of audio and video files (there are numbers beside them) once the URL is pasted into the command. For the video most were .webm files that youtube-dl showed.

Thanks everyone.
Desktop:ASUS M3N78-VM, AMD Phenom II 965 3.4GHz, 3.5GBRAM(4GB), XP SP3/Vista SP2/LinuxMintCinnamon64-bit, nVidia GeForce GT 430. Laptop:AMD Athlon 64 X2 DualCore 3800+ 2GHz(AMD QL-62), 3GB RAM, Vista SP2/LinuxMintCinnamon64-bit, ATI 3100.
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: youtube-dl - Directory? Audio and Video separate?

Post by JoeFootball »

SyncroScales wrote: So should I uninstall youtube-dl and use the fork? Is it more updated or stable?
Speaking for myself, I try to not use applications that are knowingly no longer supported. When I learned that was the case with youtube-dl, and that yt-dlp was a supported fork, I switched to that. It's definitely updated more often, as youtube-dl is not doing so. I can't speak to it being more stable, as I never had stability issues with either.
User avatar
freshminted
Level 4
Level 4
Posts: 274
Joined: Fri May 01, 2020 12:26 am

Re: youtube-dl - Directory? Audio and Video separate?

Post by freshminted »

I thought youtube-dl got reinstated and was back?

Anyway, I've noticed it often downloads very slowly now (throttling?) and yt-dlp does a much better job of consistently downloading at high speed. You can use command line options for both to make them download the format you prefer.
Complete World Domination within five years.
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: youtube-dl - Directory? Audio and Video separate?

Post by JoeFootball »

freshminted wrote: I thought youtube-dl got reinstated and was back?
If you mean reinstated on GitHub last year, you're correct. Since then, the developer has ceases further updates for personal reasons, at least for now. I believe 2021-06-06 was the last one. Hence the fork(s).
User avatar
SyncroScales
Level 4
Level 4
Posts: 369
Joined: Thu Jul 20, 2017 4:30 am
Location: Canada

Re: youtube-dl - Directory? Audio and Video separate?

Post by SyncroScales »

Not fluent with GitHub. Should I use sudo curl, sudo wget or sudo aria2c?

Linux Mint 20.2 Cinnamon or xfce.

I think wget?

Probably not Download the binary, Homebrew, PyPI package or Install master branch(?).

Should ffmpeg be installed too (from the Software Manager or official site)? Would it be in the youtube-dl install? There is a list of dependencies https://github.com/yt-dlp/yt-dlp#installation
Desktop:ASUS M3N78-VM, AMD Phenom II 965 3.4GHz, 3.5GBRAM(4GB), XP SP3/Vista SP2/LinuxMintCinnamon64-bit, nVidia GeForce GT 430. Laptop:AMD Athlon 64 X2 DualCore 3800+ 2GHz(AMD QL-62), 3GB RAM, Vista SP2/LinuxMintCinnamon64-bit, ATI 3100.
User avatar
JoeFootball
Level 13
Level 13
Posts: 4673
Joined: Tue Nov 24, 2009 1:52 pm
Location: /home/usa/mn/minneapolis/joe

Re: youtube-dl - Directory? Audio and Video separate?

Post by JoeFootball »

SyncroScales wrote: Should I use sudo curl, sudo wget or sudo aria2c? ... Probably not Download the binary, Homebrew, PyPI package or Install master branch(?).
I would use curl or wget. I don't believe aria2c is installed in LM by default. Be sure to subsequently update the permissions with chmod.
SyncroScales wrote: Should ffmpeg be installed too (from the Software Manager or official site)? Would it be in the youtube-dl install? There is a list of dependencies
If you were formerly using youtube-dl, you should already have what you need. If you want to make sure, sudo apt install ffmpeg will tell you if it's already installed, and install it if it's not. I use the version via that command, and haven't had any issues.

After installation, you can periodically check for updates via: sudo yt-dlp -U
Locked

Return to “Software & Applications”