Skip to content

A Qt/C++ application and library to access and retrieve data from Google Photos.

License

Notifications You must be signed in to change notification settings

torresflo/QGooglePhotos

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub license PRs Welcome GitHub contributors GitHub issues

QGooglePhotos

A Qt/C++ application and library to access and retrieve data from Google Photos.
Report a bug or request a feature

Table of Contents

Getting Started

Prerequisites

The project is compiled with Qt 5.11.2. The Qt add-on Qt Network Authorization must be installed to build the project. You also need to provide the library VLC-Qt to build the project. It is only necessary for the video viewer widget though, you can run the Google Photos library without it if you want.

You need to register a new project in the Google Developpers Console as no one is provided. This step is necessary because you have to request the client credentials to identify your application.

You can follow this tutorial. Note: With Qt, the redirect URI must now be http://localhost:8080/.

Installation

Follow the instructions above then clone the repo (git clone https:://github.com/torresflo/QGooglePhotos.git) and build the project.

To run, the project is expecting the file clientid.json that contains the credentials of your Google Application at the root of the execuable of the project. Note: With Qt Creator, it should be placed in the build directory.

The file sould be similar to this one:

{
    "web":
    {
        "client_id":"YOU_CLIENT_ID_HERE",
        "project_id":"YOUR_APPLICATION_NAME_HERE",
        "auth_uri":"https://accounts.google.com/o/oauth2/auth",
        "token_uri":"https://oauth2.googleapis.com/token",
        "client_secret":"YOUR_CLIENT_SECRET_HERE",
        "redirect_uris":["http://localhost:8080/"]
    }
}

Usage

The project is divided in several parts, a library (folder GooglePhotos), a series of widgets to display the library (folder Widgets) and a simple application used to test everything (folder Application).

When starting the main application, in the main menu, go to Settings > Connection.... It will open your browser and ask you the authorization to access your Google Photos Library. Note: the request will be done with your credentials (placed in the file clientid.json).

Library

The library uses the Google Photos RESTful API.

The main classes of the library are:

  • LibrarySettings that represents the credentials.
  • QLibraryClient that represents the Google Photos library. It is used for the connection and to retrieve the albums.
  • QAlbum that represents an album in Google Photos. It is used to retrieve the media items (QPhotoItem and QVideoItem).
  • QPhotoItem that represents a photo.
  • QVideoItem that represents a video (you can access the video bytes directly through the video data URL available in the class).

Widgets

Various simple widgets are available to display the library:

  • QAlbumsWidget to display a list of albums in the library. It is currently the first widget instantiated in the main application.
  • QMediaItemListWidget to display the list of media items available in a QAlbum.
  • QPhotoViewer, a super simple viewer for a QPhotoItem.
  • QVlcVideoViewer, a super simple viewer for a QVideoItem.

Contributing

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature)
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the GNU General Public License v3.0. See LICENSE for more information.

About

A Qt/C++ application and library to access and retrieve data from Google Photos.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published