Just a little script to help me for downloading files via gdrive without interrupted by Google API error.
I used to have an ASUS's free quota for Google drive. But today, the quota was expired. I have to immediately ~~~evacuate~~~ copy files to the another Google drive account. But :
- Google doesn't provide an easy option for copying the whole drive to another account.
- My dormitory's internet is suck! I can't make it done easily. :(
- I have a cloud server with very fast internet connection. But I can use via SSH only.
GDriveCLI has no option for skip downloaded file.
So, I have to write this scripts in the middle of the night.
- Download and install
gdrive. Don't forget to allow access by rungdrive list` and follow the instruction. - Get
folderIDfrom your drive. The easiest way is browse the folder in the browser. You'll see URL like this:https://drive.google.com/drive/u/0/folders/<folderID>. - Prepare folder in your local computer and get an absolute folder path.
- Fill
<folderID>inist_folders("<folderID>")(line 23) ingdrive_list_all.pywithout angle brackets. - Fill
<rootFolder without tail slash>inrootFolder = '<rootFolder without tail slash>'(line 4) ingdrive_download_check.pywithout angle brackets. - Run :
python gdrive_list_all.py
python gdrive_download_check.pygdrive_list_all.pywill generate arrays of fileID and file path intodata.jsongdrive_download_check.pywill readdata.json, check whether file is existed. If not, it'll download files from your Google drive