Scripts to download files and folders programmatically from Google Drive

Overview

Google Drive Downloader Scripts

Every time I need to download a lot of files from Google Drive (e.g. a dataset), it's always incredibly frustrating and slow to get that done. The browser UI very often fails mysteriously and when it does work, it is slow. So here are two scripts to download a file and download a folder programmatically, in case they are more broadly useful.

Prereqs

You would need to do the prerequisites here and in particular Create credentials. The scripts expect you to put the OAuth file you create as client_secret.json in the same folder as the script (obviously you can change this in the script). I also needed to pip install oauth2client in addition to the 3 libraries they list, so e.g.

pip install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib oauth2client

Running

Run them with the --noauth_local_webserver option, e.g. python3 download_folder.py --noauth_local_webserver This will spit out a link and then pause and wait for input. Copy and paste the link to a browser where you are logged in to a Google account with access to the folder. It will give you a prompt to authorize the app/project/whatever it's called thing you created when creating your credentials. After you allow it (as best as I can tell this is one time and not a permanent permission), it will give you a code that you can copy and paste as a response to the script.

Both scripts prompt you for a file id/folder id on the command line. You can find these in the URL from the web UI, e.g https://drive.google.com/drive/folders/

Outputs

Obviously, feel free to change where the scripts write but the download_file.py one spits out the file in the same folder as the script and download_folder.py spits them out in a downloaded/ subfolder (but it does not create it).

Misc

Some of this code was originally given in the Python Google Drive API Quickstart That code is available in a Google repo and it carries an Apache license. It is also useful to refer to the docs for the functions

Similar Tools

I also heard there are two other tools that get this job done. They are probably more bug-free and better maintained, so here they are:

Owner
Ivan Evtimov
University of Washington Allen School of CSE PhD student. Lafayette College Computer Science alum.
Ivan Evtimov
A prometheus exporter for torrent downloader like qbittorrent/transmission/deluge

downloader-exporter A prometheus exporter for qBitorrent/Transmission/Deluge. Get metrics from multiple servers and offers them in a prometheus format

Lei Shi 41 Nov 18, 2022
Automatically download multiple papers by keywords in CVPR

Automatically download multiple papers by keywords in CVPR

46 Jun 08, 2022
TikTok downloader video without watermark from Telegram bot

⬇️ How to download video from Tik Tok via telegram bot? Send a link to the video from tik tok to our telegram bot and it will send you a video without

1 Mar 04, 2022
Script for YouTube creators to share dislike count with their viewers.

Stahování disliků z YouTube - milafon Tento skript slouží jako možnost zobrazit divákům počet disliků u YouTube videí. Vyžaduje implementaci ze strany

4 Sep 28, 2022
Shit-fetch - Shitpost fetcher (downloader)

shit-fetch Download shitpost (random) from https://random-shitpost.com/ Usage ./shitfetch.py --nsfw (true/false) --output ~/Downloads (default : ./)

Pinokaille 1 Jan 02, 2022
Downloads state flags from wikipedia for states/regions from all countries

world-state-flags Downloads state flags from wikipedia for states/regions from all countries This data is NOT curated Uses https://github.com/dr5hn/co

João Ribeiro Bezerra 2 Dec 15, 2022
Youtube-music - Youtube music with python

youtube-music fzf on https://github.com/junegunn/fzf python3 ytb.py [no/yes] yes

direskyfer 0 Feb 03, 2022
A Python script that allows you to download all of an anime's episodes at once.

BitAnime A Python script that allows you to download all of an anime's episodes at once. · Download executable version · About BitAnime BitAnime is a

sh1nobu 17 Aug 10, 2022
Spy Ad Network - Spy Ad Network Detection With Python

Spy Ad Network Spy Ad Network Detection Jumps from link to link to access a site

Baris Dincer 2 Jan 13, 2022
Download candlestick data fast & easy for analysis

crypto-candlesticks 📈 The goal behind this project is to facilitate downloading cryptocurrency candlestick data fast & simple. Currently only the Bit

Pedro Torres 31 Dec 11, 2022
Will load an SRC page, logged in with Firefox's cookies imported, and delete all comments from every run

SRCCommentsAutoDeleter Will load an SRC page, logged in with a support browser's cookies, and delete all comments from every run Config is all done in

3 Oct 29, 2021
Download Youtube videos in mp4 format in a fast, easy, convenient way made with Python!

yt_downloader Download Youtube videos in mp4 format in a fast, easy, convenient way made with Python! Required Modules pytube os time colorama Errors

3 Jul 02, 2022
Organize your downloads easily with DownloadOrganizer

DownloadOrganizer Organize your downloads organize your downloads easily with DownloadOrganizer Instilation how to install DownloadOrganizer Method 1:

1 Dec 02, 2021
Newsemble is an API that provides easy access to the current news for programmatic analysis

Newsemble is an API that provides easy access to the current news for programmatic analysis. It has been built using Python, BeautifulSoup and MongoDB.

Rishabh 43 Dec 16, 2022
Downloads photos you saved from a specific profile.

instagram-download-saved A python script that downloads photos you saved from a specific profile. The only dependency is instaloader, an open-source p

Aviv 1 Dec 19, 2021
SABnzbd - The automated Usenet download tool

SABnzbd is an Open Source Binary Newsreader written in Python.

SABnzbd 1.8k Dec 30, 2022
A python program to download one or multiple videos from YouTube.

YouTube-Video-Downloader A python program to download one or multiple videos from YouTube. Quick Start guide First Clone The Project git clone https:/

Imira Randeniya 1 Sep 11, 2022
YT-Spammer-Purge - Allows you easily scan for and delete scam comments using several methods

YouTube Spammer Purge What Is This? - Allows you to filter and search for spamme

4.3k Dec 31, 2022
1Fichier Download Manager.

1fichier-dl 1Fichier Download Manager. Features ⭐ Manage your downloads ⭐ Bypass time limits Credits All icons, including the app icon, were provided

manuGMG 470 Oct 08, 2022
This is a tool to allow downloading any links from r/Roms Magethread

ILYFPR This is a tool to allow downloading any links from r/Roms Magethread Limitations: It downloads ALL roms of the system you choose. This will be

Erase 4 Nov 04, 2021