Question

Direct link download from gmail

  • 14 September 2020
  • 3 replies
  • 2579 views

Userlevel 1

I like to download a document which can be retrieved by a direct link.

So I receive a email, which is labeled based on the content.

ZAP1

Trigger is: new email in inbox/label

Action is: download file of directlink to specified directory

 

ZAP2

Trigger is: new file in specified directory

Action is: email file to bookkeeping

 

Is this possible? I saw that attachments can be downloaded but I was un succesful with the direct link.

 

Many thanks,

Sapje007

 


This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

3 replies

Userlevel 6
Badge +7

Doable if you have a Gsuite account.  😀

 

Lets go:


Here is the code snippet 🤙

import requests

id = input.get('id')
link = "https://drive.google.com/uc?id=" + id
r = requests.get(link)
redirected = r.url

output = [{'url': redirected}]

You know how to add the attachment to the folder? If not feel free to chat or write here 🚀.

Have fun 😎

Userlevel 1

Hi @Wemakefuture 

Thanks for your script.

I have no clue how to download the file, since I cannot find a zap that can do it.

The file is not send as an attachment but as a link in a email.

Can you tell what the script above is doing?. 

 

Thanks a lot!

Sapje007

Userlevel 1

Doable if you have a Gsuite account.  😀

 

Lets go:


Here is the code snippet 🤙

import requests

id = input.get('id')
link = "https://drive.google.com/uc?id=" + id
r = requests.get(link)
redirected = r.url

output = [{'url': redirected}]

You know how to add the attachment to the folder? If not feel free to chat or write here 🚀.

Have fun 😎


Wow, it looks great! but can zapier connect to Colab?  Google Colab is free but the G-suite seems not. If Colab also works in this case that will solve my problem.

 

Anyway, thanks for the solution!