1
0
mirror of https://github.com/l1ving/youtube-dl synced 2020-11-18 19:53:54 -08:00

Slightly more intuitive way of stripping off extension

This commit is contained in:
Henrik Hank 2018-05-26 03:50:40 +02:00
parent a4642440fd
commit a949b3a406

View File

@ -1883,7 +1883,7 @@ class YoutubeDL(object):
with io.open(encodeFilename(to_high_limit_path(linkfn)), 'w', encoding='utf-8', newline=newline) as linkfile: with io.open(encodeFilename(to_high_limit_path(linkfn)), 'w', encoding='utf-8', newline=newline) as linkfile:
template_vars = {'url': ascii_url} template_vars = {'url': ascii_url}
if embed_filename: if embed_filename:
template_vars['filename'] = linkfn[:-len(extension) - 1] template_vars['filename'] = linkfn[:-(len(extension) + 1)]
linkfile.write(template % template_vars) linkfile.write(template % template_vars)
except (OSError, IOError): except (OSError, IOError):
self.report_error('Cannot write internet shortcut ' + linkfn) self.report_error('Cannot write internet shortcut ' + linkfn)