Merge branch 'feature-download-delay' of https://github.com/dwbfox/bulk-downloader-for-reddit into dwbfox-feature-download-delay

This commit is contained in:
Ali Parlakci
2021-03-26 13:04:22 +03:00
2 changed files with 13 additions and 0 deletions

View File

@@ -33,6 +33,8 @@ from src.programMode import ProgramMode
from src.reddit import Reddit
from src.store import Store
from time import sleep
__author__ = "Ali Parlakci"
__license__ = "GPL"
__version__ = "1.9.4"
@@ -154,6 +156,7 @@ def download(submissions):
try:
downloadPost(details, directory)
GLOBAL.downloadedPosts.add(details['POSTID'])
try:
if GLOBAL.arguments.unsave:
reddit.submission(id=details['POSTID']).unsave()
@@ -161,6 +164,10 @@ def download(submissions):
reddit = Reddit().begin()
reddit.submission(id=details['POSTID']).unsave()
if GLOBAL.arguments.download_delay:
print(f"Delaying next download for {GLOBAL.arguments.download_delay} seconds...")
sleep(GLOBAL.arguments.download_delay)
downloadedCount += 1
except FileAlreadyExistsError: