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

-o oddities in windows batch files #6849

Closed
enterprised1 opened this issue Sep 13, 2015 · 2 comments
Closed

-o oddities in windows batch files #6849

enterprised1 opened this issue Sep 13, 2015 · 2 comments

Comments

@enterprised1
Copy link

@enterprised1 enterprised1 commented Sep 13, 2015

i'm using a batch file in windows to change the filename to just the title and extension - basically remove the %(id)s.

here's what i have in the batch file:
set /p address=Enter video site address:
youtubedl\youtube-dl.exe -v -o '%(title)s.%(ext)s' %address%

When attempting to run, i get the error:
"youtube-dl.exe: error: You must provide at least one URL."

When running the batch file without the -o option, it runs fine (but appends the %(id)s, which is what i'm trying to avoid).

running the same command directly in the command prompt works fine. any ideas why it's not working when run from a batch file?

thanks!

-v debug:
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'-o', u"'address"]
[debug] Encodings: locale cp1252, fs mbcs, out cp437, pref cp1252
[debug] youtube-dl version 2015.09.09
[debug] Python version 2.7.8 - Windows-8-6.2.9200
[debug] exe versions: none
[debug] Proxy map: {}
Usage: youtube-dl.exe [OPTIONS] URL [URL...]

youtube-dl.exe: error: You must provide at least one URL.
Type youtube-dl --help to see a list of all options.

@jaimeMF
Copy link
Collaborator

@jaimeMF jaimeMF commented Sep 13, 2015

You may need to escape the % from the -o option in the batch file, could you post the output of the batch file (with the -v option)?

@dstftw
Copy link
Collaborator

@dstftw dstftw commented Sep 13, 2015

Correct code:

set /p address=Enter video site address:
youtubedl\youtube-dl.exe -v -o "%%(title)s.%%(ext)s" %address%
@dstftw dstftw closed this Sep 13, 2015
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.