ThioJoe / YT-Spammer-Purge

Allows you easily scan for and delete scam comments using several methods.
GNU General Public License v3.0
4.52k stars 391 forks source link

Listing a removed video causes infinite loop #958

Closed killtheplanet closed 1 year ago

killtheplanet commented 1 year ago

Duplicate Issues

What happened?

When choosing 'scan specific videos' and one of your videoIDs has been removed by the uploader you get this message repeatedly:

Invalid Video link or ID! Video IDs are 11 characters long.
Invalid Video link or ID! Video IDs are 11 characters long.
Invalid Video link or ID! Video IDs are 11 characters long.
Invalid Video link or ID! Video IDs are 11 characters long.
...

This happens until you run out of quota.

My expectation would be for a invalid/unknown/removed video to be removed from the list of videos and to carry on.

Release version

2.16.10

Steps to reproduce

SpamPurgeConfig.ini snippit:

...
[scanning]
    # Scan Mode: Scan either a single video or your whole channel
    # Default = Ask  --  Possible Values: Ask | ChosenVideos | RecentVideos | EntireChannel | CommunityPost | RecentCommunityPosts
scan_mode = ChosenVideos
max_comments = 10000
videos_to_scan = iKbgQKUKHrQ,iEM2OjF1Jqk,iCLr0jg57Mk,i9c3UUgplAo,i8M6mcZySsQ,i3mmwlTd0w4,i2HWbHIQaNk,i1nQWdGyODU,i-Rc
yEVWunc,hwQ5sZgAN8k,hw5H0GpAcaU,htYHbpy_VLU,hsxEePyg6bU,hqxsYWIFfI8,gzzVQFuGSdI
channel_to_scan =  UCT44w6854K62cSiwA1aiXfw
recent_videos_amount = 20
...

In the videos_to_scan list above the last video has been removed - however order of the video list does not matter:

> At any prompt, enter 'X' to return here                  Update Available:  Beta
> Enter 'Q' now to quit

-------------------------------- Scanning Options --------------------------------
      1. Scan specific videos
      2. Scan recent videos for a channel
      3. Scan recent comments across your Entire Channel
      4. Scan a specific community post (Experimental)
      5. Scan recent community posts for a channel (Experimental)

--------------------------------- Other Options ----------------------------------
      6. Create your own config file(s) to run the program with pre-set settings
      7. Remove comments using a pre-existing list or log file
      8. Recover deleted comments using log file
      9. Check & Download Updates

Invalid Video link or ID! Video IDs are 11 characters long.

Invalid Video link or ID! Video IDs are 11 characters long.

Invalid Video link or ID! Video IDs are 11 characters long.

Invalid Video link or ID! Video IDs are 11 characters long.

This continues until I run out of quota

What platform are you seeing this problem on?

Linux (can also be ChromeOS)

Relevant log output

Error Message: <HttpError 403 when requesting https://youtube.googleapis.com/youtube/v3/videos?part=snippet%2Cid%2Cstatistics&id=gz2VWFuGSdI&fields=items%2Fid%2Citems%2Fsnippet%2FchannelId%2Citems%2Fsnippet%2FchannelTitle%2Citems%2Fstatistics%2FcommentCount%2Citems%2Fsnippet%2Ftitle&alt=json returned "The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.". Details: "[{'message': 'The request cannot be completed because you have exceeded your <a href="/youtube/v3/getting-started#quota">quota</a>.', 'domain': 'youtube.quota', 'reason': 'quotaExceeded'}]">
Status Code: 403
    Reason: quotaExceeded

Error: You have exceeded the YouTube API quota. To do more scanning you must wait until the quota resets.
 > There is a daily limit of 10,000 units/day, which works out to around reporting 10,000 comments/day.
 > You can check your quota by searching 'quota' in the google cloud console.
Solutions: Either wait until tomorrow, or create additional projects in the cloud console.
  > Read more about the quota limits for this app here: TJoe.io/api-limit-info

An 'HttpError' was raised. This is sometimes caused by a remote server error. See the error info above.
If this keeps happening, consider posting a bug report on the GitHub issues page, and include the above error info.
Short Link: TJoe.io/bug-report


### Screenshots

_No response_
ThioJoe commented 1 year ago

Ok this should be fixed with the latest commit, and will be in the next release Beta 4 which I'll release today