google-photos-api

Retrieve file size for videos stored on Google Photos

感情迁移 提交于 2019-12-24 03:24:05
问题 Context: I wanted to see how I'm using my Google Photos space and I wrote a little script in Python that uses the Google Photos API to retrieve all my albums and it's contents (using https://developers.google.com/photos/library/reference/rest/v1/mediaItems/search). The file information is not there but using the mediaItem baseUrl (documented https://developers.google.com/photos/library/reference/rest/v1/mediaItems#MediaItem) I can then perform a HEAD request and get the content-length from

0Auth2 problem to get my google photos libraries in a google sheet of mine

。_饼干妹妹 提交于 2019-12-23 01:01:06
问题 I am trying to follow documentation but never get the 0Auth2 to connect. Btw I'm running the script manually from the google sheets scripting page, where should I get prompting for allowing access? (I don't understand all this 0Auth2 scheme and I have already gave authorization to run the script and got client id and secret)... See below my log and script routines (the first get to photo is still minimalistic as I didn't yet get through the 0Auth2 step ;-) . Thanks in advance for any hint. I

Uploading photo to Google Photos API not returning upload token

[亡魂溺海] 提交于 2019-12-22 05:11:53
问题 I'm using the 2018 version of the Google Photos API to upload images and media as documented here: "Uploading Bytes" When I upload a new image or video I never get an upload token in the body of the response. It's always an empty body, which according to the above link means that the bytes have already been uploaded (but this is a new upload). Here's an example request/response: request: POST https://photoslibrary.googleapis.com/v1/uploads request headers: authorization: Bearer abcd1234 X

Is it possible to load google photos metadata into google sheets?

馋奶兔 提交于 2019-12-22 01:03:36
问题 I have a project where I have scanned 10,000 family pictures from as far back as the 1900's and I am organizing them in Google Photos. I have a spreadsheet where I was keeping track of the proper dates and captions for the entire collection. I would organize a few at a time but then recently found out about the google photos API. I would like to use something like the methods Method: mediaItems.list or Method: mediaItems.search to get the data from my photos into the spreadsheet to manage.

Google Photos Library API IDs are invalid

限于喜欢 提交于 2019-12-14 02:54:34
问题 Cached IDs of media items, albums and enrichment items stopped working. For example, calling mediaItems.get with a media item ID that was stored returns the following error: { "error": { "code": 400, "message": "Invalid media item ID.", "status": "INVALID_ARGUMENT" } } 回答1: The format of all IDs returned by the Google Photos Library API changed on September 5. If you have stored IDs such as albums ids, media item ids, or enrichment item ids before 5th September 2018, these will no longer work

Q: Google Photos Library API - I don't know how it works, someone?

心不动则不痛 提交于 2019-12-10 12:19:32
问题 I'm trying to load an album from Google Photos via javascript but I don't understand how the api works, I started reading Google Photos API but no luck. Is there a code reference that I can follow to get a list of the photos of my album? I found this but doesn't work <script> var scopeApi = ['https://www.googleapis.com/auth/photoslibrary', 'https://www.googleapis.com/auth/photoslibrary.readonly', 'https://www.googleapis.com/auth/photoslibrary.readonly.appcreateddata']; function

Integrate Google Photos Library API in android application

天涯浪子 提交于 2019-12-06 13:54:09
问题 I want to integrate google photos api in android,I have done google sign in process but I am not able to get access token because i was getting error in FixedCredentialsProvider.create method while passing parameter. PhotosLibrarySettings settings = PhotosLibrarySettings.newBuilder() .setCredentialsProvider( FixedCredentialsProvider.create(/ Add credentials here. /)) .build(); try (PhotosLibraryClient photosLibraryClient = PhotosLibraryClient.initialize(settings)) { // Create a new Album with

Can upload photo when using the Google Photos API

我怕爱的太早我们不能终老 提交于 2019-12-06 06:43:53
问题 I am trying to upload a photo (jpg image) using the new Google Photos API. I am able to get an uploadToken but when I try to create the media item I get the following error: { "newMediaItemResults": [ { "uploadToken": "CAIS+QIAkor2Yr4JcvYMMx..... ", "status": { "code": 3, "message": "NOT_IMAGE: There was an error while trying to create this media item." } } ] } Here is a snippet of my code: import sys import json import requests pic = 'image.jpg' fname = 'read_write_token_creds.json' with

Google Photos API, pageSize Parameter not returning expected results

时光毁灭记忆、已成空白 提交于 2019-12-06 03:33:41
问题 Using the Google Photos API Explorer I am trying to limit the number of albums returned using the albums.list method. If I set pageSize = 10, the api explorer returns 5 albums, if I set it to 3 in returns 1 album. Any suggestions as to why I am not seeing the same number of albums in the response as is set via the pageSize parameter? Thanks 回答1: The page size describes the desired maximum number of results, but it is no guarantee. If you need at least 10 results from a single request, your

Uploading photo to Google Photos API not returning upload token

六眼飞鱼酱① 提交于 2019-12-05 06:03:01
I'm using the 2018 version of the Google Photos API to upload images and media as documented here: " Uploading Bytes " When I upload a new image or video I never get an upload token in the body of the response. It's always an empty body, which according to the above link means that the bytes have already been uploaded (but this is a new upload). Here's an example request/response: request: POST https://photoslibrary.googleapis.com/v1/uploads request headers: authorization: Bearer abcd1234 X-Goog-Upload-Protocol: raw X-Goog-Upload-File-Name: 20140317T082917_001.jpg content-type: application