Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c7e81d5
Delete start.sh
MsGsuite Apr 6, 2021
7379a84
Delete requirements.txt
MsGsuite Apr 6, 2021
759248d
Delete index.html
MsGsuite Apr 6, 2021
c17d371
Delete heroku.yml
MsGsuite Apr 6, 2021
f660f25
Delete README.md
MsGsuite Apr 6, 2021
b967171
Delete LICENSE
MsGsuite Apr 6, 2021
dbc52e4
Delete Dockerfile
MsGsuite Apr 6, 2021
adf4695
Delete .gitignore
MsGsuite Apr 6, 2021
871e057
Delete telegram_gcloner directory
MsGsuite Apr 6, 2021
06a451e
Add files via upload
MsGsuite Apr 6, 2021
197553d
Update README.md
MsGsuite Apr 6, 2021
288885c
Update README.md
MsGsuite Apr 6, 2021
5814cc5
Update app.json
MsGsuite Apr 6, 2021
622423d
v2
MsGsuite Apr 7, 2021
ec55afd
Update start.sh
MsGsuite Apr 16, 2021
8eae64b
Update app.json
MsGsuite Apr 16, 2021
130456c
Update README.md
MsGsuite Apr 16, 2021
a5db515
Delete config.ini
MsGsuite Apr 16, 2021
25a6988
Update start.sh
MsGsuite Apr 16, 2021
4520a11
Update app.json
MsGsuite Apr 16, 2021
0a8c631
Create config.ini
MsGsuite Apr 16, 2021
d4f9cc1
Create gclone.exe
Apr 16, 2021
a4d8671
Update README.md
MsGsuite Apr 16, 2021
f47286c
Update README.md
MsGsuite Apr 16, 2021
654f903
Update README.md
MsGsuite Apr 16, 2021
bfc3a7c
Update README.md
MsGsuite Apr 16, 2021
0dd68d6
Update README.md
MsGsuite Apr 16, 2021
b881710
Update README.md
MsGsuite Apr 16, 2021
6a1f163
Update README.md
MsGsuite Apr 16, 2021
0c0ed6a
Update README.md
MsGsuite Apr 16, 2021
0e10853
Update README.md
MsGsuite Apr 16, 2021
b0771a3
Update README.md
MsGsuite Apr 16, 2021
ab595f5
Update README.md
MsGsuite Apr 16, 2021
c262137
Update README.md
MsGsuite Apr 16, 2021
d0429e3
Update README.md
MsGsuite Apr 16, 2021
cb72b75
Update README.md
MsGsuite Apr 16, 2021
e9a4087
Update README.md
MsGsuite Apr 16, 2021
69bf595
Update README.md
MsGsuite Apr 16, 2021
3b667a1
Update README.md
MsGsuite Apr 16, 2021
96b8a59
Update README.md
MsGsuite Apr 16, 2021
34733d9
Update README.md
MsGsuite Apr 16, 2021
26b373b
Update README.md
MsGsuite Apr 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
135 changes: 0 additions & 135 deletions .gitignore

This file was deleted.

38 changes: 19 additions & 19 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
FROM ubuntu:18.04

WORKDIR /usr/src/app
RUN chmod 777 /usr/src/app
RUN apt-get -qq update
RUN apt-get -qq install -y git python3 python3-pip \
locales python3-lxml aria2 \
curl pv jq nginx npm
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt && \
apt-get -qq purge git
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
COPY . .
RUN chmod +x start.sh
RUN chmod +x gclone
CMD ["bash","start.sh"]
FROM ubuntu:18.04
WORKDIR /usr/src/app
RUN chmod 777 /usr/src/app
RUN apt-get -qq update
RUN apt-get -qq install -y git python3 python3-pip \
locales python3-lxml aria2 \
curl pv jq nginx npm
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt && \
apt-get -qq purge git
RUN locale-gen en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
COPY . .
RUN chmod +x start.sh
RUN chmod +x gclone
CMD ["bash","start.sh"]
42 changes: 21 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
MIT License

Copyright (c) 2020 wrenfairbank

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
MIT License
Copyright (c) 2020 wrenfairbank
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
141 changes: 74 additions & 67 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,67 +1,74 @@

# telegram gcloner

A Telegram bot to facilitate manual saving of Google Drive resources. If you have a good idea, PR is welcome.

Demo bot:http://t.me/ahzhebot

## Usage

### Prerequisites

1. Install [Python 3.7+(Latest version 3.8.3 recommended)](https://www.python.org/downloads/)
2. Download [gclone](https://github.com/donwa/gclone/releases) or [fclone (recommended)](https://github.com/mawaya/rclone/releases)
3. Familiarize yourself with gclone, get the json containing the identity of Service Accounts, and confirm that you can use `gclone` or `fclone` for the operation.
4. Request a [Telegram Bot](https://core.telegram.org/bots#6-botfather) and get **token**
5. Get your own Telegram ID, such as through [this bot](https://t.me/userinfobot)

### Installation

Download the Zip version or via git clone.
```
$ git clone https://github.com/thegreatestminer/telegram_gcloner
```
Installing dependencies via requirements.txt
```
$ pip3 install -r requirements.txt
```
Copy `config.ini.example` and rename it to `config.ini`.
Revise the corresponding content to include.

> path_to_gclone = gclone.exe(The path is optional for each distribution of Linux if it is obtained through installation, and optional for Windows if it is in PATH. fclone is always required)
>
> telegram_token = telegram bot token
>
> user_ids = Your Telegram ID (multiple separated by commas, first ID is admin)
>
> gclone_para_override = If you don't know what this is, leave it blank.

If you're interested, you can adjust the permissions in `./utils/restricted.py` to respond only to users in `user_ids` by default.

## Run

1. `python telegram_gcloner.py`。
2. Upload the ZIP file containing the SA to the bot and fill in `/sa` in the message header.
- Mobile users can upload the ZIP file first and then reply to the message with `/sa`.
3. Send `/folders` to the robot to set up destination folders.
4. Send or forward a message with a Google Drive link to the bot and follow the prompts.

### Installation On Heroku

1. Clone this repo

2. Create a heroku app and the remote to this repo by using `heroku apps:create "APPNAME"` where APPNAME will be your preferred app anme

3. Make the app a container by using `heroku stack:set container`

4. Do changes on your config.ini

5. Add the changes and commit them (make sure .gitignore doesn't skips your important files which will be need to be pushed to heroku)

6. `git push heroku master`


## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details

<h1 align="center">⚡ Clonebot ⚡<br></h1>

<br />

<p align="center">CloneBot is a telegram bot that allows you to copy folder/team drive to team drives. One of the main advantage of this bot is that you can host it to Heroku for free.<p/>

<!-- > ## A simple bot to copy and duplicate team drives -->
<p align="center">
<img src="https://i.imgur.com/QkxmCOp.png" />
</p>

<br />

#### ✅ Advantages
- Use server side copy
- Bypass the 750Gb a day limit thanks to Service accounts
- Duplicate team drive
- Copy public folders & files to team drives
- [Host it to heroku](https://github.com/MsGsuite/CloneBot_Heroku)

#### ❌ Drawbacks
- Does not support files upload (only copy)
- You cannot copy the data to My Drive

Note : there are hidden features, check at the source code of the bot to find them 🙃
<br/><br/>

### ⚠ You need [service accounts (sa)](https://telegra.ph/How-to-create-and-use-service-accounts-sa-03-31) to use the bot
<br/><br/>

## ⚛️ Deploying on Heroku
--> https://github.com/MsGsuite/CloneBot_Heroku
<br/><br/>

## 📱 Run the bot on your phone using termux

--> https://telegra.ph/Clone-Bot-Termux-04-30
<br/><br/>

## 💠 Host the bot on your computer

1. Download the repo : https://github.com/MsGsuite/CloneBot/archive/refs/heads/master.zip
2. Open the config.ini file (inside the telegram_gcloner folder) and fill the following values :


> path_to_gclone =./gclone ⚠ Don't touch this
>
> telegram_token = go to @BotFather and send /newbot to get one
>
> user_ids = -1 = Your user id (go to @MissRose_bot and type /id to get your id) - If you want to authorize multiple users, add a comma between each ID (ex: 150654065,5897065)
>
> group_ids = your telegram group ID (leave it blank if you don't want to add one). To get your group id, go to @MissRose_bot and type /id
>
> gclone_para_override = leave this empty if you don't know how to use it

3. Install [python](https://www.python.org/downloads/)
4. open CMD and cd to the folder containing the bot
5. run `pip install -r requirements.txt`
6. cd to the telegram_gcloner folder and run : `py telegram_gcloner.py`
7. Start your bot and you can copy your data !
<br/><br/>


## 📢 Follow us:
- Team drive generator : https://td.msgsuite.workers.dev/
- Telegram channel : https://t.me/MsGsuite
- Telegram chat : https://t.me/MsGsuiteChat

## ❤️ Credits & thanks :
- [wrenfairbank](https://github.com/wrenfairbank/telegram_gcloner) for the original python script
- [smartass08](https://github.com/smartass08/telegram_gcloner) to adapt the scrip to heroku
- [anymeofu](https://github.com/anymeofu/CloneBot) for making the Direct Heroku deployable Version
- Zero-The-Kamisama to making me discover this amazing bot and the detailed instructions
- [zorgof](https://t.me/zorgof) for the termux script
22 changes: 22 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "CloneBot",
"description": "CloneBot",
"repository": "https://github.com/MsGsuite/CloneBot",
"keywords": ["Gclone","TG"],
"env": {
"BOT_TOKEN": {
"description": "Get from Telegram Botfather"
},
"USER_ID": {
"description": "get from telegram get_id_bot. For More than 1 User Give IDs seperated by ','.The First Guy is the Admin"
},
"GRP_ID": {
"description": "Create a Super Group(s) and add ID Here (if More than 1 group Give IDs seperated by ','"
},
"GC_PARA_OVERRIDE": {
"description": "Leave this if u Dont Know",
"required": false
}
},
"stack": "container"
}
10 changes: 5 additions & 5 deletions heroku.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
build:
docker:
worker: Dockerfile
run:
worker: bash start.sh
build:
docker:
worker: Dockerfile
run:
worker: bash start.sh
1 change: 0 additions & 1 deletion index.html

This file was deleted.

Loading