Browse Source

[YoutubeDL] Apply expand_path after output template substitution

os.path.expandvars translates '%%' into '%' making output template invalid.
Before: '%%(ext)s' -(expand path)-> '%(ext)s' -(outtmpl subst.)-> 'mp4'
After: '%%(ext)s' -(outtmpl subst.)-> '%(ext)s' -(expand path)-> '%(ext)s'
master-ytdl-org
Sergey M․ 8 years ago
parent
commit
d35dc344af
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      youtube_dl/YoutubeDL.py

+ 1
- 2
youtube_dl/YoutubeDL.py View File

@ -672,8 +672,7 @@ class YoutubeDL(object):
FORMAT_RE.format(numeric_field),
r'%({0})s'.format(numeric_field), outtmpl)
tmpl = expand_path(outtmpl)
filename = tmpl % template_dict
filename = expand_path(outtmpl % template_dict)
# Temporary fix for #4787
# 'Treat' all problem characters by passing filename through preferredencoding
# to workaround encoding issues with subprocess on python2 @ Windows


Loading…
Cancel
Save