From 0c9a667da74d5dd27664d307130223edf530f4d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Koch-Kramer?= Date: Mon, 6 May 2019 17:39:58 +0200 Subject: [PATCH] Replace slash and backslash with similar unicode --- instaloader/instaloader.py | 2 +- instaloader/structures.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/instaloader/instaloader.py b/instaloader/instaloader.py index 6a52f8e..6182bb6 100644 --- a/instaloader/instaloader.py +++ b/instaloader/instaloader.py @@ -108,7 +108,7 @@ class _PostPathFormatter(_ArbitraryItemFormatter): ret = super().vformat(format_string, args, kwargs) if platform.system() == 'Windows': ret = ret.replace(':', '\ua789').replace('<', '\ufe64').replace('>', '\ufe65').replace('\"', '\uff02') - ret = ret.replace('\\', '\uff3c').replace('|', '\uff5c').replace('?', '\ufe16').replace('*', '\uff0a') + ret = ret.replace('\\', '\ufe68').replace('|', '\uff5c').replace('?', '\ufe16').replace('*', '\uff0a') return ret diff --git a/instaloader/structures.py b/instaloader/structures.py index 0efe36d..8d303d6 100644 --- a/instaloader/structures.py +++ b/instaloader/structures.py @@ -256,7 +256,7 @@ class Post: def pcaption(self) -> str: """Printable caption, useful as a format specifier for --filename-pattern.""" def _elliptify(caption): - pcaption = ' '.join([s.replace('/', '∕') for s in caption.splitlines() if s]).strip() + pcaption = ' '.join([s.replace('/', '\u2215') for s in caption.splitlines() if s]).strip() return (pcaption[:30] + u"\u2026") if len(pcaption) > 31 else pcaption return _elliptify(self.caption) if self.caption else ''