Request: Google Drive API Support For ISO Hosting

Support and question forum for Patch Remedy 4 WUA plugin for LabTech. This plugin was retired on 06/01/2022. All new Patch Remedy 5 is now the current plugin. This forum is for retaining the old posts for Patch Remedy 4.
BlooTech
Posts: 27
Joined: Tue Dec 12, 2017 5:05 pm
6

Re: Request: Google Drive API Support For ISO Hosting

Post by BlooTech »

Sounds like you're spinning your wheels when its not necessary because it doesn't appear you're using the API link. I mentioned it in previous post with a link to explain in more detail. You're just using the standard share link. You must use the Google Drive API method in order to download large files directly. You're getting the WebException because its prompting a message stating it cant scan files that are over X MB. If you use the Google Drive API method with the correct link then it will bypass that message and download the file directly. Please refer to this link - bit.ly/2Ympjic

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.

Code: Select all

curl -H "Authorization: Bearer YYYYY" https://www.googleapis.com/drive/v3/files/XXXXX?alt=media -o ZZZZZ
Or

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).

User avatar
Cubert
Posts: 2430
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Request: Google Drive API Support For ISO Hosting

Post by Cubert »

We did see that in the docs but we were working with OAuth2 IDs and not API keys. We had some concerns with passing what could be a very loose privilege around when using API key. We have been working on this integration for a while and now have included both OAuth2 and API Key features to the plugin. You will be able to select a more secure URL for your downloads via OAuth or if you choose to pass an API key that is also now available from scripting and plugin.

Examples will be given in the Habitat Forums..

Post Reply

Return to “Patch Remedy for LabTech (Patch Remedy 4) Retired”