So today I tried to build a python script which would bulk download photos from Google Photos vs using the terrible Google Takeout app… well here’s what Google Gemini told me when I asked why I keep getting a 403 error.
Based on the error you are seeing and the current date, you have likely hit the "2025 Google Photos API Lockout." As of March 31, 2025, Google deprecated the photoslibrary.readonly scope for general library access. This means that while your login is "successful," Google automatically strips the permissions from your token because third-party scripts are no longer allowed to browse your entire library automatically.
I have rewritten your script below to perform a "Scope Block Test." It will attempt to connect using the new, restricted scope (...appcreateddata) to see if Google allows that. If the script works with the new scope but finds 0 photos, it confirms that the API is working but you are blocked from seeing your general library.