twitter-media-backup

command module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 1, 2020 License: MIT Imports: 1 Imported by: 0

README

twitter-media-backup

Overview

Idea behind this project is to backup all pictures/videos tweets of one Twitter account somewhere else by using exporters. It runs infinitly, waiting for new tweets to backup.

Exporters
Name Description
local Backup media to local dedicated folder
gphotos Backup media to Google Photos' dedicated album

Configuration

Put the following file into your home folder :

.twitter-media-backup.yaml

log_level: info

# You are going to create a Twitter developer account and a application 
# in order to have the following values. 
twitter_application_key: XXXXXXXXXXXXXXXXXX
twitter_application_secret: XXXXXXXXXXXXXXXXXX
twitter_access_token: XXXXXXXXXXXXXXXXXX
twitter_access_token_secret: XXXXXXXXXXXXXXXXXX
# Poll new tweets interval
# Beware of quota/limit if you want to decrease this value
twitter_poll_interval: 5s
# Backup media from a specific Tweet ID
# Every tweet before it will be ignored.
# -1      : Backup everything after last current tweet
# 0       : Backup everything
# XXXXXXX : Backup everything after Tweet XXXXXXX
twitter_since_tweet_id: -1

# Local exporter configuration, straightforward.
local: true # Enable exporter
local_root_path: /tmp/twitter-media-backup/local

# Google Photos exporter configuration
# Google APIs use oauth2 under the hood
# As for Twitter, you will have to create a Google application
# Google Photos API also needs to be enabled for your application
gphotos: true # Enable exporter
# This define parameters for oauth2 Authorization Code flow
# Program is going to ask you to visit url at startup, 
# once done your token will be saved as json 
# in order to prevent this behaviors the next time.
gphotos_oauth2_token_path: /tmp/twitter-media-backup/gphotos/token.json
gphotos_oauth2_redirect_url: http://localhost:8080/callback
gphotos_oauth2_port: 8080
gphotos_oauth2_application_key: XXXXXXXXXXXXXXXXXX
gphotos_oauth2_application_secret: XXXXXXXXXXXXXXXXXX
# Google Photos album name destination, will be created if not exists.
gphotos_album: MyAwesomeAlbum

Why ?

I first started this project because I wanted to backup my Nintendo Switch pictures/videos without having to remove the SD card. Nintendo Switch supports sharing only to Twitter and/or Facebook, I choose Twitter as a proxy.

Q&A :

It never stops ?!

This is the requested behaviors, let this program running somewhere and forget it, all your tweets' media will be backup as soon as new tweet are posted.

Why not use Twitter Streaming API ?

Since it needs to supports Protected Account, we can't use Streaming API because they exlude all protected tweets in stream for obvious reason.

Documentation

Overview

Copyright © 2020 maxcleme <maximeclement93+git@gmail.com>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL