mirror of
https://github.com/KevinMidboe/bulk-downloader-for-reddit.git
synced 2026-01-23 09:35:40 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b5d6165802 | ||
|
|
b98815376f | ||
|
|
d9586f99b8 | ||
|
|
76711892a2 | ||
|
|
bfea548eab |
@@ -22,7 +22,7 @@ from src.tools import (GLOBAL, createLogFile, jsonFile, nameCorrector,
|
|||||||
|
|
||||||
__author__ = "Ali Parlakci"
|
__author__ = "Ali Parlakci"
|
||||||
__license__ = "GPL"
|
__license__ = "GPL"
|
||||||
__version__ = "1.5.0"
|
__version__ = "1.5.1"
|
||||||
__maintainer__ = "Ali Parlakci"
|
__maintainer__ = "Ali Parlakci"
|
||||||
__email__ = "parlakciali@gmail.com"
|
__email__ = "parlakciali@gmail.com"
|
||||||
|
|
||||||
@@ -467,7 +467,7 @@ def downloadPost(SUBMISSION):
|
|||||||
|
|
||||||
if SUBMISSION['postType'] in downloaders:
|
if SUBMISSION['postType'] in downloaders:
|
||||||
|
|
||||||
print(SUBMISSION['postType'].upper())
|
print(SUBMISSION['postType'].upper(),end=" ")
|
||||||
|
|
||||||
if SUBMISSION['postType'] == "imgur":
|
if SUBMISSION['postType'] == "imgur":
|
||||||
|
|
||||||
@@ -484,11 +484,11 @@ def downloadPost(SUBMISSION):
|
|||||||
+ " Seconds")
|
+ " Seconds")
|
||||||
|
|
||||||
print(
|
print(
|
||||||
"Client: {} - User: {} - Reset {}".format(
|
"==> Client: {} - User: {} - Reset {}".format(
|
||||||
credit['ClientRemaining'],
|
credit['ClientRemaining'],
|
||||||
credit['UserRemaining'],
|
credit['UserRemaining'],
|
||||||
USER_RESET
|
USER_RESET
|
||||||
)
|
),end=""
|
||||||
)
|
)
|
||||||
|
|
||||||
if not (credit['UserRemaining'] == 0 or \
|
if not (credit['UserRemaining'] == 0 or \
|
||||||
@@ -509,6 +509,7 @@ def downloadPost(SUBMISSION):
|
|||||||
|
|
||||||
raise ImgurLimitError('{} LIMIT EXCEEDED\n'.format(KEYWORD.upper()))
|
raise ImgurLimitError('{} LIMIT EXCEEDED\n'.format(KEYWORD.upper()))
|
||||||
|
|
||||||
|
print()
|
||||||
downloaders[SUBMISSION['postType']] (directory,SUBMISSION)
|
downloaders[SUBMISSION['postType']] (directory,SUBMISSION)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
|
|||||||
@@ -61,13 +61,14 @@ def getFile(fileDir,tempDir,imageURL,indent=0):
|
|||||||
tempDir,
|
tempDir,
|
||||||
reporthook=dlProgress)
|
reporthook=dlProgress)
|
||||||
os.rename(tempDir,fileDir)
|
os.rename(tempDir,fileDir)
|
||||||
print(" "*indent+"Downloaded"+" "*10)
|
|
||||||
break
|
|
||||||
except ConnectionResetError as exception:
|
except ConnectionResetError as exception:
|
||||||
print(" "*indent + str(exception))
|
print(" "*indent + str(exception))
|
||||||
print(" "*indent + "Trying again\n")
|
print(" "*indent + "Trying again\n")
|
||||||
except FileNotFoundError:
|
except FileNotFoundError:
|
||||||
raise FileNameTooLong
|
raise FileNameTooLong
|
||||||
|
else:
|
||||||
|
print(" "*indent+"Downloaded"+" "*10)
|
||||||
|
break
|
||||||
else:
|
else:
|
||||||
raise FileAlreadyExistsError
|
raise FileAlreadyExistsError
|
||||||
|
|
||||||
@@ -90,10 +91,10 @@ class Erome:
|
|||||||
print(post["postSubmitter"]+"_"+title+"_"+post['postId']+extension)
|
print(post["postSubmitter"]+"_"+title+"_"+post['postId']+extension)
|
||||||
|
|
||||||
fileDir = directory / (
|
fileDir = directory / (
|
||||||
POST["postSubmitter"]+"_"+title+"_"+POST['postId']+extension
|
post["postSubmitter"]+"_"+title+"_"+post['postId']+extension
|
||||||
)
|
)
|
||||||
tempDir = directory / (
|
tempDir = directory / (
|
||||||
POST["postSubmitter"]+"_"+title+"_"+POST['postId']+".tmp"
|
post["postSubmitter"]+"_"+title+"_"+post['postId']+".tmp"
|
||||||
)
|
)
|
||||||
|
|
||||||
imageURL = "https:" + IMAGES[0]
|
imageURL = "https:" + IMAGES[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user