A Qt/C++ application and library to access and retrieve data from Google Photos.
Report a bug or request a feature
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/
.
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/"]
}
}
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
).
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
andQVideoItem
).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).
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 aQAlbum
.QPhotoViewer
, a super simple viewer for aQPhotoItem
.QVlcVideoViewer
, a super simple viewer for aQVideoItem
.
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.
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/AmazingFeature
) - Commit your Changes (
git commit -m 'Add some AmazingFeature
) - Push to the Branch (
git push origin feature/AmazingFeature
) - Open a Pull Request
Distributed under the GNU General Public License v3.0. See LICENSE
for more information.