From 90f25da666e9682c507e3c76c08e5b4bfd48797c Mon Sep 17 00:00:00 2001 From: Ali Parlakci Date: Tue, 10 Jul 2018 00:51:26 +0300 Subject: [PATCH] FileNameTooLong exception added for Gfycat and Direct classes --- src/downloader.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/downloader.py b/src/downloader.py index 1883dec..5a2df24 100644 --- a/src/downloader.py +++ b/src/downloader.py @@ -233,8 +233,13 @@ class Gfycat: fileDir = directory / (title+"_"+POST['postId']+POST['postExt']) tempDir = directory / (title+"_"+POST['postId']+".tmp") + try: + getFile(fileDir,tempDir,POST['mediaURL']) + except FileNameTooLong: + fileDir = directory / (POST['postId']+POST['postExt']) + tempDir = directory / (POST['postId']+".tmp") - getFile(fileDir,tempDir,POST['mediaURL']) + getFile(fileDir,tempDir,POST['mediaURL']) def getLink(self, url, query='