Google drive gdoc download conversion workaround - lmmx/devnotes GitHub Wiki
Google Drive now downloads .gdoc
extension Docs files as docx. This is pretty useless as the conversion doesn't work very well, and there should really be an option to turn this off - as for the optional conversion of uploaded documents.
Workaround using gdrive command-line interface
- Install gdrive cli
- Requires Go (
sudo apt-get install gccgo-go
) - Save the appropriate binary from the Downloads subsection in
/usr/local/bin/
- Add it to your path in
.bashrc
with e.g.export PATH=$PATH:/usr/local/bin/drive-linux-amd64
for Intel 64-bit architecture - Make it executable with e.g.
sudo chmod +x /usr/local/bin/drive-linux-amd64
- You now have to run
drive-linux-amd64
, which provides a URL. Open it and enter verification code (OAuth2) - Symlink it:
sudo ln -s /usr/local/bin/drive-linux-amd64 /usr/local/bin/drive
drive
should now be a functional terminal command
- Requires Go (
- Assuming unique folder names you can list the contents of a folder with e.g.
fileid=$(drive list -nt "Gene reg & disease" | cut -d ' ' -f 1)
drive list -nq "'$fileid' in parents"
- The
-n
flag suppresses headers (the first space-separated field is file ID, which is passed to the info command) - The
-t
(=--title
) flag finds a file by title (hence must be uniquely named) - The
-q
(=--query
) flag executes afiles.list
API search clause
Result: :-1: can't access (i.e. list) Google Docs files for some reason!