ユーザ用ツール

サイト用ツール


サイドバー

最新の10件
一覧
linux:photo:gpup

gpup

Go製のGoogle Photoアップロードツール. GoogleCLのGoogle Photo部分だけみたいな.

導入例

初回起動時には要認証

$ go get github.com/int128/gpup
$ gpup
2019/04/13 21:29:15 Skip reading ~/.gpupconfig: Could not open ~/.gpupconfig: open /home/matoken/.gpupconfig: no such file or directo
ry
2019/04/13 21:29:15 Setup your API access by the following steps:

1. Open https://console.cloud.google.com/apis/library/photoslibrary.googleapis.com/
1. Enable Photos Library API.
1. Open https://console.cloud.google.com/apis/credentials
1. Create an OAuth client ID where the application type is other.

Enter your OAuth client ID (e.g. xxx.apps.googleusercontent.com): 99999999999999-abcdefghijklmnopqrstuvwxyz012345.apps.googleuserconte
nt.com
Enter your OAuth client secret: AbCdEf1234-AbCdEfGhiJkLm
2019/04/13 21:35:55 Saved credentials to ~/.gpupconfig
2019/04/13 21:35:55 Error: Nothing to upload

GooglePhotoへの自動アップロード

$ crontab -l | grep -i gpup
#*/30 * * * *  D=`date +\%m\%d\%H\%M.\%S` ; find ~/Pictures ~/Downloads ~/.local/share/Steam/userdata/125652532/760/remote -executable Bittorrent -newer ${HOME}/Pictures/.gphoto_time \( -iname "*.jpg" -o -iname "*.png" -o -iname "*.webm" -o -iname "*.mp4" \) -type f -print0 | xargs -0 -r -n1 ~/go/bin/gpup -a 'Auto Upload' && touch -t ${D} ${HOME}/Pictures/.gphoto_time

仕様変更によりコメントアウトして自動アップロードを無効にした.

error

Nothing to upload in $FILENAME

$ gpup ./H-IIBF8_HTV8.TIFF 
2019/10/20 06:14:59 Error: Nothing to upload in ./H-IIBF8_HTV8.TIFF

simbolic link を指定したせいのようでオリジナルファイルを指定したら通った

Token of ~/.gpupconfig has been expired, refreshing

2021/05/11 01:03:19 Token of ~/.gpupconfig has been expired, refreshing
2021/05/11 01:03:20 Error: Could not refresh the token: oauth2: cannot fetch token: 400 Bad Request
Response: {
  "error": "invalid_grant",
  "error_description": "Bad Request"
}

~/.gpupconfig を削除して再認証

コメント

コメントを入力. Wiki文法が有効です:
   ___   ____    __  ___   __ __   __ 
  / _ \ / __ \  /  |/  /  / //_/  / / 
 / ___// /_/ / / /|_/ /  / ,<    / /__
/_/    \___\_\/_/  /_/  /_/|_|  /____/
 
linux/photo/gpup.txt · 最終更新: 2021/05/30 22:43 by matoken