Giter Club home page Giter Club logo

Comments (8)

pacoorozco avatar pacoorozco commented on May 27, 2024

Hi,

Your code is using the OAtuh 2.0 to get the permissions to use Google Photos API. The gphotos-uploader-cli does exactly the same, so maybe you can use the client-id and the client-secret from above to configure the gphotos-uploader-cli. This is true if you have created a project were the CLI is able to use the Google Photos API.

My best suggestion is to follow the Getting started documentation.

Let me know if there's a problem when using these credentials.

from gphotos-uploader-cli.

mikebilly avatar mikebilly commented on May 27, 2024

I can use the above code: get_authenticated_service(client_secret_file) to create the credentials json file from a client secret json file. But how to make gphotos-uploader-cli get the token from that created credentials json file, i.e /content/drive/MyDrive/gphotos-uploader/credentials/1/credentials_for_1.json, instead of asking the user to go to a local host link which doesn't work on Google Colab.

from gphotos-uploader-cli.

pacoorozco avatar pacoorozco commented on May 27, 2024

Currently, gphotos-uploader-cli doesn't offer a way to use external credentials (like the one you're using).

I can't imagine how to re-use the credentials of another program to authenticate gphotos-uploader-cli.

from gphotos-uploader-cli.

mikebilly avatar mikebilly commented on May 27, 2024

Not of another problem, that function is specifically used to get the token for gphotos-uploader-cli, because I want to try to make it get the token without going to localhost link. Got the credentials, now just need gphotos-uploader-cli to get the token from it.

from gphotos-uploader-cli.

mikebilly avatar mikebilly commented on May 27, 2024

@pacoorozco could you help me with this?, could you please try gphotos-uploader-cli on Google Colab, I'm sure there's a demand to upload medias from Google Drive to Google Photos through Google Colab.

from gphotos-uploader-cli.

pacoorozco avatar pacoorozco commented on May 27, 2024

Hi @mikebilly

AFAIK Google Colab is a python environment to set up Notebooks and run python scripts. I've never used it, so I don't know how it should work in order to run a go CLI, like gphotos-uploader-cli.

If you were able to mount the Google Drive to a folder, then you can use gphotos-uploader-cli to upload the content of the folder.

from gphotos-uploader-cli.

mikebilly avatar mikebilly commented on May 27, 2024

@pacoorozco it's a headless environment, which means doing authentication is very challenging as it can't access localhost. Still looking for a way to make gphotos-uploader-cli use the pre-created credentials to retrieve the token or find other ways to get the token without needing localhost.

from gphotos-uploader-cli.

pacoorozco avatar pacoorozco commented on May 27, 2024

I understand the complexity of running this script in a headless environment. In fact, this script was never thought to be run in a headless setup, because the authentication is not easy to be implemented.

In Google Colab they are taking advantage of the fact that their service is in the Google scope 😅

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.