Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/alx-xlx/gdrive-clone
Clone a shared google drive link to your own google drive
https://github.com/alx-xlx/gdrive-clone
copy drive foldercopy gdrive-clone google teamdrive telegram
Last synced: 2 months ago
JSON representation
Clone a shared google drive link to your own google drive
- Host: GitHub
- URL: https://github.com/alx-xlx/gdrive-clone
- Owner: alx-xlx
- License: mit
- Created: 2020-08-24T15:32:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-02-21T19:00:31.000Z (almost 4 years ago)
- Last Synced: 2024-08-01T21:56:45.159Z (5 months ago)
- Topics: copy, drive, foldercopy, gdrive-clone, google, teamdrive, telegram
- Language: JavaScript
- Homepage:
- Size: 10.6 MB
- Stars: 62
- Watchers: 4
- Forks: 43
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- project-awesome - alx-xlx/gdrive-clone - Clone a shared google drive link to your own google drive (JavaScript)
README
"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
```sh
sudo apt install -y make python build-essential
git clone 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 BotOnce 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
1. Visit https://developers.google.com/drive/api/v3/quickstart/python
2. Enter a Project Name OR Skip
3. Configure your OAuth Client > Desktop App
4. CreateRename 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`
![iam-googleapis](https://i.imgur.com/hJP61iq.png)
#### Identity and Access Management (IAM) API
[iam.googleapis.com](https://console.developers.google.com/apis/library/iam.googleapis.com)#### Service Usage API
[serviceusage.googleapis.com](https://console.developers.google.com/apis/library/serviceusage.googleapis.com)```sh
pip3 install -r requirements.txt
# Install all the required python modules
``````sh
python3 gen_sa_accounts.py --quick-setup 2 --new-only
# This will create around 200 Service Accounts
``````sh
python3 gen_sa_accounts.py --quick-setup 5 --new-only
# This will create around 1200 Service Accounts
``````sh
python3 add_to_team_drive.py -d TEAMDRIVEID
```
Replace `TEAMDRIVEID` with your `Teamdrive ID`![](https://i.imgur.com/53g521H.png)
OR
Replace `TEAMDRIVEID` with `Folder ID` Inside `My Drive` having Editor Permission
![](https://i.imgur.com/hqPT2Jx.png)
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.hackgence.com 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
```sh
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`#### Run Forever
```sh
sudo npm install forever -g
# Install forever
``````sh
forever start server.js
# Start Server
forever stop server.js
# Stop Server
```## Credits
[botgram/shellbot](https://github.com/botgram/shell-bot) - Shell Running Telegram Bot
[donwa/gclone](https://github.com/donwa/gclone) - Modified rclone for SA Support
[xyou365/AutoRclone](https://github.com/xyou365/AutoRclone) - To generate Service Accounts