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

How to pass the url to batch file? #18368

Closed
GGGunrunner opened this issue Dec 2, 2018 · 1 comment
Closed

How to pass the url to batch file? #18368

GGGunrunner opened this issue Dec 2, 2018 · 1 comment

Comments

@GGGunrunner
Copy link

@GGGunrunner GGGunrunner commented Dec 2, 2018

I'm using youtube-dl on Win and instead of typing "youtube-dl -f 22 https://youtube-etc-etc" every time
I'd rather put it in a batch file.

simply

@echo off
c:\bin\youtube-dl.exe -f 22 %1

but it truncates everything past the https://www.youtube.com/watch?v sting....

how do i properly pass the url? thanks!

@rautamiekka
Copy link

@rautamiekka rautamiekka commented Dec 2, 2018

The Batch language and Window$ itself are really finicky. For best results you have to replace %1 with "%~1", which tells the system to always pass the string without any double-quoting, enabling our explicit double-quoting to make it work the way the language and system like it.

Also, with "%~1" you're accepting only the first drag-drop or call parameter. If you wanna accept any number of drag-drops or call parameters (while remembering the absolute character limit of the system), replace with %*, without double quotes.

If you need to be able to access every string you pass outside just being able to pass the strings to youtube-dl, you need a more elaborate system.

@dstftw dstftw closed this Dec 2, 2018
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.