Comments (9)
Then I tried to upload manually, not using gphotos-upload-cli
, by running this code:
headers = {
'Authorization': 'Bearer ' + token.access_token,
'Content-type': 'application/octet-stream',
'X-Goog-Upload-Protocol': 'raw'
}
file_path = "/content/drive/MyDrive/Manh content/11_10_2023/DCIM/Camera/20231009_201204.mp4"
headers['X-Goog-Upload-File-Name'] = filename(file_path)
upload_url = 'https://photoslibrary.googleapis.com/v1/uploads'
media = open(file_path, 'rb').read()
response = requests.post(upload_url, data=media, headers=headers)
request_body = {
'newMediaItems': [
{
'description': '',
'simpleMediaItem': {
'uploadToken': response.content.decode('utf-8')
}
}
]
}
upload_response = service.mediaItems().batchCreate(body=request_body).execute()
and it returned this error:
HttpError: <HttpError 429 when requesting https://photoslibrary.googleapis.com/v1/mediaItems:batchCreate?alt=json returned "Quota exceeded for quota 'concurrent write request' of service 'photoslibrary.googleapis.com'.". Details: "Quota exceeded for quota 'concurrent write request' of service 'photoslibrary.googleapis.com'.">
So maybe gphotos-uploader-cli
tried to upload too many items at once? But I never had this problem a few days ago, and back then I uploaded a lot more photos and videos compared to today. And I would never know the exact response from the api if gphotos-upload-cli
only outputted this on the debug log:
[fail] X Error processing /content/drive/MyDrive/Manh content/9_10_2923/DCIM/Camera/20231008_001958.mp4: creating media items: Post "https://photoslibrary.googleapis.com/v1/mediaItems:batchCreate?alt=json": POST https://photoslibrary.googleapis.com/v1/mediaItems:batchCreate?alt=json giving up after 4 attempt(s)
So in addition, please catch difference errors from google photos api
so that people will know what their error actually is.
from gphotos-uploader-cli.
Did you run the gphotos-uploader-cli
using the --debug
flag? I would expect that using it you will be able to see the Google Photos API messages.
Check the quota limits that Google Photos API publish, AFAIK you're hitting one of them.
from gphotos-uploader-cli.
@pacoorozco yes I always run commands with --debug
flag, that's how I see this error:
[fail] X Error processing /content/drive/MyDrive/Manh content/9_10_2923/DCIM/Camera/20231008_001958.mp4: creating media items: Post "https://photoslibrary.googleapis.com/v1/mediaItems:batchCreate?alt=json": POST https://photoslibrary.googleapis.com/v1/mediaItems:batchCreate?alt=json giving up after 4 attempt(s)
but that's all I see, I don't see any specific Google Photos API
messages.
If you say that I'm getting quota limits, I didn't hit quota limits a few days ago, I only got the errors today, while I only uploaded few photos and videos.
from gphotos-uploader-cli.
I'll review why the Google Photos API error is not shown. Based on your previous message Quota exceeded for quota 'concurrent write request' of service 'photoslibrary.googleapis.com'
points exactly to a quota limit reach at Google Photos API.
You can see it in your Google Photos API console (hopefully) or just rely on the error message that you shared
from gphotos-uploader-cli.
@pacoorozco I actually tried creating many new Google Photos API console projects to see if the quota is 0 but still got that error.
from gphotos-uploader-cli.
It could be, I don't know how Google has implemented this quota, maybe it's by IP address, by Google Photos account, by Google Cloud Project or a permutation of them... 🤷🏼
from gphotos-uploader-cli.
Seems like Drive for desktop
ate up all my quotas. I was uploading some photos and videos by syncing through Drive for desktop
and later used gphotos-uploader-cli
to upload some more, but it cannot because I think Drive for desktop
used up all the quotas for today.
from gphotos-uploader-cli.
So, the problem was not gphotos-uploader-cli
which retried the error three times (given it was a retrievable error) and then gave up in order to not be blocked. The change I will do is to show the description of the Google Photos API errors in order to make easier the troubleshooting.
It's probably a regression, because it should be shown when using --debug
but it seems it's not. 🙇🏼
from gphotos-uploader-cli.
Seems like it's the problem with my google account. It always get Error processing
after uploading some files. If I try to upload files on my different google account, it never gets that error. Don't know why that happens.
from gphotos-uploader-cli.
Related Issues (20)
- Several SecretBackendTypes not working for MacOS HOT 2
- Unable to run latest version HOT 5
- Add option to specify web port for authentication HOT 1
- Photos "uploaded" but not showing up in google photos HOT 1
- Add a cli switch to specify the name of the album HOT 1
- Run headless by making it load from created credential json file HOT 8
- Uploads are showing date of upload as filename. HOT 5
- allow custom RedirectURLHostname HOT 2
- didn't find all files, please add ability to load file paths from txt. HOT 6
- Abort upload if v3 directories are found
- 4.2.0 doesn't show version HOT 2
- "option CreateAlbums is invalid, '⏎" on fresh installation HOT 2
- Error message for expired token could be clearer
- Missing steps in OAuth setup / authentication
- Pre resize/encode video to lower resolution and quality before upload HOT 2
- After upgrading from 3.5.2 to 4.5.0 it does not detect already uploaded images HOT 2
- unlimited storage HOT 2
- cannot upload a video that's more than 20gb HOT 1
- Is there any way to divide the job as smaller parts? Because Google api limits 10000 each day HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gphotos-uploader-cli.