mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-12-22 16:57:40 +00:00
[YoutubeDL] Simplify filename preparation
This commit is contained in:
parent
26e6393134
commit
45598aab08
1 changed files with 3 additions and 2 deletions
|
@ -397,11 +397,12 @@ class YoutubeDL(object):
|
||||||
template_dict['playlist_index'] = u'%05d' % template_dict['playlist_index']
|
template_dict['playlist_index'] = u'%05d' % template_dict['playlist_index']
|
||||||
|
|
||||||
sanitize = lambda k, v: sanitize_filename(
|
sanitize = lambda k, v: sanitize_filename(
|
||||||
u'NA' if v is None else compat_str(v),
|
compat_str(v),
|
||||||
restricted=self.params.get('restrictfilenames'),
|
restricted=self.params.get('restrictfilenames'),
|
||||||
is_id=(k == u'id'))
|
is_id=(k == u'id'))
|
||||||
template_dict = dict((k, sanitize(k, v))
|
template_dict = dict((k, sanitize(k, v))
|
||||||
for k, v in template_dict.items())
|
for k, v in template_dict.items()
|
||||||
|
if v is not None)
|
||||||
template_dict = collections.defaultdict(lambda: u'NA', template_dict)
|
template_dict = collections.defaultdict(lambda: u'NA', template_dict)
|
||||||
|
|
||||||
tmpl = os.path.expanduser(self.params['outtmpl'])
|
tmpl = os.path.expanduser(self.params['outtmpl'])
|
||||||
|
|
Loading…
Reference in a new issue