Skip to content

Python Telegram Bot to download music from Deezer and YouTube (Heroku, Docker)

License

Notifications You must be signed in to change notification settings

kernoeb/Telegramusic

Repository files navigation

Telegramusic

A Python bot to download music from :

  • Deezer with Deezer API and Deezloader
  • YouTube

Deploy

Disclaimer

⚠️ For educational purposes only (or for free music)
Please don't use this for illegal stuff.
It's against Deezer's terms of service.

Information

You should probably use Docker way to install the bot, or follow the steps listed in the Dockerfile
You will have a upgraded version of youtube_dl which is really faster, and avoid the "FLAC issue" from the deezer download library.
These commands can be executed manually or in a script.

Translations

Your native language is not in the langs.json file ? Just make a pull request or pm me !

Usage

  • Get an arl cookie on Deezer for DEEZER_TOKEN (see this repo)
  • Create a bot on Telegram and grab a token with Bot Father (TELEGRAM_TOKEN)
  • Activate Inline Mode on BotFather for the bot you just created

Search for music in inline mode :

@xxxxxxx_bot (album|track|artist) <search>

image

image

or send a Deezer / YouTube link


Configuration

Docker

token.env

DEEZER_TOKEN=abcdefghijklmnoxxxxxxxxxxxx
TELEGRAM_TOKEN=123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ
BOT_LANG=fr

docker run -it -d --restart=always --env-file token.env --name telegram_music_bot telegram_music_bot


docker-compose.yml
(example)

services:
  worker:
    build: .
    restart: always
    env_file:
      - token.env     

Local usage

  • Add DEEZER_TOKEN and TELEGRAM_TOKEN as variable environment
  • python3.X -m pip install -r requirements.txt
  • python3.X main.py

(You should use a venv)