How To Deploy Telegram Fclone And Gclone Bot Hosted Locally On Your Phone

image

Introduction

Hi guys. I will walk you through How to Deploy Telegram Fclone and Gclone Bot Hosted Locally on Your Phone using termux apk. You can eqaully do this on a VPS but i know many people have limitations getting a personal VPS. So I will be hosting this bots locally on my Android phone. Let’s dive it.

Prerequisites

  • An Android phone with internet access and Termux apk installed
  • Your Service Accounts (SA) obtained from either AutoRclone or Folderclone.
  • Two Telegram Bot Tokens- one each for the Gclone and Fclone bots
  • Telegram User ID
  • Gclone and Fclone installed on your Android device

How to Deploy Telegram Fclone and Gclone Bot

Step 1: Open your Termux app and run this code to install this packages.

pkg install git zip wget curl screen tmux rclone python proot # The proot pkg will allow Termux to simulate root environment with standard Linux directory structure and paths of /bin, /etc, /usr and /tmp

Step 2: Visit this Github repositories through this links.

Fclone– Expand the assets section and copy the link of the Fclone pkg (latest release is v0.4.1) that corresponds with your Android architecture. To know your Android architecture, run this code:

uname -m

Gclone– Expand the assets section and copy the link of the Gclone pkg (latest release is v1.51.0-mod1.3.1) that corresponds to your Android architecture.

Bot Repo– Visit this Github repo and copy the link to clone the repo.

Step 3: Install Fclone and Gclone on your android phone by running these commands in termux. I will be installing the x86 version because my OS is i686.

Gclone Installation on Android-

termux-chroot # Will allow Termux to simulate root environment with standard Linux directory structure and paths of /bin, /etc, /usr and /tmp

Then,

wget -N https://github.com/donwa/gclone/releases/download/v1.51.0-mod1.3.1/gclone_1.51.0-mod1.3.1_Linux_i386.gz

Then,

gunzip gclone_1.51.0-mod1.3.1_Linux_i386.gz

Then,

mv gclone_1.51.0-mod1.3.1_Linux_i386 gclone

Then,

mv gclone /usr/bin

Then,

chmod +x /usr/bin/gclone

Then check if your installation is successful,

gclone --version

Fclone Installation on Android

wget -N https://github.com/mawaya/rclone/releases/download/fclone-v0.4.1/fclone-v0.4.1-linux-386.zip

Then,

unzip fclone-v0.4.1-linux-386.zip

Then,

mv fclone-v0.4.1-linux-386.zip fclone

Then,

cd fclone

Then,

mv fclone /usr/bin

Then,

chmod +x /usr/bin/fclone

Then,

fclone --version

Step 4: Clone the Bot Github repository using the link given above. Run these codes.

First clone the repo

git clone https://github.com/Waga43/telegram_gcloner_fcloner

Make a new directory called fclone_bot

mkdir fclone_bot

Copy the cloned repo to the newly created directory

cp -r telegram_gcloner_fcloner fclone_bot

For the Gclone Bot

cd telegram_gcloner_fcloner

Install requirements

pip3 install requirements.txt
cd telegram_gcloner

Make a copy of the config file

cp config.ini.example config.ini

Edit the config file

nano config.ini # Leave the path_to_gclone and gclone_para_override empty (if you are editing the config file for the Gclone bot).

For the fclone Bot

cd fclone_bot/telegram_gcloner_fcloner/telegram_gcloner/
cp config.ini.example config.ini
nano config.ini # Put the path_to_gclone = /usr/bin/fclone and leave gclone_para_override empty (if you are editing the config file for the Fclone bot).

Ensure you save the config file after editing it and inputing the necessary details as explained above including your Telegram user ID, Bot token and group ID.

Launching the Bots

To launch the bots and ensure they both continue running in the background, run either the screen or tmux commands (depending on which one you are comfortable with). I will use the screen cmd to show an example.

screen -S "Your screen Session name" # Use any name you like e.g. Gclone Bot. Don't include the quotes in the name.

Then run the following code to deploy your bot

python3 telegram_gcloner.py

When the bot starts, folow the on-screen prompts. You can as well add the following lines of codes to the #Setcommands of Botfather

olders - Add your TD folders
help - How to use bot
sa - Reply to accounts.zip file

In Case of Errors

In case you run into errors after installing either gclone or fclone (for example, you may have wrongly installed the wrong version for your Android device) and need to try reinstalling the right one; but first you have to uninstall or remove the previous one from your Android device. Run the following code in another termux window:

rm /data/data/com.termux/files/usr/bin/gclone

rm /data/data/com.termux/files/usr/bin/fclone

Compress and upload your accounts folder containing your SA files to the bot. Reply to this file with /sa. In addition, using the /folders cmd copy the Team Drive ID or folder ID you want to copy files into and follow the on-screen prompts to set your favorite folders.

That’t it guys! Now you know How to Deploy Telegram Fclone and Gclone Bot Hosted Locally on Your Phone. I guess I don’t need to remind you that you have to ensure your SA emails are added appropriately to the TD. You can add it directly or use a Google Group, then add the Google Group email to the TD as a member.

To copy files, just forward the link of the shared file to the Bot and follow the screen prompts. That’s all.

Source: EDUTECHTAINMENT

Happy learning!

10 Likes

Hey @Waga bro i am unable to install fclone on arm64 i tried almost all versions of fclone no one is working for my device Gclone is working fine on aarch64 but fclone says nocommand fclone found

i am using this release of fclone :-https://github.com/mawaya/rclone/releases/download/fclone-v0.4.1/fclone-v0.4.1-linux-arm64.zip
And this release of gclone which is working fine :-https://github.com/donwa/gclone/releases/download/v1.51.0-mod1.3.1/gclone_1.51.0-mod1.3.1_Linux_arm64.gz

Can u please help what am i doing wrong?

Probably you did something wrong. It should work if you followed the steps right. Run uname -a command and check what architecture is your device.

Cheers.

“And Over Every Possessor of Knowledge, There is (Some) One (Else) More Knowledgeable”

1 Like

its aarch64 Brother if i chose wrong arch then gclone should also not work
And i have tried almost all linux arch types of fclone none of them is working for my device :face_with_head_bandage:
And yes your repo Needs updates both gclone and fclone When are updates coming sir?

It’s been a while i actually worked on these stuffs. I hv not been active especially when Google changed their drive policies.

That’s surprising. I want to check it out and revert. Will keep you posted.

Cheers!!!

“And Over Every Possessor of Knowledge, There is (Some) One (Else) More Knowledgeable”

Just successfully installed it on my aarch64 device.

Cheers!!!

“And Over Every Possessor of Knowledge, There is (Some) One (Else) More Knowledgeable”

3 Likes

let me give it another try :grin:

wget -N https://github.com/mawaya/rclone/releases/download/fclone-v0.4.1/fclone-v0.4.1-linux-arm64.zip

Use the above code.

Cheers!!!

“And Over Every Possessor of Knowledge, There is (Some) One (Else) More Knowledgeable”

2 Likes

So @Waga I did as per your screenshot and now its working Problem was in this step

it was moving empty folder

I forget to mention Thanks @Waga i didn’t expected any replies soon but i was surprised to see your reply

1 Like


Got this error while deploying bot😓

install telegram module pip3 install requirements.txt this should do it

Could not find a version that satisfies the requirement requirements(from version:none)
Error: No matching distribution found for requirements

Yeah. I came online at that time and could reply. Let me checkout the error you got.

Cheers!!!

“And Over Every Possessor of Knowledge, There is (Some) One (Else) More Knowledgeable”

You didn’t install the requirements. I just launched the bot successfully on my new android phone. It works.

Did you just install termux?
The termux on playstore is “defective” and will give problems.

I had to uninstall and reinstall.

Cheers!!!

“And Over Every Possessor of Knowledge, There is (Some) One (Else) More Knowledgeable”


2 Likes

Yeah i have installed termux from playstore :neutral_face: let me uninstall it and download from f-droid :grin:

1 Like

getting same error on fdroid termux
can’t install requirements

Run this code to Install requirements

pip3 install -r requirements.txt

Cheers!!!

“And Over Every Possessor of Knowledge, There is (Some) One (Else) More Knowledgeable”

2 Likes

I messed up with sa’s Will do rest of process tommorow :grin:thnx this code worked​:grin:

1 Like