TL;DR Google drive does the 24 hour bans on google drive when doing a plex scan not because of api requests but because plex tries to analyze every file which triggers every file being scanned to download through rclone. Google blocks this mass download as abuse via a 24 ban. This could be stopped by a flag on the rclone mount command along with some logic to determine a user requested stream vs a library scan.
So from reading here and around the internet it seems that google is locking drive accounts NOT for number of api requests but file downloading on a large automated scale.
So when PLEX scans your library it analyzes your video files too, on a local disk this is no big deal but on a cloud storage mount it means it is downloading all your media to scan that’s 20+ tb for me. Some other users here have mentioned that after they got a 24hr ban PLEX continued to scan in media this is because PLEX could still pull file and directory names names off the mount.
I can support my claim:
PLEX cloud fixed the google drive bans by only indexing your files by file names. When plex cloud was getting banned it would generate thumbnails for my home movies but now that it does not get the 24hr ban it is not able to generate thumbnails for media it will only scrape meta data for known media from sites like themoviedb.org so this shows previously plex was downloading each file to analyze. This mass download is what triggers google drive to lock the account to prevent abuse. I could offer more supporting evidence but I am busy and don’t have more time to write up the info. It would be most simple if plex would implement this feature on self installed/non-cloud servers but for the time being I think we can work around the issue.
MY SIMPLE FIX:
Have a flag for the mount that will block automated mass file downloads, while still allowing individual users stream.
e.g. rclone mount --ban-protect gdrive:/plex /mnt/plex
(I have some other ideas for mount flags that will allow more control for the individual user)
There could be some basic logic to detect if it is a plex scan vs a user streaming
- number of requests per second (automated requests would happen quickly and could trigger a lock)
- directory request timing (an automated scan would craw between multiple directories quickly an individual request would not)
- max number of downloads/file snags/streams off of mount per second
If there is a way I can see what is happening with rclone in realtime I could watch what it looks like to rclone during a plex scan vs a user requested stream and come up with a way for rclone to differentiate the two so streaming can be kept from getting locked out while still allowing rclone to block excessive file download requests by plex.
the most rudimentary fix for endusers that would allow people to use the fix almost right away, a flag that would lock all downloads from google drive and a bash script that would:
- unmount gdrive: umount /mnt/plex
- remount gdrive in ban protected mode: rclone mount --gdrive-ban-protect gdrive:/plex /mnt/plex
- execute plex scan
- upon plex scan completion unmount gdrive: umount /mnt/plex
- remount gdrive normally