I'm trying to create a snippet to modify the Google Drive Share link so it forces the file to be downloaded, rather than viewed in Google Drive web interface.
Guidance on method here: How to Get Direct Download URLs from Google Drive
My lack of knowledge is preventing me from troubleshooting my AI assisted attempt at a snippet - I'm guessing my issue is not understanding how to refer to use variables within a snippet.
Any help much appreciated!
{formtext: name=GDriveLink}
{fileId}={regexmatch:{GDriveLink},/d/([a-zA-Z0-9-_]+)/,1}}}
{if: {isempty:{fileId}}}
Invalid Google Drive share link. Please ensure you paste a valid link.
{else}
https://drive.google.com/uc?export=download&id={fileId}
{endif}