ThioJoe / YT-Spammer-Purge

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

[Bug]: Can't login: 'NoneType' object has no attribute 'replace' #761

Open j5155 opened 2 years ago

j5155 commented 2 years ago

Duplicate Issues

What happened?

I was trying to run YT Spammer Purge, which prompted me to login, but then when I finished logging in it gave me this error:


Please login using the browser window that opened just now.

Waiting for authorization. See message above.

Traceback (most recent call last):
  File "/home/j5155/Git/YT-Spammer-Purge/Scripts/auth.py", line 86, in first_authentication
    YOUTUBE = get_authenticated_service() # Create authentication object
  File "/home/j5155/Git/YT-Spammer-Purge/Scripts/auth.py", line 74, in get_authenticated_service
    creds = flow.run_local_server(port=0, authorization_prompt_message="Waiting for authorization. See message above.")
  File "/home/j5155/.local/lib/python3.9/site-packages/google_auth_oauthlib/flow.py", line 476, in run_local_server
    authorization_response = wsgi_app.last_request_uri.replace("http", "https")
AttributeError: 'NoneType' object has no attribute 'replace'
----------------
[!!!] Error: 'NoneType' object has no attribute 'replace'
If you think this is a bug, you may report it on this project's GitHub page: https://github.com/ThioJoe/YT-Spammer-Purge/issues

Error Code A-1: Something went wrong during authentication. Try deleting the token.pickle file. 
Press Enter to exit...

Release version

2.16.6

Steps to reproduce

Unknown, but for me it was:

  1. Start YT-Spammer-Purge
  2. Attempt to login in the browser window it opens
  3. See error

What platform are you seeing this problem on?

Linux (can also be ChromeOS), Python 3.9.7

Relevant log output

Loading YT Spammer Purge @ 2.16.6...

Please login using the browser window that opened just now.

Waiting for authorization. See message above.

Traceback (most recent call last):
  File "/home/j5155/Git/YT-Spammer-Purge/Scripts/auth.py", line 86, in first_authentication
    YOUTUBE = get_authenticated_service() # Create authentication object
  File "/home/j5155/Git/YT-Spammer-Purge/Scripts/auth.py", line 74, in get_authenticated_service
    creds = flow.run_local_server(port=0, authorization_prompt_message="Waiting for authorization. See message above.")
  File "/home/j5155/.local/lib/python3.9/site-packages/google_auth_oauthlib/flow.py", line 476, in run_local_server
    authorization_response = wsgi_app.last_request_uri.replace("http", "https")
AttributeError: 'NoneType' object has no attribute 'replace'
----------------
[!!!] Error: 'NoneType' object has no attribute 'replace'
If you think this is a bug, you may report it on this project's GitHub page: https://github.com/ThioJoe/YT-Spammer-Purge/issues

Error Code A-1: Something went wrong during authentication. Try deleting the token.pickle file. 
Press Enter to exit...

Screenshots

No response

DinhHuy2010 commented 2 years ago

when you login, does say "The authentication flow has completed. You may close this window." or network error?

ThioJoe commented 2 years ago

This seems to be the same issue as #275 and probably has to do with the browser. Try the suggestion in this post which worked for others: https://github.com/googleapis/google-auth-library-python-oauthlib/issues/69#issuecomment-834720945

j5155 commented 2 years ago

I use Firefox similar to other people having this issue, but temporarily using a Chromium-based browser fixed it. However, it seems like you might want to put info somewhere about Firefox being incompatible (or find out why).

TechStudent10 commented 2 years ago

I use Firefox similar to other people having this issue, but temporarily using a Chromium-based browser fixed it. However, it seems like you might want to put info somewhere about Firefox being incompatible (or find out why).

Not sure if you've tried this, but I found this help thread on the Mozilla Support page: https://support.mozilla.org/en-US/questions/1312203