# GDrive Clone | Clone a shared google drive link to your own google drive

**URL:** <https://onehack.st/t/gdrive-clone-clone-a-shared-google-drive-link-to-your-own-google-drive/173303>\
**Category:** Tools & Scripts\
**Tags:** tools\
**Created:** [February 21, 2021, 1:16pm UTC](https://onehack.st/t/gdrive-clone-clone-a-shared-google-drive-link-to-your-own-google-drive/173303 "2021-02-21T13:16:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![NoBody](https://onehack.st/user_avatar/onehack.st/nobody/32/163880_2.png) [@NoBody](https://onehack.st/u/NoBody)\
**Post date:** [February 21, 2021, 1:16pm UTC](https://onehack.st/t/gdrive-clone-clone-a-shared-google-drive-link-to-your-own-google-drive/173303/1 "2021-02-21T13:16:53Z")

</div>

[![gdrive-clone](https://camo.githubusercontent.com/be4de3598b86f2deb97e65d2d88babb1dd2eebf697b09649115fd22d92d69445/68747470733a2f2f692e696d6775722e636f6d2f4341485749446b2e706e67)](https://camo.githubusercontent.com/be4de3598b86f2deb97e65d2d88babb1dd2eebf697b09649115fd22d92d69445/68747470733a2f2f692e696d6775722e636f6d2f4341485749446b2e706e67)

“Clone a shared google drive link to your own google drive”

[![](https://camo.githubusercontent.com/fa2f6519bcf75da31abb847c62f538e703a9bd8f2ee1f181014c563b9538ee3d/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4f70656e5f736f757263652d4d49542d677265656e2e7376673f6c6f676f3d676974266c6f676f436f6c6f723d677265656e)](https://github.com/alx-xlx/gdrive-clone/blob/master/LICENSE) [![](https://camo.githubusercontent.com/709d65b3a312dc0cf6747182f93283d7c6e56db79902c2ce8223933ec973e01f/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f616c782d786c782f6764726976652d636c6f6e652e7376673f6c6f676f3d5375626c696d652b54657874266c6f676f436f6c6f723d677265656e266c6162656c3d416374697665)](https://github.com/alx-xlx/gdrive-clone/commits/dev) [![GitHub Release Date](https://camo.githubusercontent.com/a1d0167303862cae368fbd3096ca6e2b5fd6aceff6b118418a8de1a25eb4bc1c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f616c782d786c782f6764726976652d636c6f6e65)](https://camo.githubusercontent.com/a1d0167303862cae368fbd3096ca6e2b5fd6aceff6b118418a8de1a25eb4bc1c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f72656c656173652d646174652f616c782d786c782f6764726976652d636c6f6e65) [![GitHub last commit](https://camo.githubusercontent.com/76e808b5434ab01c9179c6ea1d2be081af93e6b50d19ff36ac392f550e09c1ea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f616c782d786c782f6764726976652d636c6f6e65)](https://camo.githubusercontent.com/76e808b5434ab01c9179c6ea1d2be081af93e6b50d19ff36ac392f550e09c1ea/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f616c782d786c782f6764726976652d636c6f6e65) [![GitHub repo size](https://camo.githubusercontent.com/5995fd856c03b6fbfb52d36b0aae9fe6be33f0be1884bbb116dfc7af02723ad4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f616c782d786c782f6764726976652d636c6f6e65)](https://camo.githubusercontent.com/5995fd856c03b6fbfb52d36b0aae9fe6be33f0be1884bbb116dfc7af02723ad4/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f7265706f2d73697a652f616c782d786c782f6764726976652d636c6f6e65) [![gdrive-clone-hits](https://camo.githubusercontent.com/0eb0cf1291f336ff5e98e8089df29e06ea6f0208e11173ad9a2ad20fc0901d65/687474703a2f2f686974732e6477796c2e636f6d2f616c782d786c782f6764726976652d636c6f6e652e737667)](https://camo.githubusercontent.com/0eb0cf1291f336ff5e98e8089df29e06ea6f0208e11173ad9a2ad20fc0901d65/687474703a2f2f686974732e6477796c2e636f6d2f616c782d786c782f6764726976652d636c6f6e652e737667)

### 🌠 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](https://github.com/alx-xlx/gdrive-clone.git) cd gdrive-clone mkdir accounts chmod -R 777 gclone npm install

### Create a Telegram Bot

1. Open your Telegram Application and find @botfather or visit [t.me/botfather](https://t.me/botfather)
2. `/start`
3. `/newbot`
4. Choose a Name for your Bot

Once Successful, you will be presented with a link to your bot ([t.me/YOURBOT](http://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

1. Visit [https://developers.google.com/drive/api/v3/quickstart/python](https://developers.google.com/drive/api/v3/quickstart/python)
2. Enter a Project Name OR Skip
3. Configure your OAuth Client \> Desktop App
4. 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](https://i.imgur.com/hJP61iq.png)

#### Identity and Access Management (IAM) API

> **[Google Cloud console](https://console.cloud.google.com/apis/library/iam.googleapis.com)**

#### Service Usage API

> **[Google Cloud console](https://console.cloud.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`

[![](https://camo.githubusercontent.com/9a67073b9a8483ae253f0405a63b333974d5229c42aa3247b0db3b952f9b054b/68747470733a2f2f692e696d6775722e636f6d2f353367353231482e706e67)](https://camo.githubusercontent.com/9a67073b9a8483ae253f0405a63b333974d5229c42aa3247b0db3b952f9b054b/68747470733a2f2f692e696d6775722e636f6d2f353367353231482e706e67)

OR

Replace `TEAMDRIVEID` with `Folder ID` Inside `My Drive` having Editor Permission

[![](https://camo.githubusercontent.com/ffb5df605c679f7c94d28c284c2fdbe9a1f9673f6d7ef122b436ad20d06a2a4e/68747470733a2f2f692e696d6775722e636f6d2f68715054324a782e706e67)](https://camo.githubusercontent.com/ffb5df605c679f7c94d28c284c2fdbe9a1f9673f6d7ef122b436ad20d06a2a4e/68747470733a2f2f692e696d6775722e636f6d2f68715054324a782e706e67)

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.fastio.me](https://td.fastio.me/)

[https://td.hackgence.com](https://td.hackgence.com/) OR [https://team.hackgence.com](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:

[https://github.com/alx-xlx/gdrive-clone](https://github.com/alx-xlx/gdrive-clone)
