mvysny / photocloud-frame-slideshow

Android Digital Photo Frame
https://www.android-photo-frame.eu
15 stars 1 forks source link

Add support for Google Photos #52

Closed theQuicker1 closed 6 years ago

theQuicker1 commented 6 years ago

Google Photos being one of the most popular personal photo repositories these days would be the perfect integration for an app like this. Probably the best thing to do would be to add/access individual albums, rather than all the pictures in Google Photos. I don't know how any of that works though.

Right now I am sharing photos from Google Photos to Google Drive. Being able to remove this step (and the extra Google Drive app on my phone) would be great!

mvysny commented 6 years ago

Thanks for letting me know! The Google Data API client library is exceptionally crappy, so I'll check whether this is actually feasible.

mvysny commented 6 years ago

GData is pure crap: https://developers.google.com/gdata/articles/java_client_lib

  1. It uses Ant, it's not Gradle
  2. Servlet? Why the hell would it require servlets???\

I'm sorry but I don't have the will power, time and most importantly, any desire to crawl through this Google vomit. It's like reading 1000+ pages of crap manual, with no assurement that I will eventually reach something usable.

mvysny commented 6 years ago

More crap from Google. Googling com.google.apis returns this crap:

  1. https://developers.google.com/android/guides/setup - it's just client for Google Play, no Photos support, useless.
  2. https://github.com/google/google-api-java-client - some more Google crap, no Photos, useless.
  3. https://developers.google.com/api-client-library/java/ - tons of Google crap, old API, totally not clear how that crap needs to be used, useless.
  4. https://github.com/googleapis - lots of random crap, useless.
  5. https://developers.google.com/picasa-web/ - old Eclipse crap using gdata api
mvysny commented 6 years ago

Finally something that looks at least slightly usable: https://developers.google.com/picasa-web/docs/3.0/developers_guide_protocol Too bad it depends on Google Data Protocol (whatever that is) which is deprecated. Also, no sample app available, no clear instructions how to add necessary libraries to Gradle.

Pure crap and waste of time. Most hilarious: The page says that Sample Code is available here: https://developers.google.com/picasa-web/code . Please feel free to find that Sample Code, I dare you.

Useless.

mvysny commented 6 years ago

The only usable page is this: https://developers.google.com/android/guides/setup which also apparently includes some usable library for Drive which I should use (as opposed to com.google.apis:google-api-services-drive which I dug out God-knows-where), but that shit works and I'm not touching that shit crap with a twenty feet stick.

theQuicker1 commented 6 years ago

I don't blame you. I'd be worried to mess with Google Drive too since it's working great. Thanks for looking into Google Photos and trying to make it work! I am sad it's not going to happen until Google gets its act together. I truly appreciate the effort and will keep recommending this app!

mvysny commented 6 years ago

I apologise for the rough tone. I'll try to look into this again when I'll have more time. Maybe I will be able to find the way to make this work. Just not now - I just want to have peaceful Christmas, unspoiled by digging into that horrible mess which is Photos API :-)

It's just that I really hate that complexity typically caused by someone's else's sloppiness (Google's in this case) forces me to waste my energy by having to crawl through that API crap.

theQuicker1 commented 6 years ago

Feel free to ignore this; I have no idea if this is helpful or not: https://productforums.google.com/d/msg/photos/gSA0NL2cYos/LitqTRy4BQAJ

mvysny commented 6 years ago

Thanks, that's actually quite helpful! It is using the "old and deprecated" (according to the Google guys) but apparently still very lively GData API, which apparently works. I will try to hook into this old API then.

I also found this page: https://developers.google.com/gdata/docs/directory Quoting:

GData version is still live. No replacement API.

That confirms that I should invest the time and look into that GData thing. Thanks!

mvysny commented 6 years ago

An example of how incredibly idiotic Google APIs are: #55 - it is the official way of using Google Drive, which does not support listing of all files in your Drive.

I will try to hook into the old GData API.

mvysny commented 6 years ago

Tried GData; doesn't work for me and rejects my username/password. Could you please try? It is actually quite easy to run the client:

  1. Install Java
  2. Download GData samples from here: https://github.com/google/gdata-java-client (scroll to the bottom, there's link Samples)
  3. Unpack the zip.
  4. Put the following script into the gdata/java/sample/photos/lib folder and name it run:
    #!/bin/bash
    set -e -o pipefail
    export GDATA_LIBS="`ls ../../../lib | awk '{ print "../../../lib/"$1 }' | tr '\n' ':'`"
    export GDATA_DEPS="`ls ../../../deps | awk '{ print "../../../deps/"$1 }' | tr '\n' ':'`"
    export CP="PhotosClient.jar:$GDATA_LIBS:$GDATA_DEPS"
    echo $CP
    java -cp $CP sample.photos.PicasawebCommandLine
  5. Download the mail-1.5.0-b01.jar from http://repo1.maven.org/maven2/javax/mail/mail/1.5.0-b01/ and put it into gdata/java/deps folder
  6. Run the script: ./run
  7. It should ask for the username and password. Regardless of what I inputted, it doesn't work for me and fails with:
    Exception in thread "main" java.lang.IllegalArgumentException: Illegal username/password combination.
    at sample.photos.PicasawebClient.<init>(PicasawebClient.java:69)
    at sample.photos.PicasawebCommandLine.<init>(PicasawebCommandLine.java:55)
    at sample.photos.PicasawebCommandLine.main(PicasawebCommandLine.java:79)
mvysny commented 6 years ago

Aha, https://github.com/google/gdata-java-client/issues/451:

setUserCredentials() uses ClientLogin, which has been deprecated since April 2012 and recently disabled. You will need to use OAuth instead.

Brilliant! There is an example using OAuth1 in GData which is deprecated and doesn't work. The example app says:

Please enter your OAuth consumer key (usually your domain, visit https://www.google.com/accounts/ManageDomains to manage your OAuth parameters)

Visiting that URL redirects to https://support.google.com/a/answer/162106 which says that OAuth1 is deprecated and offers some guide, however it is not clear how to actually access the "Location: Security > Advanced settings > Authentication > Manage API client access"!

Even more hilarious: clicking on the https://admin.google.com/ G SUITE ADMINISTRATOR will just enter an infinite loop of "To verify it's you, please enter the password"!! Simply brilliant.

This is by FAR the most retarded, idiotic, disgusting experience I have ever encountered, and it comes from Google, the technology innovator. Brilliant!

I lost all interest pursuing this Google crap, I declare GData a dead end.

By accident I have clicked on https://developers.google.com/identity/protocols/googlescopes and I found out something interesting: it may be possible to access Google Photos via the Google Drive API, by using the https://www.googleapis.com/auth/drive.photos.readonly Scope.

Google, thank you for promoting "programming by Cursing and Accident". Retarded pack of monkeys.

mvysny commented 6 years ago

Nope, Google Drive just ignores the drive.photos.readonly scope and always browses the whole Drive. I believe I've exhausted all possible ways of access Google Photos; I am exhausted myself by looking at this crap and I declare this task impossible.

mvysny commented 6 years ago

Could it be? An actual example to access that pile of crap: https://github.com/tedyk/google-photos-android

mvysny commented 6 years ago

To my surprise the app does work, but it returns 0 photos unless you link your Google Photos to your Google Drive. However, then the photos will also show up in your Google Drive and in fact you can use the Google Drive stream to see your photos!

Marking this issue as won't fix, but there is a workaround:

  1. Simply follow https://support.google.com/drive/answer/6156103 : First, turn on Google Drive integration at https://photos.google.com/settings ; then open your Google Drive, Settings, Create a Google Photos folder, Done.

Please check out http://www.android-photo-frame.eu/faq.html for more details.

theQuicker1 commented 6 years ago

image

It appears that Drive no longer supports a full fledged Drive-sharing feature (at least in the United States). I can use Google Photos to view the pictures I have in Drive, but I can not add pictures to Google Photos and have them show in Drive. Since the frame is pulling from Drive, the end-goal of using the Google Photos app for uploading pictures from a phone is still not feasible.

So far, using the Google Drive app on my phone has been working well though.

mvysny commented 6 years ago

I am seeing this error message in my Google Drive too. The error message is in fact a bit misleading. You still can see Photos in your Drive, it will just be attached in a different location: as a folder named Google Photos in the My Drive folder:

screenshot from 2018-03-21 20-53-10

Just follow the steps as described above.

mvysny commented 4 years ago

Hoorray! Since 1.13.13 the Google Photos are natively supported by PhotoCloud - there is no need to go through the Google Drive. I'll update the documentation.