matthuisman / gdrivedl

Google Drive Download Python Script
https://www.matthuisman.nz
GNU General Public License v3.0
200 stars 55 forks source link

TODO: Make more friendly to use programmatically (not via cli) #24

Open matthuisman opened 2 years ago

jesusyanez commented 2 years ago

You can use this function if you want to use gdrivedl in a python script.

Note that if you're downloading from a "drive.google.com/drive/file/" link you need to pass a filename argument instead of "filename=None"

#Example for "drive.google.com/drive/folders/" link
import gdrivedl

def download(url, output_folder, filename=None):
    dl = gdrivedl.GDriveDL(quiet=False, overwrite=False, mtimes=False)
    dl.process_url(url, output_folder, filename=None) 

url='https://drive.google.com/drive/folders/1a29jYcV2CHlgL2Wofk7SKjKz6iG10cyN'
output='./folder'
download(url, output)