Skip to content

Simple Telegram Bot for downloading videos from Twitter via their links

Notifications You must be signed in to change notification settings

annihilatorrrr/Twideo

 
 

Repository files navigation

Twideo: Simple Telegram Bot for downloading videos from Twitter

Setting up your environment

  1. Download Rust.
  2. Create a new bot using @Botfather to get a token in the format 123456789:blablabla.
  3. Get an twitter access token.
  4. Optional Step: Install PostgreSQL database
  5. Install redis(for caching threads)
  6. initialize the TWITTER_BEARER_TOKEN, TWITTER_BEARER_TOKEN2(to handle too many requests per second), TELOXIDE_TOKEN and DATABASE_URL(optional) environmental variables:
# Unix-like
$ export TELOXIDE_TOKEN=<Your token here>
$ export TWITTER_BEARER_TOKEN=<Your bearer token here>
$ export TWITTER_BEARER_TOKEN2=<Your 2nd bearer token or just leave it blank>
$ export DATABASE_URL=<Your database url or ignore it>
$ export REDIS_URL=<Your redis url>

# Windows
$ set TELOXIDE_TOKEN=<Your token here>
$ set TWITTER_BEARER_TOKEN=<Your bearer token here>
$ set TWITTER_BEARER_TOKEN2=<Your 2nd bearer token or just leave it blank>
$ set DATABASE_URL=<Your database url or ignore it>
$ set REDIS_URL=<Your redis url>

You can rename `.env-template` file to `.env` and put your environmental variables there.
  1. Run cargo run and enjoy the life :)

Getting Started

Just copy the link of the tweet and send it to the bot, It will convert tweet to telegram message:

example

This bot also supports Inline mode:

inline-example

About

Simple Telegram Bot for downloading videos from Twitter via their links

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Rust 93.5%
  • Python 6.4%
  • Procfile 0.1%