Giter Club home page Giter Club logo

Comments (9)

mikebilly avatar mikebilly commented on May 26, 2024

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.

pacoorozco avatar pacoorozco commented on May 26, 2024

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.

mikebilly avatar mikebilly commented on May 26, 2024

@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.

pacoorozco avatar pacoorozco commented on May 26, 2024

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.

mikebilly avatar mikebilly commented on May 26, 2024

@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.

pacoorozco avatar pacoorozco commented on May 26, 2024

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.

mikebilly avatar mikebilly commented on May 26, 2024

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.

pacoorozco avatar pacoorozco commented on May 26, 2024

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.

mikebilly avatar mikebilly commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.