Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

youtube-dl --external-downloader doesn't work with a Full Path #25852

Open
SwiftMove opened this issue Jul 1, 2020 · 6 comments
Open

youtube-dl --external-downloader doesn't work with a Full Path #25852

SwiftMove opened this issue Jul 1, 2020 · 6 comments

Comments

@SwiftMove
Copy link

@SwiftMove SwiftMove commented Jul 1, 2020

Checklist

  • I'm reporting a broken site support issue
  • I've verified that I'm running youtube-dl version 2020.06.16.1
  • I've checked that all provided URLs are alive and playable in a browser
  • I've checked that all URLs and arguments with special characters are properly quoted or escaped
  • I've searched the bugtracker for similar bug reports including closed ones
  • I've read bugs section in FAQ

Verbose log

PASTE VERBOSE LOG HERE

Description

Using the "--external-downloader" argument doesn't work with a full path...

youtube-dl.exe --external-downloader=D:\aria2\aria2c.exe

However, if I put "aria2c.exe" in the folder above youtube-dl.exe, then this command does work...

youtube-dl.exe --external-downloader=..\aria2c.exe

I'm well aware that I can change the PATH variable, and just use "aria2c" instead of a Full Path, but I was just curious on why using a Full Path doesn't work? Was not allowing full paths the intended behavior? Or is this just an oversight?

@glenn-slayden
Copy link
Contributor

@glenn-slayden glenn-slayden commented Jul 1, 2020

On Windows (at least), you need to use double-quotes, and backslashes must be escaped. The following works for me:

youtube-dl --external-downloader "C:\\Program Files\\aria2\\aria2c.exe" https://www.youtube.com/watch?v=vwnXqmgNBEw

Forward-slashes also work on Windows (again with double-quotes), if you prefer:

youtube-dl --external-downloader "C:/Program Files/aria2/aria2c.exe" https://www.youtube.com/watch?v=vwnXqmgNBEw

Don't forget to specify your --external-downloader-args, if any.

@SwiftMove
Copy link
Author

@SwiftMove SwiftMove commented Jul 1, 2020

I was already using double-quotes, but not escaped backslashes. However, I just tried using double-quotes AND escaped backslashes like you mentioned, but it still doesn't work.

I had also already tried using forward-slashes before, but that doesn't work either.

I noticed that you have aria2c installed on your system, that means that "aria2" is probably listed in your PATH environment variable which is why it's probably working for you. Go remove the "C:\Program Files\aria2\aria2c.exe" from your envorinment PATH and try it again. I'm testing this on a system where aria2c is only being used by calling the EXE directly.

@glenn-slayden
Copy link
Contributor

@glenn-slayden glenn-slayden commented Jul 1, 2020

Hmm, that would be weird, because according to what you're saying, youtube-dl would have to be taking a fully-specified command line argument, and explicitly stripping away the path part, to obtain just the executable name -- that it would then launch, now dependent on the environment PATH?

Anyway, @dstftw please don't let my observation affect whether you look into this...

p.s. I assume your aria2c is the statically linked version (i.e., not the mingw version), so there's no issue of it somehow not finding its own libraries....

@SwiftMove
Copy link
Author

@SwiftMove SwiftMove commented Jul 1, 2020

Yeah, my aria2c.exe binary works just fine, no issues there, and like I said in the OP, it works just fine if I use "--external-downloader=aria2c", it just doesn't work when I use the full path. I know I can add my aria2c path to my PATH environment variable, but it doesn't make sense why youtube-dl isn't accepting the full path with "--external-downloader". Seems like it's probably just a simple oversight.

For example, the batch script below works just fine and aria2c is correctly being called from my "D:\Temp\aria2c" folder...
@echo off
set path=%path%;D:\Temp\aria2c
youtube-dl.exe --external-downloader=aria2c http://www.website.com/video.mp4

However. this batch script below doesn't work when I use the full path with "--external-downloader" instead of using the %path% variable...
@echo off
youtube-dl.exe --external-downloader="D:\Temp\aria2c\aria2c.exe" http://www.website.com/video.mp4

None of the syntax's below are working....
"D:\Temp\aria2c\aria2c.exe"
"D:\\Temp\\aria2c\\aria2c.exe"
"D:/Temp/aria2c/aria2c.exe"

@barsnick
Copy link

@barsnick barsnick commented Jul 3, 2020

The --external-downloader is not designed to take a path, it takes a name and checks that against the internal list of supported downloaders. (I'm not saying this couldn't be changed, I'm just saying what the current implementation does).

The option certainly needs to understand which tool it is given on the command line, in order to apply the correct options.

@SwiftMove
Copy link
Author

@SwiftMove SwiftMove commented Jul 4, 2020

I had a feeling that's what the issue was. Thank You for confirming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.