Skip to content

Commit

Permalink
Update Script - Fix not skipping asking channel
Browse files Browse the repository at this point in the history
When asking for the channel to scan most recent videos for, it wasn't breaking from the while loop if the config file was set, and therefore was still asking. Now fixed.
Also added debug mode for testing single comment
  • Loading branch information
ThioJoe committed Dec 22, 2021
1 parent e0f6bb6 commit 9106a30
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions YouTubeSpammerPurge.py
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,12 @@ def check_against_filter(currentUser, miscData, filterMode, filterSubMode, comme
global matchedCommentsDict
commentTextOriginal = str(commentText)

debugSingleComment = False
if debugSingleComment == True:
authorChannelName = input("Channel Name: ")
commentText = input("Comment Text: ")
authorChannelID = "x"

# Do not even check comment if author ID matches currently logged in user's ID
if currentUser[0] != authorChannelID and miscData['channelOwnerID'] != authorChannelID:
if "@" in commentText:
Expand Down Expand Up @@ -446,6 +452,8 @@ def add_spam(commentID, videoID):
authorMatchCountDict[authorChannelID] += 1
else:
authorMatchCountDict[authorChannelID] = 1
if debugSingleComment == True:
input("--- Match -----")

# Checks author of either parent comment or reply (both passed in as commentID) against channel ID inputted by user
if filterMode == "ID":
Expand Down Expand Up @@ -519,13 +527,15 @@ def add_spam(commentID, videoID):
domainRegex = inputtedUsernameFilter['domainRegex']
compiledRegexDict = inputtedUsernameFilter['compiledRegexDict']
languages = inputtedUsernameFilter['languages']
sensitive = inputtedUsernameFilter['sensitive']

if debugSingleComment == True:
if input("Sensitive True/False: ").lower() == 'true': sensitive = True
else: sensitive = False

# Check for sensitive smart mode
if inputtedUsernameFilter['sensitive'] == True:
sensitive = True
# Check for sensitive smart mode
if sensitive == True:
domainRegex = inputtedUsernameFilter['sensitiveDomainRegex']
else:
sensitive = False

# Processed Variables
combinedString = authorChannelName + commentText
Expand Down Expand Up @@ -2174,6 +2184,7 @@ def main():
channelID = currentUser[0]
channelTitle = currentUser[1]
validChannel = True
break
else:
validChannel, channelID, channelTitle = validate_channel_id(config['channel_to_scan'])
if validChannel == True:
Expand Down

0 comments on commit 9106a30

Please sign in to comment.