The only two fields we would need to input would be file_id and your_API_key
Example URL:
Code: Select all
https://www.googleapis.com/drive/v3/files/file_id?key=your_API_key&alt=media
Cubert wrote: ↑Wed Oct 16, 2019 7:10 pm Google Drive is a fickle beast!
We started integrating Drive into Habitat and man what a PITA. Our integration works great for small files. The direct links work just as you expect until you start getting to about 200mb. Once you get past 200mb you start getting Google intermediate pages having you click a button to continue. It also starts to get unstable and drops the connection causing any scripts to fail out.
Our plugin lets you download and upload files from the drive a scan the drive for uploaded files to use. You have to use Google's Drive UI to upload files bigger than 200mb so you can not use the plugin to upload ISO files of 2.5gb as it will kick back a denial. So for ISO files you will need to add them via Google's UI then in plugin update file list to see new additions. Then you can use that data in scripts to download files for use in scripts.
I am working on a cmdline large file downloader that will download 2g +files from Google drive. This can be used in LT scripting to get past the Large File- No Antivirus scan warnings google drive intermediate page that pops up on large files making programmatic scripting a big pain.
Its still got a few quirks but 2 out 3 times we got our 2.7 gb iso file
Capture.PNG
Also if you want to run a temporary solution (time sensitive) you can also do the following.
https://insynout.blogspot.com/2017/01/s ... -from.html
It has you create an access token that you then can use either CURL or POSH to grab the file. This is good if your doing it in a single day. Get the code, plug it in and run the script against agents. 12 hours later the token expires.
OrCode: Select all
curl -H "Authorization: Bearer YYYYY" https://www.googleapis.com/drive/v3/files/XXXXX?alt=media -o ZZZZZ
Code: Select all
Invoke-RestMethod -Uri https://www.googleapis.com/drive/v3/files/XXXXX?alt=media -Method Get -Headers @{"Authorization"="Bearer YYYYY"} | Out-File ZZZZZ
In your command, replace “XXXXX” with the file ID from above, “YYYYY” with the access token from above, and “ZZZZZ” with the file name that will be saved (for example, “myFile.mp4” if you’re downloading a mp4 file).