Skip to content

dfslammirror/slam-mirrorbot

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

- [ DEAD REPO AND NO MORE UPDATE ]

SlamDevs

Slam Mirror Bot

GitHub Repo stars GitHub forks GitHub contributors GitHub watchers Docker Pulls

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

Installing requirements

  • 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

Getting Google OAuth API credential file

  • 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

  • Deploying on Heroku with heroku-cli and Goorm IDE

Using Service Accounts for uploading to avoid user rate limit

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

Add all the Service Accounts to the Team Drive

  • Run:
python3 add_to_team_drive.py -d SharedTeamDriveSrcID

Credits

Thanks to:

And many more people who aren't mentioned here, but can be found in Contributors.

About

Aria/qBittorrent Telegram mirror/leech bot.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 96.1%
  • Shell 3.7%
  • Other 0.2%