Coder Social home page Coder Social logo

debiprasadxd-ddxd-mirror-bot's Introduction

Original Repo / Credits :

https://github.com/lzzy12/python-aria-mirror-bot

What is the main difference?

This bot is now can be deployed using a SmartPhone(mainly Termux) & Heroku.

  • Some UI improvement
  • Redefined Progress Bar
  • More Attractive enhanced look

Features supported:

  • Mirroring direct download links to google drive
  • Download progress
  • Upload progress
  • Download/upload speeds and ETAs
  • Docker support
  • Uploading To Team Drives.
  • Index Link support
  • Service account support
  • Mirror telegram files

How to deploy?

Deploying is lengthy process required patience & here goes the steps :

  • Clone this repo in your device:
git clone https://github.com/DebiprasadXD/DDxD-Mirror-Bot 
cd DDxD-Mirror-Bot
  • Install dependencies for running setup scripts:
pip3 install -r requirements.txt

Setting up config-sample file

  • BOT_TOKEN : The telegram bot token that you get from @BotFather
  • GDRIVE_FOLDER_ID : This is the folder ID of the Google Drive Folder/dir in which you want to upload all the mirrors.
  • TELEGRAPH_TOKEN : The token generated by running:
python3 generate_telegraph_token.py
  • OWNER_ID : The Telegram user ID.
  • IS_TEAM_DRIVE : (Optional field) Set to "True" if GDRIVE_FOLDER_ID is from a Team Drive else False or Leave it empty.
  • INDEX_URL : (Optional field) go here to generate your index url https://github.com/Achrou/goindex-theme-acrou
  • API_KEY : You can get this from https://my.telegram.org (DO NOT put this in quotes).
  • API_HASH : You can get this from https://my.telegram.org
  • USER_SESSION_STRING : Session string generated by running:
python3 generate_string_session.py

Leave other fields as it is.

Setting up config file by coping config-sample file to config file:

cp config_sample.env config.env

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 mirror-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

Deploying on Heroku using Termux:

  • Run the script to generate token file(token.pickle) for Google Drive:
python3 generate_drive_token.py
  • Install Heroku cli
  • Login into your heroku account with command:
heroku login
  • Create a new heroku app:
heroku create <appname>
  • Select This App in your Heroku-cli:
heroku git:remote -a <appname>
  • Change Dyno Stack to a Docker Container:
heroku stack:set container
  • Add Heroku Postgres (only if you are deploying it for the 1st time)
heroku addons:create heroku-postgresql
  • Add Private Credentials and Config Stuff:
git add -f credentials.json token.pickle config.env heroku.yml
  • Commit new changes:
git commit -m "Added Creds."
  • Push Code to Heroku:
git push heroku master --force
  • Restart Worker by these commands,You can Do it manually too in heroku.
  • For Turning off the Bot:
heroku ps:scale worker=0
  • For Turning on the Bot:
heroku ps:scale worker=1	 	

debiprasadxd-ddxd-mirror-bot's People

Contributors

debxd avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.