How To Download Files From Google Sheet URL

How To Download Files From Google Sheet URL

We made a simple tutorial to easily take a list of URLs on a spreadsheet (in this case on Google Sheets) and download them on your Mac or Windows in bulk.

See steps below:


Don't Feel Like Reading? We Made a Video Explaining the Full Details of the Topic. Click Here to Scroll Down to The Video

Create Google Sheet (spreadsheet) with 3 columns:

  1. Column A - URL (copy all your urls to this column)
  2. Column B - Filename (used to extract filename)
  3. Column C - Download (used to write the command to download the file)

See our template here


Fill out Column B - Filename

  • Use the formula =INDEX(SPLIT(INDEX(SPLIT(A3, "/"), 0, COUNTA(SPLIT(A3, "/"))), "?"), 0, 1)
  • Make sure to replace A3 in both places to correspond with your first URL cell.
  • Drag downwards to fill out the filename for the rest of the rows.

Fill out Column C - Download

  • On MacOS: ="curl '"&A3&"' -o "&B3
  • On Windows: ="curl "&B3&" -o "&A3
  • Drag downwards to fill out the filename for the rest of the rows.

Create Script File and Run It

A. On MacOS:

  • Make a directory in the place you want to save files.
  • Open "Terminal" & Create a new .sh file and edit it: vi file.sh
  • Inside the file, add to the first row:
    • #!/usr/bin/env bash
  • Copy all of the Column C content into the .sh file.
  • Save the file: :wq!
  • Change permissions for the file to write: chmod +x file.sh
  • Run the file: ./file.sh
  • Wait for the download to complete and enjoy your files!

B. On Windows:

  • Make a directory in the place you want to save files.
  • Create a new .bat file via Notepad (or command line): file.bat
  • Inside the file, paste all of the Column C content.
  • Save the file.
  • Double-click on file.bat in the folder to run it.
  • Wait for the download to complete and enjoy your files!

URL to template

Google Sheet Template


Extra Tip: Google Drive Sheet and Video Downloads

for google drive sheets, docs and videos its a bit more complicated.

  • make sure that files are publicly shared
  • you will need to add the /export at the end of the url of the file for example - https://docs.google.com/spreadsheets/d/xxxxxxxx/ should be https://docs.google.com/spreadsheets/d/xxxxxxxx/export
  • you will have to know the type of file (for example .xlsx) so final curl command should be something like this: curl -L -o "filename.xlsx" "https://docs.google.com/spreadsheets/d/xxxxxxxxxxxx/export

Video Explainer on The Full Topic

Leave a comment

Please note, comments need to be approved before they are published.

Tags

Thank You For Reading Our Articles!

We're committed to delivering real answers, valuable insights, and efficient knowledge online. Join us by subscribing, sharing, and engaging with our community to make a difference!