GithubHelp home page GithubHelp logo

notfounderror / gifvbot Goto Github PK

View Code? Open in Web Editor NEW

This project forked from au5ton/gifvbot

0.0 1.0 1.0 62 KB

:robot: Automatically converts large-ish .gif files sent in Telegram to a silent .mp4

Home Page: https://t.me/gifvbot

Python 86.90% Shell 13.10%

gifvbot's Introduction

codebeat badge

gifvbot

Automatically converts large-ish .gif files sent in Telegram to a silent .mp4. Also converts webm and mkv files (not playable natively) to mp4.

Context

In 2016, Telegram implemented a feature into their platform and clients that converts gif files into mp4 videos before sending them. However, very large gifs and user error will still let giant gif files slip through. To counteract this, this userbot will automatically recognize gifs that are sent as documents, encode them as mp4, and reply with an mp4-optimized gif. The "gifv" part refers to how Imgur refers to video alernatives to GIF.

Check out the live bot here: https://t.me/gifvbot

Demonstration

See demo video.

Requirements

  • Python 3.5+
  • FFmpeg installed and in PATH
  • Linux/macOS environment
  • A Telegram user account (can be separate from your primary account)

Running an instance

  • git clone https://github.com/au5ton/gifvbot.git
  • pip3 install -r requirements.txt
  • Make gif2mp4.sh executable: chmod u+x gif2mp4.sh
  • Make webm2mp4.sh executable: chmod u+x webm2mp4.sh
  • Register a new Telegram application
  • cp .env.example .env
  • Supply API ID and API Hash that was provided when registering your Telegram application by editing the .env file
  • Run the python script: python3 bot.py
  • Follow instructions to sign into a Telegram user account
  • The bot is now running

What is a userbot?

Although rare, a Telegram userbot is a type of Telegram bot that does not run from a Telegram bot account, but from a full user account. Telegram userbots are fully-fledged Telegram accounts. The only reason a Telegram bot would be made to be a userbot instead of a normal bot created by the BotFather is because of API limitations.

Why is gifvbot a userbot instead of a normal bot?

gifvbot is a userbot because the Telegram bot API limits attached documents to be downloaded at 20MB, which would defeat the purpose of downloading large gifs and converting them for convenience. The only solution was to make gifvbot a userbot.

gifvbot's People

Contributors

au5ton avatar imgbotapp avatar

Watchers

James Cloos 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.