This is a telegram bot writen in python for searching files in Drive.
- Clone this repo:
git clone https://github.com/usmanmughalji/Drive-X-Search-Bot search-bot/
cd search-bot
- For Debian based distros
sudo apt install python3
sudo snap install docker
- For Arch and it's derivatives:
sudo pacman -S docker python
cp config_sample.env config.env
Fill up rest of the fields. Meaning of each fields are discussed below:
- BOT_TOKEN : The telegram bot token that you get from @BotFather
- OWNER_ID : The Telegram user ID (not username) of the owner of the bot
-
The bot is unable to search in sub-directories, but you can specify directories in which you wanna search.
-
Add drive/folder name(anything that u likes), drive id/folder id & index url(optional) corresponding to each id.
-
If you are adding a folder id and you wish to use index url, then add index url corresponding to that folder.
-
Run driveid.py and follow the screen.
python3 driveid.py
- Visit the Google Cloud Console
- Go to the OAuth Consent tab, fill it, and save.
- Go to the Credentials tab and click Create Credentials -> OAuth Client ID
- Choose Desktop and Create.
- Use the download button to download your credentials.
- Move that file to the root of search-bot, and rename it to credentials.json
- Visit Google API page
- Search for Drive and enable it if it is disabled
- Finally, run the script to generate token file (token.pickle) for Google Drive:
pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib
python3 generate_drive_token.py
- Start docker daemon (skip if already running):
sudo dockerd
- Build Docker image:
sudo docker build . -t search-bot
- Run the image:
sudo docker run search-bot
- SearchX-bot - SVR666
- python-aria-mirror-bot - lzzy12
- magneto-python-aria - magneto261290