From ba141efba7d31cf46fa90da7802ca59a54319ff3 Mon Sep 17 00:00:00 2001 From: RicterZ Date: Mon, 11 Jan 2021 11:04:29 +0800 Subject: [PATCH] remove repeated spaces --- nhentai/utils.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nhentai/utils.py b/nhentai/utils.py index 1ce4298..474ea52 100644 --- a/nhentai/utils.py +++ b/nhentai/utils.py @@ -241,6 +241,8 @@ def format_filename(s): # maybe you can use `--format` to select a suitable filename ban_chars = '\\\'/:,;*?"<>|\t' filename = s.translate(str.maketrans(ban_chars, ' '*len(ban_chars))).strip() + filename = re.sub("\s\s+" , " ", filename) + while filename.endswith('.'): filename = filename[:-1] -- 2.44.0