“Clone a shared google drive link to your own google drive”
Features
- COPY/MOVE/SYNC any Shared Folder to your (My Drive/Shared Drive)
- Server Side Copy (SAs are used for copy/move/sync)
- Bypass 750GB Transfer Limit
- No extra Bandwidth Required
- Integrated with Telegram Bot for easy access
Requirements
- Python 3
- NodeJS
- Telegram Application
- Linux Server
Setup
sudo apt install -y make python build-essential git clone https://github.com/alx-xlx/gdrive-clone.git 1 cd gdrive-clone mkdir accounts chmod -R 777 gclone npm install
Create a Telegram Bot
- Open your Telegram Application and find @botfather or visit t.me/botfather 1
/start
/newbot
- Choose a Name for your Bot
Once Successful, you will be presented with a link to your bot (t.me/YOURBOT) & a Token to Access the HTTP API
Generate Service Accounts
Before Generating Service Accounts we have to enable Drive API in our Google Account and grab the API credentials.json
file.
Enable APIs
Drive API
- Visit https://developers.google.com/drive/api/v3/quickstart/python 1
- Enter a Project Name OR Skip
- Configure your OAuth Client > Desktop App
- Create
Rename the file to credentials.json
and place it in the repository folder
To Enable the below two APIs, visit the link > select the Project > Enable
e.g https://i.imgur.com/hJP61iq.png
Identity and Access Management (IAM) API
https://console.developers.google.com/apis/library/iam.googleapis.com
Service Usage API
https://console.developers.google.com/apis/library/serviceusage.googleapis.com
pip3 install -r requirements.txt # Install all the required python modules
python3 gen_sa_accounts.py –quick-setup 2 –new-only # This will create around 200 Service Accounts
python3 gen_sa_accounts.py –quick-setup 5 –new-only # This will create around 1200 Service Accounts
python3 add_to_team_drive.py -d TEAMDRIVEID
Replace TEAMDRIVEID
with your Teamdrive ID
OR
Replace TEAMDRIVEID
with Folder ID
Inside My Drive
having Editor Permission
This will Add all the service accounts to your Teamdrive, so make sure you have Manager
Role in this TEAMDRIVEID
If you don’t have a Team Drive, you can get few from below links
https://td.hackgence.com 1 OR https://team.hackgence.com
We have successfully generated Service Accounts (SA) at /gdrive-clone/accounts/
folder, Rename any one of the SA to 1.json
Run
node server # This will run the server, and now you can goto your Telegram bot and run commands
If everything go as scripted it will prompt you to Enter a Token Switch back to Telegram App and /run /PATH/TO/gdrive-clone/gclone
GitHub:
alx-xlx/gdrive-clone 7
Clone a shared google drive link to your own google drive