Coder Social home page Coder Social logo

tele-vdo-rider's Introduction

Tube Telegram Rider

GitHub license Twitter Follow

Telegram Bot ๐Ÿค– to convert videos to mp3 at your service. It uses youtube-dl so videos from any supported websites can be used.

โœ… Support Youtube playlists along with a number of other websites.

โœ… Convert to the best possible audio track

โœ… Work around Telegram size limitation by chunking large MP3 files

Clone project

git clone https://github.com/namuan/tele-vdo-rider.git

Running it locally

To run it, you'll need to create a new bot using @botfather. Note down the bot token once your bot is registered. Copy env.cfg.sample to env.cfg and set the token value for TELEGRAM_BOT_TOKEN variable.

cp env.cfg.sample env.cfg

Then we'll setup a local python virtual environment and install required dependencies. Make sure you have python3 installed before running the following command.

make setup

We also need to set up ffmpeg which is used to convert Video -> MP3. On a mac, it is a single command using brew.

brew install ffmpeg

You'll find instructions to set up on other platforms.

Next, run the bot

make run

If previous commands worked then this will start the bot. Try adding your new bot on Telegram and send a youtube video.

Here is a good one to try. The first 20 hours -- how to learn anything | Josh Kaufman | TEDxCSU

Self-Hosting

Although running locally is fine for testing, you may want to run it in background to avoid any disruptions. Here is a quick guide for setting it up on a VPS or RaspberryPi (Once you get past installing ffmpeg on it ๐Ÿ˜ก).

Step 1: Setup VPS or use existing server(Raspberry Pi) Start a new VPS with Ubuntu on Vultr (Affiliate Link) or DigitalOcean (Affiliate Link).

โ˜•๏ธ Wait for it to come up online.

๐Ÿงน Remember: Clean up - Make sure you delete this server if not used to avoid incurring cost.

Step 2: Checking connectivity

Once you have the server running, we'll try to connect to it. It is better to set up a dedicated host entry as below. Some commands in the Makefile assumes that the host entry matches the project directory.

๐Ÿ‘‰ Tip: Splitting SSH Config - I used to use poet to split ssh files but from OpenSSH 7.3 it supports the Include directive to allow multiple ssh config files. It makes it easy and manageable for working with many SSH entries

Host tele-vdo-rider
	User root
	HostName xx.xx.xx.xx
	Port 22
	IdentitiesOnly yes
	IdentityFile ~/.ssh/dfiles

So if you have the above entry under ~/.ssh, running the following command will try to connect and ssh into the server.

$ make ssh

Make sure this works before continuing, and note that you may have to enter the Password from the VPS provider (Vultr/DigitalOcean).

Step 3: Installing dependencies

We also need to install a few dependencies if they are missing from the server. The following command will take care of that.

# ssh into server
$ make server

Step 4: Starting up Bot

Again, we'll use the make command to start the bot in a screen session.

make start

The bot is running once the command finishes. Try sending another Youtube video to see it in action.

Step 5: Testing if Bot is running

If there is anything wrong, you can see what is going on the server.

# ssh
make ssh

# check screen sessions
screen -ls

# attach to existing screen session
screen -x tele-vdo-rider

# detach from a session
Ctrl + A then D

Make sure that you detach from screen session before leaving the server to keep the bot running.

Step 6: [Optional] Updating Bot

Run the following command from your local machine, and it should update the bot and restart the session automatically.

make start

Credits

License

See LICENSE

tele-vdo-rider's People

Contributors

namuan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tele-vdo-rider's Issues

increase data transfer

Hello, how to increase transfer.
when downloading more than 60Mb, i got a message "File too big to transfer. Copy with FTP/SFTP"

Thanks in advance.

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.