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

Double-Backslash #18682

Closed
Xiper-Starchild opened this issue Dec 28, 2018 · 3 comments
Closed

Double-Backslash #18682

Xiper-Starchild opened this issue Dec 28, 2018 · 3 comments

Comments

@Xiper-Starchild
Copy link

@Xiper-Starchild Xiper-Starchild commented Dec 28, 2018

This is probably my fault. I am new to this program and pretty clueless.

I am making a shortcut for using this program via AutoHotkey, but it's clear that this is not the cause of the issue, with the issue being that backslashes get duplicated, like this: https://i.imgur.com/dCDEy7c.png

Here is the full command I gave it:

"C:\Users\Kelvin\AppData\Roaming\youtube-dlg\youtube-dl.exe" https://www.youtube.com/watch?v=_pUL7u-mYqAyt -o "C:\Users\Kelvin\Downloads\Other" '%(title)%.%(ext)%' --ffmpeg-location "C:\Users\Kelvin\Documents\ShareX\Tools\ffmpeg.exe" --metadata-from-title --embed-subs --embed-thumbnail -i --geo-bypass --yes-playlist --write-thumbnial -q -write-sub -x --audio-format "mp3" --audio-quality 0

Thanks for your time. I could not find this issue among the bugs posted here.

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Dec 28, 2018

-o "C:\Users\Kelvin\Downloads\Other" '%(title)%.%(ext)%'

Invalid.

@dstftw dstftw closed this Dec 28, 2018
@rautamiekka
Copy link

@rautamiekka rautamiekka commented Dec 29, 2018

Since you're on Window$ -and- youtube-dl is a Python program:

"C:\Users\Kelvin\AppData\Roaming\youtube-dlg\youtube-dl.exe" "https://www.youtube.com/watch?v=_pUL7u-mYqAyt" -o "C:/Users/Kelvin/Downloads/Other/%%(title)s.%%(ext)s" --ffmpeg-location "C:\Users\Kelvin\Documents\ShareX\Tools\ffmpeg.exe" --metadata-from-title --embed-subs --embed-thumbnail -i --geo-bypass --yes-playlist --write-thumbnail -q -write-sub -x --audio-format mp3 --audio-quality 0

On Window$ when using Batch script files instead of directly executing the command in Command Prompt you must double the percent signs used by a program, like anything made in Python.

Also you need to quote paths and web addresses.

Paths inside strings meant for Python programs like the -o parameter should use the NIX style of path separation cuz Python could misunderstand those backslashes, leading into God knows what. Unless you double the backslashes.

Same code for Command Prompt:
"C:\Users\Kelvin\AppData\Roaming\youtube-dlg\youtube-dl.exe" "https://www.youtube.com/watch?v=_pUL7u-mYqAyt" -o "C:/Users/Kelvin/Downloads/Other/%(title)s.%(ext)s" --ffmpeg-location "C:\Users\Kelvin\Documents\ShareX\Tools\ffmpeg.exe" --metadata-from-title --embed-subs --embed-thumbnail -i --geo-bypass --yes-playlist --write-thumbnail -q -write-sub -x --audio-format mp3 --audio-quality 0

Both commands untested on my machine.

@Xiper-Starchild
Copy link
Author

@Xiper-Starchild Xiper-Starchild commented Dec 30, 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.