Fixed excessive blank lines during scanning

This should fix all the extra blank lines that appear between videos when there are multiple being scanned.
This commit is contained in:
ThioJoe
2024-01-01 17:40:55 -07:00
parent a355916b45
commit b774de2f2d
4 changed files with 26 additions and 16 deletions

View File

@@ -205,7 +205,7 @@ def main(communityPostID=None, limit=1000, sort=SORT_BY_RECENT, language=None, p
if postScanProgressDict:
i = postScanProgressDict['scanned']
j = postScanProgressDict['total']
print(f'\n\n [{i}/{j}] Post ID: {communityPostID}')
print(f'[{i}/{j}] Post ID: {communityPostID}')
else:
print(f'\n Loading Comments For Post: {communityPostID}')

View File

@@ -153,12 +153,12 @@ def get_comments(current, filtersDict, miscData, config, allVideoCommentsDict, s
if filtersDict['filterMode'].lower() in dupeCheckModes:
print(" Analyzing For Duplicates ", end="\r")
check_duplicates(current, config, miscData, allVideoCommentsDict, scanVideoID)
print(" ")
print(" ", end="\r")
repostCheckModes = utils.string_to_list(config['stolen_comments_check_modes'])
if filtersDict['filterMode'].lower() in repostCheckModes:
print(" Analyzing For Reposts ", end="\r")
check_reposts(current, config, miscData, allVideoCommentsDict, scanVideoID)
print(" ")
print(" ", end="\r")
current.allScannedCommentsDict.update(allVideoCommentsDict)
return RetrievedNextPageToken, allVideoCommentsDict
@@ -649,7 +649,7 @@ def check_duplicates(current, config, miscData, allVideoCommentsDict, videoID):
scannedCount +=1
print(f" Analyzing For Duplicates: [ {scannedCount/authorCount*100:.2f}% ] (Can be Disabled & Customized With Config File)".ljust(75, " "), end="\r")
print("".ljust(110, " ")) # Erase line
print("".ljust(110, " "), end='\r') # Erase line
############################# Check Text Reposts #####################################
@@ -1492,7 +1492,7 @@ def print_count_stats(current, miscData, videosToScan, final):
matchCount = str(len(current.matchedCommentsDict) + len(current.spamThreadsDict))
if final == True:
print(f" {progress} Comments Scanned: {F.YELLOW}{comScanned}{S.R} | Replies Scanned: {F.YELLOW}{repScanned}{S.R} | Matches Found So Far: {F.LIGHTRED_EX}{matchCount}{S.R}\n")
print(f" {progress} Comments Scanned: {F.YELLOW}{comScanned}{S.R} | Replies Scanned: {F.YELLOW}{repScanned}{S.R} | Matches Found So Far: {F.LIGHTRED_EX}{matchCount}{S.R}", end = "\r")
else:
print(f" {progress} Comments Scanned: {F.YELLOW}{comScanned}{S.R} | Replies Scanned: {F.YELLOW}{repScanned}{S.R} | Matches Found So Far: {F.LIGHTRED_EX}{matchCount}{S.R}", end = "\r")

View File

@@ -88,7 +88,16 @@ def check_list_against_string(listInput, stringInput, caseSensitive=False):
return True
else:
return False
######################### Clear multiple previous lines #########################
def clear_lines(up, down=0):
LINE_UP = '\033[1A'
LINE_CLEAR = '\x1b[2K'
print(LINE_CLEAR, end="")
for i in range(up):
print(LINE_UP, end=LINE_CLEAR)
if down > 0:
print("\n"*down, end="\r")
################### Process Comma-Separated String to List ####################
# Take in string, split by commas, remove whitespace and empty items, and return list