diff --git a/script.py b/script.py index 0f8bff9..f5cac50 100644 --- a/script.py +++ b/script.py @@ -465,10 +465,9 @@ def downloadPost(SUBMISSION): "imgur":Imgur,"gfycat":Gfycat,"erome":Erome,"direct":Direct,"self":Self } + print() if SUBMISSION['postType'] in downloaders: - print(SUBMISSION['postType'].upper(),end=" ") - if SUBMISSION['postType'] == "imgur": while int(time.time() - lastRequestTime) <= 2: @@ -483,13 +482,14 @@ def downloadPost(SUBMISSION): + str(int(IMGUR_RESET_TIME%60)) \ + " Seconds") - print( - "==> Client: {} - User: {} - Reset {}".format( - credit['ClientRemaining'], - credit['UserRemaining'], - USER_RESET - ),end="" - ) + if credit['ClientRemaining'] < 25 or credit['UserRemaining'] < 25: + print( + "==> Client: {} - User: {} - Reset {}".format( + credit['ClientRemaining'], + credit['UserRemaining'], + USER_RESET + ),end="" + ) if not (credit['UserRemaining'] == 0 or \ credit['ClientRemaining'] == 0): @@ -509,7 +509,6 @@ def downloadPost(SUBMISSION): raise ImgurLimitError('{} LIMIT EXCEEDED\n'.format(KEYWORD.upper())) - print() downloaders[SUBMISSION['postType']] (directory,SUBMISSION) else: @@ -531,17 +530,13 @@ def download(submissions): FAILED_FILE = createLogFile("FAILED") for i in range(subsLenght): - print("\n({}/{})".format(i+1,subsLenght)) print( - "https://reddit.com/r/{subreddit}/comments/{id}".format( - subreddit=submissions[i]['postSubreddit'], - id=submissions[i]['postId'] - ) + f"\n({i+1}/{subsLenght}) ({submissions[i]['postType'].upper()}) " \ + f"(r/{submissions[i]['postSubreddit']})",end="" ) if isPostExists(submissions[i]): - print(submissions[i]['postType'].upper()) - print("It already exists") + print("\nIt already exists") duplicates += 1 downloadedCount -= 1 continue @@ -684,7 +679,6 @@ if __name__ == "__main__": except KeyboardInterrupt: if GLOBAL.directory is None: GLOBAL.directory = Path(".\\") - print("\nQUITTING...") except Exception as exception: if GLOBAL.directory is None: diff --git a/src/searcher.py b/src/searcher.py index 4c12676..d534437 100644 --- a/src/searcher.py +++ b/src/searcher.py @@ -125,7 +125,7 @@ def getPosts(args): if args["user"] == "me": args["user"] = str(reddit.user.me()) - print("\nGETTING POSTS\n.\n.\n.\n") + # print("\nGETTING POSTS\n.\n.\n.\n") if not "search" in args: if args["sort"] == "top" or args["sort"] == "controversial":