From 736c60eaa5bf5ea8e9b87e9e2bd40f7c248c198a Mon Sep 17 00:00:00 2001 From: cousteau Date: Sun, 18 Oct 2015 20:06:54 +0200 Subject: [PATCH] __init__.py -> new --output format + warn if old - Edited __init__.py so that it uses the new {NAME} rather than the old %(NAME)s --output format - Moved the backwards compatibility code from YoutubeDL.py to __init__.py - Display a warning if the old format is used --- youtube_dl/YoutubeDL.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 35931d6bc..ff0148d2e 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -546,8 +546,7 @@ class YoutubeDL(object): autonumber_size = self.params.get('autonumber_size') if autonumber_size is None: autonumber_size = 5 - autonumber_templ = '%0' + str(autonumber_size) + 'd' - template_dict['autonumber'] = autonumber_templ % self._num_downloads + template_dict['autonumber'] = '%0*d' % (autonumber_size, self._num_downloads) if template_dict.get('playlist_index') is not None: template_dict['playlist_index'] = '%0*d' % (len(str(template_dict['n_entries'])), template_dict['playlist_index']) if template_dict.get('resolution') is None: @@ -568,10 +567,7 @@ class YoutubeDL(object): template_dict = collections.defaultdict(lambda: 'NA', template_dict) outtmpl = self.params.get('outtmpl', DEFAULT_OUTTMPL) - tmpl = compat_expanduser(outtmpl) - # Backwards compatibility fix (deprecated): %(foo)s -> {foo}, %% -> % - tmpl = re.sub(r'(?