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

Any plan to add support to Google Photos? #369

Open
lssong99 opened this Issue Feb 24, 2016 · 70 comments

Comments

Projects
None yet
@lssong99
Copy link

lssong99 commented Feb 24, 2016

If possible, please add a support to upload photo/video files to Google Photos directly!

Although it's possible to add a "Google Photos" folder in Google Drive, and all your Google Photos will be there (organized by date folder), However, photos uploaded into this folder does not seems to reflect into Google Photos.

Also, if we upload in "High Quality" than there will be unlimited storage size for photos and Video. I am not sure the "down-sizing" is done locally or remotely by Google Photos server, however...

I realize Google Photo is not a good place to organize photos but it's a good place to share photos with others. And with a stock of 300k+ photos I really don't want to have my PC running for God-knows-how-long for the upload.... It's the job of RPi!

@ncw ncw added the enhancement label Feb 25, 2016

@ncw

This comment has been minimized.

Copy link
Owner

ncw commented Feb 25, 2016

Thanks for the suggestion.

There seems to be a comprehensive API here

https://developers.google.com/picasa-web/docs/2.0/developers_guide_protocol

@lssong99

This comment has been minimized.

Copy link
Author

lssong99 commented Feb 25, 2016

Yes, but I believe Picasa and it's API will be depreciated from May/1...

@ncw

This comment has been minimized.

Copy link
Owner

ncw commented Feb 25, 2016

Foo! Is there a different API for google photos that you can find?

@buchno

This comment has been minimized.

Copy link

buchno commented Mar 1, 2016

The Picasa API will continue to support uploading images:

Beginning May 1st, 2016, we’ll start rolling out changes to the Picasa Web Albums Data API and no longer support the following functionality:

  • Flash support
  • Community search
  • Mutation operations other than uploads
  • All support for tags, comments, and contacts

The API will still support other functions, including reading photos, reading albums, reading photos in albums, and uploading new photos. Although these operations will continue to be supported and the protocol will remain the same, the content included in the responses and the operation behavior may change.

https://developers.google.com/picasa-web/

Edit: Judging by this answer, it will however count towards the storage quota.

@lssong99

This comment has been minimized.

Copy link
Author

lssong99 commented Mar 1, 2016

Even if it count towards the storage quota, it is still possible to use "reclaim space" in the setting of Photos.google.com which will re-compress (or just convert?) it into non-quota related "high resolution" photos.

Thus before Google comes up with new Photos API (God knows when...), do you think it's the best solution we could get so far?

@kiddick

This comment has been minimized.

@calisro

This comment has been minimized.

Copy link

calisro commented Mar 3, 2016

I've been trying to accomplish this for a long time. I have a huge local store of photos that I want to store in google photos at 'high resolution' as to have them NOT count towards the quotas but instead only use it to be able to see these photos across google devices. If we upload to drive, we get hit with quotas. It would be absolutely awesome to be able to sync them with rclone at a 'under the quota' limit to G-Photos.

@lv913

This comment has been minimized.

Copy link

lv913 commented Apr 26, 2016

+1

Another useful functionality could be to arrange photos/videos in albums, i.e. using the folder name for that.
Nick, do you think that it would be possible to have Google Photos in roadmap soon or later?

Thanks!

@BenoitDuffez

This comment has been minimized.

Copy link

BenoitDuffez commented May 16, 2016

I was able to sync photos using this option from Google Drive:

Google Drive Settings

This created a folder called Google Photos which I could sync using:

rclone --exclude '*.{dng,CR2}' --include '{IMG,PANO,VID}_*.{jpg,mp4}' sync 'MyRemoteName:/Google Photos/2016' /mnt/raid0/GooglePhotos/2016/

This examples removes the RAW images because they come from my DSLR, which is already backed up. I'm only interested in the pics uploaded from mobile.

@ncw

This comment has been minimized.

Copy link
Owner

ncw commented May 16, 2016

@BenoitDuffez nice writeup thanks - a great way of downloading your pics from google photos.

It doesn't solve the upload part though which is what this issue is about.

@kiddick

This comment has been minimized.

Copy link

kiddick commented May 16, 2016

@ncw that's strange that Google still doesn't have official API for that..

@ncw ncw added this to the Unplanned / Help Wanted milestone Jul 15, 2016

@leocrawford

This comment has been minimized.

Copy link

leocrawford commented Aug 8, 2016

I'm the author of picasawebsync and believe that the picasaweb API is the only one that currently works for reasons that baffle me. However the binding libraries don't support OAUTH2 which is the only one supported by the REST API, so you have to make a manual workaround.

A quick look though seems to imply that google now does offer a two way sync between drive and photos (https://support.google.com/photos/answer/6156103?co=GENIE.Platform%3DAndroid&hl=en-GB) though I can't readily test it as I'm a google apps user

@TimJWatts

This comment has been minimized.

Copy link

TimJWatts commented Aug 22, 2016

2 comments based on tests I just did:

a) You can upload to Google Drive and have them displayed in Google Photos if you turn the setting on as someone may have said above. With the exception that Panasonic RW2 raw files render in GDrive but do not show in GPhotos.

b) GDrive is quite a nice medium to display and share photos. But does not have all the polish of GPhotos. And does not have a free option for JPEGs (won't affect me - I want to archive my RW2s and processed TIFFs/DNGs).

But it would be nice to have rclone support if it can be figured out :)

@TioBorracho

This comment has been minimized.

Copy link
Contributor

TioBorracho commented Aug 22, 2016

Sadly the reclaim space feature wouldn't work since the photos are uploaded via google drive according to this

@gbvaz

This comment has been minimized.

Copy link

gbvaz commented Nov 21, 2016

Hi, I know this is not a new topic, but is there any solution to the problem @TioBorracho was talking about? I'm facing the same situation, as related on Google Photos support forum topic.

Any help is appreciated!

@Webreaper

This comment has been minimized.

Copy link
Contributor

Webreaper commented Feb 1, 2017

Just seen this thread. You may be interested in the little app I put together to solve this:
https://github.com/Webreaper/GooglePhotoSync/
It was primarily designed for running on a Mac desktop (it sits in the menu bar, like the Google Drive app, and just uploads/downloads photos to GPhotos. But I also introduced a 'headless' mode, so you can run it on a box without a GUI. I have it running on my Synology NAS, and used it for a few months to upload pictures to the cloud.
The app currently uploads at full res but once I remember the setting I plan to make it an option to upload at the 16MP setting (which is free and doesn't count against your quota) - the idea being that I'll use my unlimited Amazon Cloud storage for proper backup (via rclone) and then have a low-res copy in GPhotos to take advantage of their advanced image search (at least until Amazon bring their intelligent search, aka Family Vault, to the UK).

You could also run leocrawford's excellent sync tool, which would work too.

As has been discussed, the 'two-way' sync between drive and GPhotos is massively limited:

  • Despite uploading all photos into named, organised folders (albums) into GPhotos, if you make them available through GDrive they just appear in month/year folders, which is really annoying.
  • As has been mentioned, uploading to GDrive and then making the pictures available in GPhotos will not upload them as 'free' resolution. However, you could periodically click the 'Recover storage' option after doing this, and it'll resize them for you. I did this earlier this week (having moved all my full-res images to Amazon Drive) and it resized 1.2TB of images (around 200k x 5MB-9MB images) in about 36 hours.

Perhaps a neat solution would be to see if there's an API for 'Recover Storage' - you could then run rclone to upload to Gdrive, and then automatically trigger a 'recover storage' process once it's uploaded. :D

@lv913

This comment has been minimized.

Copy link

lv913 commented Feb 28, 2017

@Webreaper

This comment has been minimized.

Copy link
Contributor

Webreaper commented Feb 28, 2017

@gerardo-junior

This comment has been minimized.

Copy link

gerardo-junior commented Dec 18, 2017

Any prediction for this feature?

@dzg

This comment has been minimized.

Copy link

dzg commented Dec 24, 2017

I would also love to be able to rclone to/from Google Photos.

Many items which are in my Google Photos are not showing up or syncing via the Google Photos folder in my Google Drive as they're supposed to.

The "Create a Google Photos folder" option in Drive is apparently unreliable; it does not show all items from Google Photos.

@Webreaper

This comment has been minimized.

Copy link
Contributor

Webreaper commented Dec 24, 2017

It's a bit pointless requesting this feature when Google have shut down the API that allows you to write to GPhotos. Also, I can tell you from my experience of writing a client back when the API was still available, it's in no way rich enough or functional enough to be able to implement with rclone.

If you're putting photos in Gdrive and they're not showing up in GPhotos, you should raise a support ticket with Google. I have a quarter of a million photos in Gdrive and they all show up just fine in Photos.

@dzg

This comment has been minimized.

Copy link

dzg commented Dec 24, 2017

@Webreaper Actually I'm more concerned with GP > GD ... My phone auto uploads all items to GP, then I use GD to sync them to my desktop. I noticed today that many items in my GP are not showing up in my GD.

@Webreaper

This comment has been minimized.

Copy link
Contributor

Webreaper commented Dec 24, 2017

Ah, yes, we'll, given the lack of support for GPhotos, that doesn't surprise me at all. I had all sorts of problems with GPhotos not backing up photos, and so on. In the end I've moved to an entirely Gdrive based workflow.

  1. Turn off Google photos backup
  2. Install this: https://play.google.com/store/apps/details?id=com.ttxapps.drivesync
  3. Configure to sync to a particular folder when any new pics are taken
  4. Use rclone to sync from Gdrive back down to my pc.
    Works a treat, and a billion times more reliable (and faster too) than using Google's backup and autosync.
@lv913

This comment has been minimized.

Copy link

lv913 commented Dec 25, 2017

@Webreaper

This comment has been minimized.

Copy link
Contributor

Webreaper commented Dec 25, 2017

If you upload photos to either GDrive or GPhotos and they're less than 16Mp, then they don't count against your storage tarifff. However, I'm using this as a primary offsite backup, so need photos stored in full ('original', as Google calls it) resolution, so yes, it's not free.

@dzg

This comment has been minimized.

Copy link

dzg commented Dec 25, 2017

@Webreaper -- That sync app looks cool; but in the past I've always had issues with 3rd party syncers, mainly their not running until I launch them manually. Does this reliably upload in the background immediately upon file creation? THanks

@Webreaper

This comment has been minimized.

Copy link
Contributor

Webreaper commented Jun 21, 2018

That's exactly how I did it in my sync utility (mentioned earlier in the thread). Would be like a very simple 1-directory-deep file sync.

@ebridges

This comment has been minimized.

Copy link
Contributor

ebridges commented Jul 2, 2018

@lssong99 I really like the approach you've sketched out. My only suggestion would be to make the formatting of the directory & album names minimally customizable: e.g. yyyy/MM, yyyy-MM-dd, etc.

Also, AFAIK GP does not allow for nested folders, so the albums named Year/Month would not actually be a subfolder. Perhaps that could be glossed over from local -> remote / remote -> local, but should be kept in mind.

@leocrawford

This comment has been minimized.

Copy link

leocrawford commented Jul 2, 2018

For the mapping, you need to do it in a ay that remains distinct otherwise to photos on one side might resolve to the same name on the other side. My python code to do this is available here if needed:

https://github.com/leocrawford/picasawebsync

@prateeksriv

This comment has been minimized.

Copy link

prateeksriv commented Jul 8, 2018

Looks like Google is coming up with a proper API interface:
https://developers.google.com/photos/library/guides/get-started

@philips

This comment has been minimized.

Copy link

philips commented Jul 14, 2018

The Go library is here: http://godoc.org/google.golang.org/api/photoslibrary/v1

You can find a couple of example apps: https://godoc.org/google.golang.org/api/photoslibrary/v1?importers

Probably the best plan is to use the id field as the filename. As mentioned in the previous content (#369 (comment)) you essentially request baseURL with the height and width in the metadata field.

{
  "mediaItems": [
    {
      "id": "super_long_string",
      "productUrl": "https://photos.google.com/lr/photo/super_long_string",
      "baseUrl": "https://lh3.googleusercontent.com/lr/private_unauthenticated_long_string",
      "mimeType": "image/jpeg",
      "mediaMetadata": {
        "creationTime": "2018-07-13T23:17:56Z",
        "width": "3036",
        "height": "4048",
        "photo": {
          "cameraMake": "Google",
          "cameraModel": "Pixel",
          "focalLength": 4.67,
          "apertureFNumber": 2,
          "isoEquivalent": 494
        }
      }
@ebridges

This comment has been minimized.

Copy link
Contributor

ebridges commented Jul 14, 2018

If sync'ing wouldn't you want to use the original filename, rather than create one based on an ID?

@philips

This comment has been minimized.

Copy link

philips commented Jul 14, 2018

I didn't see a way to get to the original filename. Do you @ebridges?

@ebridges

This comment has been minimized.

Copy link
Contributor

ebridges commented Jul 14, 2018

Perhaps I'm misunderstanding! My understanding is that since rclone is a sync library the client would be reading a list of photos as gathered from local disk and then uploading them to GPhotos. As such, the client for the GPhotos storage system would have the original filenames. Please advise if I'm missing your point.

@philips

This comment has been minimized.

Copy link

philips commented Jul 14, 2018

@Webreaper

This comment has been minimized.

Copy link
Contributor

Webreaper commented Jul 14, 2018

@Webreaper

This comment has been minimized.

Copy link
Contributor

Webreaper commented Jul 14, 2018

@philips

This comment has been minimized.

Copy link

philips commented Jul 14, 2018

@Webreaper

This comment has been minimized.

Copy link
Contributor

Webreaper commented Jul 14, 2018

@aslafy-z

This comment has been minimized.

Copy link

aslafy-z commented Jul 16, 2018

I'm sure that Google stores the original filename of the medias. It shows when downloading the file and in the info panel.

2018-07-16-123108_313x67_scrot

I found a feature request asking for including the original filename within the media item object (https://issuetracker.google.com/issues/79656863) that includes a bad workaround. A header is clipped to the baseUrl containing the actual original file name, querying it asking for a 1x1 pixels image could do the trick. It looks like content-disposition:inline;filename="signal-2016-08-09-211213.jpg"

@stickenhoffen

This comment has been minimized.

Copy link

stickenhoffen commented Aug 2, 2018

@vb0

This comment has been minimized.

Copy link

vb0 commented Aug 17, 2018

Can somebody summarize where are we? Is the API usable at least in theory to meet the original request (upload to Google Photos)?

@amatiasq

This comment has been minimized.

Copy link

amatiasq commented Aug 20, 2018

I haven't upload any photos but consumed the API and it worked good enough. I see endpoints to upload new content but I haven't used them.

I'm pretty sure the API is ready for this feature.

@ncw

This comment has been minimized.

Copy link
Owner

ncw commented Aug 20, 2018

I'm pretty sure the API is ready for this feature.

Anyone want to work on it?

@aslafy-z

This comment has been minimized.

Copy link

aslafy-z commented Aug 20, 2018

@di-dc

This comment has been minimized.

Copy link

di-dc commented Aug 28, 2018

@aslafy-z correct, I don't think there's any way to upload via the API as "high quality": https://developers.google.com/photos/library/guides/api-limits-quotas

"All media items uploaded to Google Photos using the API are stored in full resolution at original quality. They count toward the user’s storage.

Note: If your uploads exceed 25MB per user, your application should remind the user that these uploads will count towards storage in their Google Account."

@Webreaper

This comment has been minimized.

Copy link
Contributor

Webreaper commented Aug 28, 2018

@PowerKiKi

This comment has been minimized.

Copy link

PowerKiKi commented Aug 28, 2018

My use-case would be opposite, only upload "for free". Do you know if resizing (via imagemagick) before uploading would still be considered "free storage" by Google ? Are the spec of resolution, compression rate and file size documented anywhere in order to be considered "free storage" ?

I always assumed that only Google authored tools would be able to flag images as "free" when uploading them, and that uploading manually any files, even small one, would always count toward your quota...

@Webreaper

This comment has been minimized.

Copy link
Contributor

Webreaper commented Aug 28, 2018

@stickenhoffen

This comment has been minimized.

Copy link

stickenhoffen commented Sep 7, 2018

Is this something that can be added? I'm not using the free storage, I want to store my photos in the original format. My current use case is actually that I want to sync all of my photos from one Google account to another.

@ammgws

This comment has been minimized.

Copy link

ammgws commented Sep 7, 2018

Have you tried the library share feature? (Although you can only share with a max of one account)

@stickenhoffen

This comment has been minimized.

Copy link

stickenhoffen commented Sep 7, 2018

Thanks @ammgws !

@skennedy

This comment has been minimized.

Copy link

skennedy commented Sep 7, 2018

Anyone want to work on it?

@ncw I'm new to Go and this codebase, but I'd be willing to give it a shot if no one has started already

Really love the app btw

@ncw

This comment has been minimized.

Copy link
Owner

ncw commented Sep 11, 2018

@skennedy if you (or anyone else) would like to give it a go then I'd be delighted!

See the CONTRIBUTING guide and in particular the writing a new backend section :-)

It is likely this would need a custom set of integration tests as this isn't a "general purpose" remote, only being able to store photos.

@calisro

This comment has been minimized.

Copy link

calisro commented Dec 11, 2018

a Go library written for this

https://github.com/nmrshll/google-photos-api-client-go

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment