Skip to content

Instantly share code, notes, and snippets.

@nazo
Created May 21, 2020 12:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nazo/d095cacbabc79243dd13d0f9622e5d49 to your computer and use it in GitHub Desktop.
Save nazo/d095cacbabc79243dd13d0f9622e5d49 to your computer and use it in GitHub Desktop.
elixir-google-api でファイルダウンロードする

https://github.com/googleapis/elixir-google-api で、通常JSONで降ってくるデータに対して alt を変更すると形式が変わるもの、例えば alt=media でファイルダウンロードになるようなものは、 API の引数 opts に [decode: false] を付けると生データが降ってきます

GoogleApi.Drive.V3.Connection.new(token)
|> GoogleApi.Drive.V3.Api.Files.drive_files_get("yourfileid", [alt: "media"], [decode: false])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment