Giter Club home page Giter Club logo

pi-upload-google-drive's Introduction

pi-upload-google-drive

Raspberry Pi upload to Google Drive

I created the project because I wanted to view the images created with the Raspberry Pi Camera everywhere where I am without having to deal with the security issues using port forwarding and my own webserver.

The images created are in the subfolder timelapse/year/month/day.

Requirements

See Google Drive API Quickstart for instructions on how to get the secrets file. I am using a service account key because this script runs unattended as a cronjob.

  • Python 3 sudo apt-get install python3
  • Pip sudo apt-get install python3-pip
  • pip3 install --upgrade google-api-python-client

Configuration

Configuration file is image-upload.config.

Add your application name and secret file.

client_secret_file = secretfile.json

application_name = my-application-name

Who do you want to share the files with, should be at least your email.

share_with = [email protected],[email protected]

Change search_directory if you want to search for images in another folder.

search_directory = /home/pi/images/

How often do you want to check for new images in seconds.

interval = 30

Upload the n newest images.

n_latest_images = 5

The script uses the configuration to remember if the current year folder is already shared, in order to avoid the additional call, and the last image uploaded. Exception is, if you deleted your shared folder and want to share it again you have to delete the folder in the configuration file.

Run

python3 image-upload.py

Log

image-upload.log

TODO

  • Synchronize complete folder

Further reading

Other Google Drive related projects

https://github.com/googledrive/PyDrive/tree/master/pydrive https://github.com/supersaiyanmode/gapi/blob/master/GApi4Term/core/drive.py

SDK

https://developers.google.com/drive/v3/web/about-sdk https://developers.google.com/drive/v3/reference

API Dashboard

https://console.developers.google.com/apis/dashboard

pi-upload-google-drive's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.