Google Photos API and Python | Getting Started (Part 1)

Поделиться
HTML-код
  • Опубликовано: 27 ноя 2024

Комментарии • 47

  • @darrinhert9296
    @darrinhert9296 4 года назад +1

    Thanks a bunch for these videos @Jie Jenn! They were just what I needed to get me started on my Pi photo display. There were a few typo's/bugs in the source that I had to sort out, but ultimately it made me understand what was going on even more. Now I understand the Google API for photos and even some about Pandas. You rock!

    • @jiejenn
      @jiejenn  4 года назад

      Good luck with your project.

  • @Radi0he4d1
    @Radi0he4d1 2 года назад +1

    Create_Service had saved me a ton of time. Thank you! Just don't forget to set static_discovery=False in build() since Google had changed their API up a bit

    • @jiejenn
      @jiejenn  2 года назад

      Thanks for the reminder.

    • @jesussena
      @jesussena Год назад

      I was almost two days looking for where the error was and you saved me, thank you very much!

  • @fiaztv3206
    @fiaztv3206 3 года назад +1

    Wow. Thank you so much Jie Jenn. Really wonderful introduction and demonstration for the photos api usage in python.
    Much appreciated. You have done a great service to the community with your teaching.
    As mentioned by @miroslav novak in his comment... Need to change the Google.py to include the following extra argument. Otherwise it will not work.
    That is add static_discover=False
    Correction, to work with the new version of google-api-python-client, it was necessary to pass an extra argument to the build function:
    service = build(api_name, api_version, credentials=cred,static_discovery=False)

    • @metehan4177
      @metehan4177 3 года назад

      Thank you so much man, you saved my day!!

  • @sergey_
    @sergey_ Год назад

    Thank you so much for your work!!!
    This is the lesson what I looking for!

  • @hexuan888
    @hexuan888 4 года назад +3

    Hi, when i tried to run "
    init_photo_service.py", I keep getting the error "Traceback (most recent call last):
    File "C:/imgur2-master/google photo ini.py", line 2, in
    from Google import Create_Service
    ModuleNotFoundError: No module named 'Google'"

    • @jiejenn
      @jiejenn  4 года назад +1

      Google.py file is a utility module I wrote. Check the description for the link to access the source code.

    • @hexuan888
      @hexuan888 4 года назад +1

      @@jiejenn got it!! thank you!!

  • @diegomauriciovelez5
    @diegomauriciovelez5 Год назад

    Hello Jie Jenn,
    Thanks for sharing this information about the Google Photos API, question, with this is it possible to manage my users' google photos storage in a Google workspace?

    • @jiejenn
      @jiejenn  Год назад +1

      You mean other users?

    • @diegomauriciovelez5
      @diegomauriciovelez5 Год назад

      @@jiejenn Yes, I am the administrator of a Google Workspace domain and I want to manage the photo information of these users (Create, delete, edit).

  • @noname-vf7yv
    @noname-vf7yv 5 месяцев назад

    hi, thank you for the video.
    just a question, i dont get the 'photos library service crated succesfuly ' notfication. do you know wht it can happen?

    • @jiejenn
      @jiejenn  5 месяцев назад

      It means you have successfully connect to photos API. You can modify the source code based on your workflow.

  • @chupehuweustaad6742
    @chupehuweustaad6742 4 года назад +2

    whenever I try to run the first stage of the code,it throws me these two errors -
    No name 'auth' in module google pylint(no name in module)
    unable to import google.auth.transport.requests pylint(import error)
    I'm having these troubles in google.py file and I'm using visual studio code.

    • @jiejenn
      @jiejenn  4 года назад +1

      Have you installed Google Client library?
      To install Google Client library
      pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib

    • @chupehuweustaad6742
      @chupehuweustaad6742 4 года назад +3

      @@jiejenn Yes I've followed every step that is shown in the video but still these two bugs popping.

    • @run1492
      @run1492 4 года назад +2

      @@chupehuweustaad6742 Hello; I am having the same problem... did you find the fix ?! Thanks !

    • @run1492
      @run1492 4 года назад +1

      @@jiejenn Hello, this happens to me too.. The command is already installed... What can we try ? Thanks !

    • @run1492
      @run1492 4 года назад +1

      @@chupehuweustaad6742 I've found the fix here: you have to install two libraries with "pip install google-auth" and "pip install requests": stackoverflow.com/questions/51006382/no-module-named-requests-when-trying-to-use-google-oauth2-with-docker

  • @MiroslavNovak
    @MiroslavNovak 3 года назад

    Thanks, it worked like a charm

    • @MiroslavNovak
      @MiroslavNovak 3 года назад +1

      Correction, to work with the new version of google-api-python-client, it was necessary to pass an extra argument to the build function:
      service = build(api_name, api_version, credentials=cred,static_discovery=False)

  • @АлексейБояров-г4з
    @АлексейБояров-г4з 4 года назад

    Google Photos API - What project do you want to do based on this?

    • @jiejenn
      @jiejenn  4 года назад +1

      I will be releasing another tutorial soon based on PyQt5 framework and Google Photos API to build a desktop application to ease the photos upload.

    • @АлексейБояров-г4з
      @АлексейБояров-г4з 4 года назад

      @@jiejenn Excellent! It will be interesting!

  • @SalimKhan-is2lh
    @SalimKhan-is2lh Год назад

    Dear Sir i want to search object by google lens in google photo lens library. I have 4000 png images of different things. I want to use google lens camera to take a picture of an object and search in my images library. like object detection in images projects. but in my images the object shape, size and location are different in images. Google lens detects well by taking a picture of something to find the object. but it searches from google and i want that google lens search only in my images library. I can't do that. please if you can help do that, thanks

  • @lufiazaki7739
    @lufiazaki7739 2 года назад

    Hello sir, how do I get all the media share link of Google Photos album?

  • @ТимофейХаритонов-л3е
    @ТимофейХаритонов-л3е 3 года назад +1

    Hi, I have an error
    googleapiclient.errors.UnknownApiNameOrVersion: name: photoslibrary version: v1

    • @CiaranA380
      @CiaranA380 3 года назад

      Hi, I'm also getting this error - not sure if there's been a version update but I can't find any info online

    • @jiejenn
      @jiejenn  3 года назад

      I just tested the script, and it is working fine for me.
      snipboard.io/ENqC8T.jpg
      Makes sure there are no typos in your code.
      CLIENT_SECRET_FILE = ''
      API_NAME = 'photoslibrary'
      API_VERSION = 'v1'
      SCOPES = ['www.googleapis.com/auth/photoslibrary',
      'www.googleapis.com/auth/photoslibrary.sharing']
      service = Create_Service(CLIENT_SECRET_FILE, API_NAME, API_VERSION, SCOPES)

    • @eric400k
      @eric400k 3 года назад

      I also have this same issue along with a few more people. we have the problem on both Windows and Linux. However on 1 Linux machine, it works fine. same exact code on all. no solution yet.

  • @jinghuiniu7335
    @jinghuiniu7335 3 года назад +1

    how to set up consent screen?

  • @markhuang8031
    @markhuang8031 4 года назад

    Hi Jie Jenn where can I find a python code to download all photos from my google photos? Thanks.

    • @jiejenn
      @jiejenn  4 года назад

      I'm working on it, will post the video with script today or tomorrow.

  • @happyman610
    @happyman610 3 года назад

    Thank you for your video.
    When I follow your steps, I obtain this error in "French"
    [WinError 10013] Une tentative d’accès à un socket de manière interdite par ses autorisations d’accès a été tentée

    • @jiejenn
      @jiejenn  3 года назад

      Please reference the solution in the comment.
      github.com/googleworkspace/python-samples/issues/86

  • @krzysztofszeremeta2609
    @krzysztofszeremeta2609 4 года назад

    I need automatically upload videos from DVR camera. Camera after drive sending video to Raspberry Pi. I need upload all video from folder to my Google Photos on select album. How make it?

  • @juanm.pozzomultimedia9473
    @juanm.pozzomultimedia9473 3 года назад

    Anyone know how to resolve this line in php api?:
    $authCredentials = new UserRefreshCredentials( /* Add your scope, client secret and refresh token here */ );

  • @JohnMFritsch
    @JohnMFritsch 3 года назад

    Traceback (most recent call last):
    File "c:\Programming\Python\GooglePhotos\Scripts\init_GooglePhotos_service.py", line 2, in
    from Google import Create_Service
    ModuleNotFoundError: No module named 'Google'
    Code:
    import os
    from Google import Create_Service
    API_NAME = 'MyGooglePhotosApp'
    API_VERSION = 'v1'
    CLIENT_SECRET_FILE = 'Client_Secret_MyGooglePhotosApp.json'
    SCOPES = ['www.googleapis.com/auth/photoslibrary',
    'www.googleapis.com/auth/photoslibrary.sharing']
    service = Create_Service(CLIENT_SECRET_FILE,API_NAME, API_VERSION, SCOPES)
    (GooglePhotos) PS C:\Programming\python\GooglePhotos\scripts> pip show Google
    Name: google
    Version: 3.0.0
    Summary: Python bindings to the Google search engine.
    Home-page: breakingcode.wordpress.com/
    Author: Mario Vilas
    Author-email: mvilas@gmail.com
    License: UNKNOWN
    Location: c:\programming\python\googlephotos\lib\site-packages
    Requires: beautifulsoup4
    Required-by:
    I feel like I'm missing something obvious but I'm not seeing it. Does it matter that the Google package says it's for Google search engine and not referencing Photos?
    Any help would be greatly appreciated.

    • @jiejenn
      @jiejenn  3 года назад

      1. Google.py module (case sensitive) is an utility I wrote to simplify Google API service creation. You can get the source code here learndataanalysis.org/google-py-file-source-code/
      2. API_NAME should be the Google API service name not the app name, so change the API_NAME variable to API_NAME = 'photoslibrary'.
      Once you fix 1 and 2, your script should work fine.