- [ DEAD REPO AND NO MORE UPDATE ]
Slam Mirror Bot is a multipurpose Telegram Bot written in Python for mirroring files on the Internet to our beloved Google Drive. Based on python-aria-mirror-bot
- Clone this repo:
git clone https://github.com/mrsammaus/slam-mirrorbot/
cd slam-mirrorbot
- Install requirements For Debian based distros
sudo apt install python3
- Install dependencies for running setup scripts:
pip3 install -r requirements-cli.txt
- Move that file to the root of mirrorbot, and rename it to credentials.json
- Finally, run the script to generate token.pickle file for Google Drive:
pip install google-api-python-client google-auth-httplib2 google-auth-oauthlib
python -m pip install google-auth-oauthlib
python3 generate_drive_token.py
- Deploying on Heroku with heroku-cli and Goorm IDE
For Service Account to work, you must set USE_SERVICE_ACCOUNTS
= "True" in config file or environment variables.
NOTE: Using Service Accounts is only recommended while uploading to a Team Drive.
Generate Service Accounts. What is Service Account
Let us create only the Service Accounts that we need.
- List your projects ids
python3 gen_sa_accounts.py --list-projects
- Enable services automatically by this command
python3 gen_sa_accounts.py --enable-services $PROJECTID
- Create Sevice Accounts to current project
python3 gen_sa_accounts.py --create-sas $PROJECTID
- Download Sevice Accounts as accounts folder
python3 gen_sa_accounts.py --download-keys $PROJECTID
If you want to add Service Accounts to Google Group, follow these steps
- Mount accounts folder
cd accounts
- Grab emails form all accounts to emails.txt file that would be created in accounts folder
grep -oPh '"client_email": "\K[^"]+' *.json > emails.txt
- Unmount acounts folder
cd -
Then add emails from emails.txt to Google Group, after that add Google Group to your Shared Drive and promote it to manager.
NOTE: If you have created SAs in past from this script, you can also just re download the keys by running:
python3 gen_sa_accounts.py --download-keys project_id
- Run:
python3 add_to_team_drive.py -d SharedTeamDriveSrcID
Thanks to:
out386
heavily inspired from his Telegram Bot written in TypescriptIzzy12
for build up of this bot from scratchjaskaranSM
for build up of this bot from scratchDank-del
for base repomagneto261290
for some featuresSVR666
for some features & fixesbreakdowns
for slam-mirrorbotzevtyardt
for some direct linksyash-dk
for implementation of qBittorrent on Pythonxyou365
for Service Accounts script
And many more people who aren't mentioned here, but can be found in Contributors.