From 2e15dacaeb84673a0731eb3e473d1af80efed0d0 Mon Sep 17 00:00:00 2001 From: Ali Parlakci Date: Tue, 10 Jul 2018 01:44:28 +0300 Subject: [PATCH] Fixed the long file name bug --- src/downloader.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/downloader.py b/src/downloader.py index 706b7c7..5e2eec3 100644 --- a/src/downloader.py +++ b/src/downloader.py @@ -308,8 +308,14 @@ class Self: if Path.is_file(fileDir): raise FileAlreadyExistsError + + try: + self.writeToFile(fileDir,post) + except FileNotFoundError: + fileDir = post['postId']+".md" + fileDir = directory / fileDir - self.writeToFile(fileDir,post) + self.writeToFile(fileDir,post) @staticmethod def writeToFile(directory,post):