From 90f25da666e9682c507e3c76c08e5b4bfd48797c Mon Sep 17 00:00:00 2001 From: Ali Parlakci Date: Tue, 10 Jul 2018 00:51:26 +0300 Subject: [PATCH 1/2] 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=' Date: Tue, 10 Jul 2018 02:00:55 +0300 Subject: [PATCH 2/2] Changed the configuring section's name --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3af1d6a..2ef7135 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This program downloads imgur, gfycat and direct image and video links of saved p ## Table of Contents - [Requirements](#requirements) -- [Configuring the APIs](#configuring-the-apis) +- [Setting up the script](#setting-up-the-script) - [Creating an imgur app](#creating-an-imgur-app) - [Program Modes](#program-modes) - [saved mode](#saved-mode) @@ -32,7 +32,7 @@ You have to check "**Add Python 3 to PATH**" option when installing in order it *\*Although the latest version of python is suggested, you can use 3.6.5 since it runs perfectly on that version* -## Configuring the APIs +## Setting up the script Because this is not a commercial app, you need to create an imgur developer app in order API to work. ### Creating an imgur app