NiNiyas / autoscan

Fork of https://github.com/l3uddz/plex_autoscan with Jellyfin and Emby support.
GNU General Public License v3.0
54 stars 0 forks source link

Can't authenticate with Google DRive #6

Open viseniv opened 1 year ago

viseniv commented 1 year ago

Whe i try to autherntiicate with Google Drive it gives me this error: "Error 400: invalid_request" I want to monitor a Team Drive, and send rclone to update the cache.

NiNiyas commented 1 year ago

Hi. Sorry for taking so long to reply. I think this is probably because Autoscan still uses the OOB method to authenticate, which was deprecated. Unfortunately, I don't have time to investigate this, but PRs are always welcome.

TeJayH commented 7 months ago

A quick fix is to replace this line in the /google/drive.py file

Change it from redirect_url = "urn:ietf:wg:oauth:2.0:oob" to redirect_url = "https://127.0.0.1"

With this change when you auth successfully you'll get redirected to an empty localhost URL and you can just copy your auth code from the &code= section, so in this example, code would be ABC123 pasted into scan.py. https://127.0.0.1/?state=NONSENSEHERE&code=ABC123&scope=https://www.googleapis.com/auth/drive

Not making it a proper PR because this is a pretty terrible way to do it, I just don't know the proper way, we can wait for someone who actually knows the modern gdrive api to do a proper fix but until then I can confirm this change makes the script functional for google drive again.

totermw_IONioPEAgZ 2

NiNiyas commented 1 week ago

Hey, this should now be fixed in the alpha branch. Could you please give that a try? If you are on docker, use ghcr.io/niniyas/autoscan:alpha_amd64 or ghcr.io/niniyas/autoscan:alpha_arm64, and don't forget to read the updated readme.