import gdown import os def download_gdrive(id, dir = ".", filename = None): print('download...') tmp_filename = gdown.download(id=id, quiet=True) if filename is None: filename = tmp_filename file_path = f'{dir}/{filename}' if os.path.isdir(dir) == False: os.mkdir(dir) os.replace(tmp_filename, file_path) return file_path