From a949b3a4069947faf2528fbc34474590a1379f7c Mon Sep 17 00:00:00 2001 From: Henrik Hank Date: Sat, 26 May 2018 03:50:40 +0200 Subject: [PATCH] Slightly more intuitive way of stripping off extension --- youtube_dl/YoutubeDL.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 23af35a66..1ccec7852 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1883,7 +1883,7 @@ class YoutubeDL(object): with io.open(encodeFilename(to_high_limit_path(linkfn)), 'w', encoding='utf-8', newline=newline) as linkfile: template_vars = {'url': ascii_url} if embed_filename: - template_vars['filename'] = linkfn[:-len(extension) - 1] + template_vars['filename'] = linkfn[:-(len(extension) + 1)] linkfile.write(template % template_vars) except (OSError, IOError): self.report_error('Cannot write internet shortcut ' + linkfn)