dump-mirrorbot/README.md

1.9 KiB

Slam

Slam Mirror Bot

This is a telegram bot writen in python for mirroring files on the internet to our beloved Google Drive.

Fork of python-aria-mirror-bot

Original Source Ayanamileechbot

Installing requirements

Clone this repo:

git clone https://github.com/breakdowns/slam-mirrorbot mirrorbot/
cd mirrorbot

Getting Google OAuth API credential file

  • 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 mirrorbot, 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

Session String

Generate session string by running:

python3 generate_string_session.py

Deploying on Heroku

Deploy to Heroku

Heroku Note: Doing authorizations ( /authorize command ) through telegram wont be permanent as heroku uses ephemeral filesystem. They will be reset on each dyno boot. As a workaround you can:

  • Edit a authorized_chats.txt file and write the user_id and chat_id of you want to authorize, each separated by new line