Skip to content
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

Adding photos to specific (precreated) album #2

Open
zuci42 opened this issue Dec 17, 2017 · 5 comments
Open

Adding photos to specific (precreated) album #2

zuci42 opened this issue Dec 17, 2017 · 5 comments

Comments

@zuci42
Copy link

zuci42 commented Dec 17, 2017

Dears, I wonder how to implement subj.

I am absolutely lost looking for docs for these api url

NewUploadUrl = "https://photos.google.com/_/upload/uploadmedia/rupio/interactive?authuser=2"
EnablePhotoUrl = "https://photos.google.com/_/PhotosUi/mutate"

Especially the last one!
How did you get them? (:

@simonedegiacomi
Copy link
Owner

Hi, unfortunately there aren't any documented API for Google Photos. I found the two urls looking at the requests (using the developer tools) that the browser was making while uploading some images.

I guess that the functionality to add photos to a specific album can be achieved making a further request. The first step would be to upload an image using the official website and then try to move the image to an album, looking at the network tab of the dev tools of the browser to find the needed url

@zuci42
Copy link
Author

zuci42 commented Dec 18, 2017

Many thanks - I will try.
Looking back everything looks so obvious! (:

@simonedegiacomi
Copy link
Owner

I added a parameter for the cli interface and an argument for the UploadOptions object to specify the album id. I tried it with my account and it works, but the code uses some constants and i'm not sure if they are account dependent.
@zuci42 You can try if it works with your account, the commit with the update is this one 9e67860

@zuci42
Copy link
Author

zuci42 commented Dec 28, 2017

Oh, this so cool of you dude! Thank you so much!
I've just discussed yesterday evening google photos/picasa api and this issue.

Not shared album looks like:
https://photos.google.com/album/AF1QipM2jepS5TIW1pIzeOlVjBj29k6IlmCAr_OyNFJf

shared looks like this:
https://photos.google.com/share/AF1QipO6Jo8HoUvoPl2iw0yXikxIClji1XgYgTZTnzOZ1mp88IvOxWy3Mdu8nF5uofA5jA?key=somekey

By now it do not works:

go run main.go --album AF1QipO6Jo8HoUvoPl2iw0yXikxIClji1XgYgTZTnzOZ1mp88IvOxWy3Mdu8nF5uofA5jA --upload some.jpg
# command-line-arguments
./main.go:52: too many arguments in call to utils.NewUploader
	have (auth.Credentials, string, int)
	want (auth.Credentials, int)

Regretfully by now I don't have more time for further troubleshooting.
Will return here later!

@jhult
Copy link

jhult commented Apr 18, 2018

The --album parameter is working well for me.

It looks like the code has the correct constant. Some other constants can be found here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants