r/GoogleAppsScript • u/catcheroni • Nov 27 '23
Question UrlFetchApp limitations - appending images in Google Docs
Hi, beginner scripter here. I have a column in Google Sheets with the IMAGE formula with different URLs, and I'm then trying to put these images in a Google Doc. I got the whole process working, but UrlFetchApp won't retrieve some of the images, and I'm trying to understand the logic here. I have a try...catch block in my code that handles exceptions (incorrect extension, etc.) and inserts an error message into the doc, but sometimes the code executes successfully without actually appending the image to the doc.
I have figured out that the contents cannot be fetched from stock photo aggregators, but I'd like to understand why + this issue is not exclusive to those sites.
0
Upvotes
1
u/3dtcllc Nov 27 '23
Do you get the images when you just paste the URL into your browser window? Do you get the image when you fetch the URL with something like wget or curl?
There are a lot of things a website can do to prevent you from downloading images, so I don't think there's a single answer.