-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
403 forbidden possibly due to rate limit #12
Comments
@SecDWizar Thanks for the detailed report! I think I understand the problem. For an immediate fix, try again with "Refresh media items" checked (as it is by default) now that the daily quota has been reset. This should re-fetch media items and resolve the 403s (although it might actually take 2 days' quota, see below). The Photos API returns a Based on the 2056 subtasks, I estimate your total library size is ~100k media items. The tool won't call baseUrls again for any media items it already has a size/image for, but it will use 1 call for the image and 1 call for the size, so it might require 3 days total quota to get images and sizes for your whole library. Longer term, I want to handle this situation more gracefully upfront with user-facing messaging, and provide an option to not fetch size so that the daily quota can all go towards downloading images. |
Thank you very much for this explanation, now it's all clear (and those long guid urls make sense). A couple of small questions:
How do you track changes? adding from the phone images or deleting from the phone images. again if getting all the media items is just one API call, then processing it (which can be expensive, need a nice data structure for this - but this is done on my computer so who cares), this should even be done periodically IMHO and processed in the background (well, maybe it's a technical challenge) and even offer in the GUI occasionally, with the changes you discussed about, some prompt that media item changes detected, 100 more images added/scanned, 50 removed, etc. make that work (and gui) thus dynamic. What are your thoughts? |
The image metadata is stored in MongoDB. The port is exposed by default when you run
Yes, that's what it should probably do instead - plus notify the user that the quota was hit then keep going once the quota resets. I wasn't sure when the quota reset, so knowing it reset for you at midnight PST is helpful. I also don't have an option yet to cancel the current task, that'd be helpful once the quota is hit in case you want to shut the whole thing down and try again later.
The Photos API makes this difficult. There's no way to filter by modified date or anything. In fact, it doesn't even tell you how many media items exist - it just returns a next page token and you have to keep iterating until there are no more pages. Getting the media item metadata is the least expensive part though, it's calling the baseUrls and storing the images that takes more time, which is why I've parallelized it. |
@SecDWizar This should be addressed by #16. The task will now fail once quota is hit, but progress is saved and it can be restarted the next day. |
Hi Hi, Progress is saved with/out "refresh media items"? I've pulled and rebuilt the images - that should do it, right? |
Found it. so I think that's a different bug, want me to open a new one for that?
|
In that case it should be done on schedule and kept (Mongo) IMHO, perhaps even a UI option of triggering that refresh and also to set that schedule (by default once a day). from what I understand it's pagination-amount-api-calls right? how many entries per page? say if one has ~100K items, and 100 entries per page that'll be 1K calls, ,if it's 10 entries it'll be 10K calls, etc.? so that's problematic... I'm just thinking that images are added by the phone all the time. also sometimes people delete them. Maybe it shouldn't be at a schedule and just that "refresh media items" will refresh it by choice, so once in a while you'd hit that and it'll resync everything, right? |
Hi,
I've started last evening the process which processed quite quickly until it finished the 75,000 "Base URL requests per day" quota,
Overnight it continued advancing very slowly the numbers with "WARNING/ForkPoolWorker-32] Received 429 Client Error: Too Many Requests for url" (maybe skipped those). which is fine.
Waiting for subtasks to complete... (934 / 2056) advanced over this time (429 errors) about 200 numbers...
At pacific midnight the quota was reset, the app started chugging again but now I got:
"WARNING/ForkPoolWorker-23] Received 403 Client Error: Forbidden for url: https://lh3.googleusercontent.com/lr/... getting media item size"
tons of them quickly, those tasks numbers raised a bit, perhaps 100-200 and stopped raising, at this time tens of thousands of requests (by the logs) happened with those 403 forbidden.
From reading about this - this is also some rate limit, here it's mentioned to add "referrerpolicy". so what are those 403 errors?
The text was updated successfully, but these errors were encountered: