A python script to Directly Transfer photos from Google drive -> Google photos Using Openshift
*(
*(((
*(((((
*(((((((
*********/(((((((((
,,,,*******/(((((((%%
,,,,,,,,*****/(((((%%%%
,,,,,,,,,,,,*** (((%%%%%%
,,,,,,,,,,,,,,,, %%%%%%%%
(((((((( ((((((((((((((((
((((((/** ###((((((((((((
((((/****/#####((((((((
((/******/#######((((
/********/########(
*******.
*****.
***.
Google Drive - Using the Drive API
Google Photos - Doesn't provide an API till date and this method is based on reverse-engineering the Google Photos Web Upload.
Hence for this to work ,the cookie of your drive account is needed and few details mentioned in INPUTS.json file.
- cookie - Cookie of google photos account to which you wish to transfer photos
- clientInfo - Supplied by the google photo web upload to the google server
- effective_id - Denotes owner of the file on drive - owner_id
This script will Download all images from Google Drive and uploads to Google Photos
Note :
This script can be hosted on Heroku or Openshift (Paas) which would be much faster
if you have large number of photos or a crappy Internet Connection
- Google Drive API - Enabled for your account
- Turn on the Drive API : Follow the step one of Google Python Quickstart
- Python 2.7 or later - This is based on 2.7
- Git on windows/linux.
python setup.py install
Getting the Required info for the first time.
Make Sure you got the DRIVE API Enabled and Downloaded the client_secret.json file to the git repository.
- Open you Firefox browser and go to page photos.google.com and sign-in to your account
- Open the Firefox Dev Tools [Right click - Select ->Inspect Elements (or) Press "Q" from Keyboard]
- Go to the Network tab of Dev Tools
- Upload a sample image by dragging it over the browser window.
- In Network tab watch for a POST request "resumable?authuser=0"
- Follow the Screenshot images
Save changes and update the repository
Finally run the following in (cmd/terminal):
python app.py
- Obtain the Google Drive OAuth Credentials which will be saved in .credentials folder
- Upload the updated repository to Openshift for Direct Online transfer
- Create a Free account
- Getting Started with OpenShift Online
- Create a New Python App in the web console and during creation provide your git repository url
or later Upload the git repository using
rhc command line tool
- In the rhc command-line tool type the command
to view logs
rhc tail -a YOUR_APP_NAME
Jagadeesan : [email protected]
Make a Pull request / file an issue.
The MIT License (MIT) Copyright (c) 2016 Jagadeesan