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:
parent
a4642440fd
commit
a949b3a406
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user