Added custom exception descriptions to FAILED.json file
This commit is contained in:
@@ -53,6 +53,9 @@ It should redirect to a page which shows your **imgur_client_id** and **imgur_cl
|
|||||||
them, there.
|
them, there.
|
||||||
|
|
||||||
## Changelog
|
## Changelog
|
||||||
|
### 19/07/2018
|
||||||
|
- Added custom exception descriptions to FAILED.json file
|
||||||
|
|
||||||
### [13/07/2018](https://github.com/aliparlakci/bulk-downloader-for-reddit/tree/9f831e1b784a770c82252e909462871401a05c11)
|
### [13/07/2018](https://github.com/aliparlakci/bulk-downloader-for-reddit/tree/9f831e1b784a770c82252e909462871401a05c11)
|
||||||
- Change config.json file's path to home directory
|
- Change config.json file's path to home directory
|
||||||
|
|
||||||
|
|||||||
@@ -539,7 +539,7 @@ def download(submissions):
|
|||||||
downloadedCount -= 1
|
downloadedCount -= 1
|
||||||
|
|
||||||
except NotADownloadableLinkError as exception:
|
except NotADownloadableLinkError as exception:
|
||||||
print("Could not read the page source")
|
print(exception)
|
||||||
FAILED_FILE.add({int(i+1):[str(exception),submissions[i]]})
|
FAILED_FILE.add({int(i+1):[str(exception),submissions[i]]})
|
||||||
downloadedCount -= 1
|
downloadedCount -= 1
|
||||||
|
|
||||||
|
|||||||
@@ -169,7 +169,9 @@ class Imgur:
|
|||||||
if duplicates == imagesLenght:
|
if duplicates == imagesLenght:
|
||||||
raise FileAlreadyExistsError
|
raise FileAlreadyExistsError
|
||||||
elif howManyDownloaded < imagesLenght:
|
elif howManyDownloaded < imagesLenght:
|
||||||
raise AlbumNotDownloadedCompletely
|
raise AlbumNotDownloadedCompletely(
|
||||||
|
"Album Not Downloaded Completely"
|
||||||
|
)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def initImgur():
|
def initImgur():
|
||||||
@@ -217,9 +219,9 @@ class Gfycat:
|
|||||||
try:
|
try:
|
||||||
POST['mediaURL'] = self.getLink(POST['postURL'])
|
POST['mediaURL'] = self.getLink(POST['postURL'])
|
||||||
except IndexError:
|
except IndexError:
|
||||||
raise NotADownloadableLinkError
|
raise NotADownloadableLinkError("Could not read the page source")
|
||||||
except Exception as exception:
|
except Exception as exception:
|
||||||
raise NotADownloadableLinkError
|
raise NotADownloadableLinkError("Could not read the page source")
|
||||||
|
|
||||||
POST['postExt'] = getExtension(POST['mediaURL'])
|
POST['postExt'] = getExtension(POST['mediaURL'])
|
||||||
|
|
||||||
@@ -266,7 +268,7 @@ class Gfycat:
|
|||||||
break
|
break
|
||||||
|
|
||||||
if "".join(link) == "":
|
if "".join(link) == "":
|
||||||
raise NotADownloadableLinkError
|
raise NotADownloadableLinkError("Could not read the page source")
|
||||||
|
|
||||||
return "".join(link)
|
return "".join(link)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user