thatseeyou / picasa-resumable-uploader

You can upload video(photo too) to picasa(google photos) from CLI.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Google published new Photos APIs

With the new API, I think you can solve the following problems.

Picasa resumable uploader (DEPRECATED)

I used googlecl and picasawebsync for syncing my photos and videos to Picasa(Google photos).

But they are not working now.

  • googlecl does not support OAuth2.
  • picasawebsync fails to upload video (except photo) file.
    • Should change upload protocol.

I write the code to upload my video to google photos.

Features

  • Support OAuth2
  • Upload video using resumable upload protocol
  • Upload photo
  • List albums and photos
  • Delete albums and photos
  • Modify property of albums and photos
    • Google does not allow to change timestamp.

Prerequisites

  • Ubuntu
$ sudo apt-get install nodejs
$ sudo apt-get install curl
$ sudo apt-get install xsltproc
# if you can not run node
$ sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
  • macOS : curl, xsltproc already installed
$ brew install node

Install

$ git clone 'git@github.com:thatseeyou/picasa-resumable-uploader.git'
$ cd picasa-resulable-uploader
$ npm Install
$ mkdir ~/.credentials
$ cp <downloaded client secret file> ~/.credentials/picasa-resumable-uploader_client_secret.json (refer next section)
# (optional) picasa can run anywhere
$ ln -s $(pwd)/picasa /usr/local/bin

Get client_secret.json

  1. Go to https://console.developers.google.com/start/api?id=drive
  2. Click 'Continue'
  3. Click 'Go to credentials'
  4. Click 'What credentials do I need' after setting the following
    • Where will you be calling the API from? > Other UI
    • What data will you be accessing? > User data
  5. Click 'Create client ID' ('Name' is not important)
  6. Click 'Continue' after setting 'Product Name' like 'picasa uploader'
  7. Click 'Download' and remane downloaded file to client_secret.json

Run

$ ./picasa
NOTICE: The order of options matters.
picasa [-v] list album [--tab | --xml | --raw-xml] [album name]
picasa [-v] create album <album name> [summary] 
picasa [-v] delete album [album name]
picasa [-v] modify album <album name> <property key> <property value>
                         2016-10 title "New Title"
picasa [-v] list photo [--tab | --xml | --raw-xml] <album name> [photo name]
picasa [-v] delete photo <album name> [photo name]
picasa [-v] delete pending
picasa [-v] modify photo <album name> <photo name> <property key> <property value>
                         2016-10 '2016-10-02 111234.mp4' title "New Title"
                         2016-10 '2016-10-02 111234.mp4' summary "New summary"
picasa [-v] upload photo <album name> <file path>

picasa-sync-upload using picasa

Sync directory contents to album.

$ ./picasa-sync-upload 
Usage: picasa-sync-upload <directory>
   ex) picasa-sync-upload videos/2016/2016-10

This can be run anywhere like the following.

$ ln -s <installed directory>/picasa-sync-upload /usr/local/bin
$ picasa-sync-upload

About

You can upload video(photo too) to picasa(google photos) from CLI.

License:Apache License 2.0


Languages

Language:Shell 82.2%Language:TypeScript 17.8%