Add-on for nanogallery2 to access Google Photos content.
Since february 9, 2017, Google Photos can no more be accessed without account owner's explicit authorization. Permanent authorization is only possible for server side applications.
nanogp is a PHP application which delivers Google Photos content to nanogallery2.
Picasa API Deprecation
- To activate the extension period, between January 2019 and March 2019, please install nanogp V1.3.1
- After March 2019, upgrade to nanogp2
- More: https://developers.google.com/picasa-web/docs/3.0/deprecation
- --> WARNING: please use NANOGP only with a Google Photos account which does not contain any personal or privat data. - All your photos albums can be accessed by NANOGP. This may be misused by malicious people. - - --> ### SO, USE A DEDICATED GOOGLE PHOTOS ACCOUNT. ### - - configure the option `$albums_filter` to protect your privacy!
THIS SCRIPT IS PUBLISHED AS IS. GOOGLE CONTINUOUSLY CHANGES HIS CONFIGURATION INTERFACE, AND IT'S IMPOSSIBLE TO REFLECT ALL CHANGES ON THIS PAGE.
Web server with PHP version > 5.2
Cannot be run on
localhost (workaround, use
- Create a folder named
nanogpon your web server.
- Copy the content of the
distfolder in this folder.
Copy the content of the
dist folder to your server, but never overwrite the
If you overwrite it, you'll need to set the configuration again.
Settings are defined in
$cfg_client_id = 'yyy'; $cfg_client_secret = 'zzz'; $albums_filter = ['sauvegarde', 'backup'];
$cfg_client_secret can be obtained from the Google developers console.
$albums_filter is used to filter albums out. Albums with a title containing one of the string will not be displayed.
Enable Google API - Google developers console
Create and configure a new projet.
Open page: https://console.developers.google.com
Create a new project named
nanogallery2gp-YOUR-INSTANCE-NAME(the project name should be unique, so replace YOUR-INSTANCE-NAME with the name of your own instance)
- Create a consent screen
Select your email address
Define the "product nameshown to user": "nanogallery2gp-YOUR-INSTANCE-NAME"
Others fields are optional
OAuth Client ID
Application type: "Web application"
Define the authorized redirect URLs: enter the full path to your
And you get your personal and confidential
Client ID and
Once the settings are defined, you need to grant authorization to your Google Photos account.
Use a browser to open the
(if you want to grant authorization again, follow steps from the section
Manually revoke authorization).
admin folder should only be accessible to your PHP applications.
For example, with
deny from all set in
Manually revoke authorization
- delete the folder corresponding to the user in
- delete application's authorization: https://myaccount.google.com/permissions
More about OAuth2: https://developers.google.com/identity/protocols/OAuth2WebServer