I\'m trying to create a script to convert a regular google drive share URL to a direct download URL. The raw URL looks like this:
https://drive.google.com/file/d
You don't need regex for that you can complete the url transformation with 2 chained string replace. See for example this (in Java) :
String url="https://drive.google.com/file/d/FILE_ID/edit?usp=sharing";
url = url.replace("/file/d/", "/uc?export=download&id=").replace("/edit?usp=sharing", "");
System.out.print(url);
==> The output:
https://drive.google.com/uc?export=download&id=FILE_ID