Hi, there are several scripts that should work for you, try this one first, as quoted from scripts forum.
Always check the url however as various links at times require tweaking, I use sharepoint and onedrive often need modifying the end to actually download not just the web link, google much the same but I do not use very often.
eg
https://drive.google.com/file/d/xxxxx/view?usp=sharing
may need to be
https://drive.google.com/uc?export=download&id=xxxxxx
sharepont
https://xxxxmysite.sharepoint.com/:u:/s/xxxxSharedxxxx/xxxxxxxxxxmYHJHGA?e=9 gGpc0&download=1