0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

現在でも新しくgdriveをlinuxで動かす方法【2023/12/16成功】

Last updated at Posted at 2023-12-16

Tl;DR(12/19追記)

を使ってください。指示に従えばちゃんと動きました。
以上。

旧 TL;DR

https://github.com/BugCode1/gdrive/releases/tag/2.1.2 から対応するバージョンのURLをコピー

自分のバージョンはuname -mとかで見られます

・URLを自分にあったバージョンに書き換えて、ターミナルで以下を順番に実行
(以下はLinux x86_64での例)

bash
wget https://github.com/BugCode1/gdrive/releases/download/2.1.2/gdrive_2.1.2_linux_amd64.tar.gz
bash
tar xvf gdrive_2.1.2_linux_amd64.tar.gz
bash
mv gdrive /usr/local/bin/

また、Replitなどのsudo権限がない環境では、3つめは実行せず、パスを指定して実行するか、自分でパスを通しているところにおいてあげてください。

例:同じディレクトリにgdriveのバイナリがある場合

bash
./gdrive list

実行出来たら、出力されたリンクに任意のブラウザでアクセスし、ログインしたいアカウントを選択してください。
そうすると、
http://localhost:1/?state=state&code=******&scope=https://www.googleapis.com/auth/drive
みたいなURLに飛ばされるので、******の部分をターミナルに打てば完了です。

きっかけ

gdriveという、LinuxからGoogleDriveを操作できる便利なライブラリがあります。
しかし、この更新がかなり止まっており、現在ではError 400: というエラーになってしまいます。

そこでissueを読み漁っていたところ、上記の解決方法を発見しました。

gdriveの使い方はたくさんあるのでここでは割愛します。

お役に立てば幸いです。

参考(翻訳元):
https://github.com/prasmussen/gdrive/issues/663#issuecomment-1357293108

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?