RubyでGoogle Driveの共有ドライブからダウンロード
ファイルIDは、ファイルの共有リンクを取得した時の
https://drive.google.com/file/d/XXXXXX/view?usp=sharing
のXXXXXXの部分。
code:rb
file_id = "XXXXXX"
file = drive_service.get_file(file_id)
pp file
これだとうまくいかない。fileがnilになってしまう。
code:rb
file_id = "XXXXXX"
file = drive_service.get_file(file_id, supports_all_drives: true, supports_team_drives: true)
pp file
supports_team_drivesをtrueにするのがポイント。