Coder Social home page Coder Social logo

uakbr / kuebikobot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sahilkr24/kuebikobot

1.0 0.0 0.0 60 KB

A telegram bot that deploys to heroku/aws and downloads links and torrents and uploads to google drive and returns public share link.

License: MIT License

Python 97.37% Shell 1.11% Dockerfile 1.52%

kuebikobot's Introduction

Bot logo

kuebiko bot

Status Platform GitHub Issues GitHub Pull Requests License


๐Ÿค– A telegram bot that deploys to heroku and downloads links and torrents and uploads to google drive and returns public share link.

๐Ÿ“ Table of Contents

๐Ÿง About

This bot is written in python and imports aria2 for downloading files and magnet links and uploads to google drive via drive-cli then returns direct download/share link with visibility set to public for easy sharing.

This bot is asynchronous and also has pause and cancel buttons of easy management of downloads.

๐ŸŽฅ Demo / Working

Working

Will be updated shortly!

๐Ÿ’ญ How it works

The bot first extracts the link from the the command it's called from and then adds it to aria2 cli via webhooks, after that it will show progress every 2 seconds in form of message updates.

Once the download completes it will then proceed to upload the file/folder using predefined scripts that will then return the shared link in form of a reply to the original message.

The entire bot is written in Python 3.7

๐ŸŽˆ Usage

To use the bot, type:

/help

or

/start (personal message only)

All commands, i.e. "/help" are not case sensitive.

The bot will then give you the help context menu.

Start:

/help Response:

/mirror :for http(s),ftp and file downloads

/magnet :for torrent magnet links

/cancel :cancel all in progress downloads

/list :get a list of downloads

use these commands along with your link or magnets.

Example:

/mirror https://releases.ubuntu.com/20.04/ubuntu-20.04.1-desktop-amd64.iso

Response:

Mirror, [14.08.20 19:57]
[In reply to Sahil]
Downloading
'ubuntu-20.04.1-desktop-amd64.iso'
Progress : 17.62/2656.00 MBs
at 33.53 MBps
[--------------------] 0.7 %

Mirror, [14.08.20 19:59]
[In reply to Sahil]
https://drive.google.com/open?id=<- id of the file ->

Mirror, [14.08.20 19:59]
Upload complete


Beep boop. I am a bot. If there are any issues, contact at my GitHub

Want to make a similar bot? Check out: GitHub

๐Ÿ Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on heroku.

Prerequisites

All the prerequisites are mentioned in the requirements.txt. Additionally, you'll need to install aria2c on your linux machine if you want to run a local version. You'll also need to get google credentials for the google drive via API dashboard from google developers console.

aria2c
credentials.json
bot id from bot father (telegram)

Installing

First, copy the credentials.json in the root directory and update the bot id in bot.py at line 14.

Switch to venv and install all the requirements from requirements.txt

run python3 bot.py

When you run for the first time, it will ask you to authorise or refresh token for drive using local web server, follow the link from terminal and open in any web browser. After authenticating copy back the access code to cli. This will create token.json which is importantand should be kept securely.

That's it. The bot should send a bot started message on the channels it addded to verifying it's active.

You're bot is now ready to use. Yay!

๐Ÿš€ Deploying your own bot

To deploy your bot on heroku, please follow the above steps and then procced below: Procfile and and other settings have already been added as per needs.

Push the repo to your local github and set up a deployment in heroku. Add the following buildpacks under Settings > Buildpacks heroku/python
https://github.com/amivin/aria2-heroku.git the second buildpack will ensure that aria is installed on the dyno on which the bot will run.

After that deploy your branch and if everything is correctly configured, the bot will reply with bot started message in the channels.

โ›๏ธ Built Using

  • python-telegram-bot - This library provides a pure Python interface for the Telegram Bot API.
  • Heroku - SaaS hosting platform
  • aria2p - Command-line tool and library to interact with an aria2c daemon process with JSON-RPC.
  • aria2c - aria2 is a lightweight multi-protocol & multi-source, cross platform download utility operated in command-line.
  • pydrive - Google Drive API made easy.

โœ๏ธ Authors

See also the list of contributors who participated in this project.

kuebikobot's People

Contributors

dependabot[bot] avatar rkrohk avatar sahilkr24 avatar

Stargazers

 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.