Please don't use this for illegal stuff.
It's against Deezer's terms of service.
You should probably use Docker way to install the bot, or follow the steps listed in the Dockerfile.
As indicated in the Dockerfile there's a temporary patch to avoid the "FLAC issue" from the deezer download library,
and another one to allow downloading albums with more than 25 tracks.
Your native language is not in the langs.json
file ? Just make a pull request or pm me !
- Get an
arl
cookie on Deezer forDEEZER_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>
or send a Deezer / YouTube link
- Docker (Linux installation and Linux post-installation steps)
- Docker compose (should be included in the Docker installation)
Create a token.env
file with the following content, replacing the values with your own tokens :
DEEZER_TOKEN=abcdefghijklmnoxxxxxxxxxxxx
TELEGRAM_TOKEN=123456789:ABCDEFGHIJKLMNOPQRSTUVWXYZ
BOT_LANG=fr
./update.sh
Or manually :
git pull && docker-compose up -d --build
- Add
DEEZER_TOKEN
andTELEGRAM_TOKEN
as variable environment - python3.9 -m pip install -r requirements.txt
- python3.9 main.py
You should use a
venv
to avoid conflicts with your system python packages
You can send a zip file with multiple tracks inside, the bot will send you a zip file with all the tracks downloaded and the cover.
In the token.env
file, add the following line :
FORMAT=zip
If the zip
file is too big (more than 50MB), the bot will split the zip file into multiple parts.
You can also make the bot move a file to a specific directory and send you the download link.
In the token.env
file, add the following line :
FORMAT=zip
COPY_FILES_PATH=/path/to/your/directory
FILE_LINK_TEMPLATE=https://yourdomain.com/download/{0}
The {0}
will be replaced by the file name.
I recommend using a reverse proxy to serve the files, like Nginx or Caddy.
If you use Docker
, you can mount a volume to the container and set the COPY_FILES_PATH
to /files
, like this :
volumes:
- /path/to/your/directory:/files
If you have Deezer premium, you can allow the bot to download FLAC files by adding the following line in the token.env
file :
ENABLE_FLAC=1
"Sign in to confirm you’re not a bot. This helps protect our community. Learn more."
Please note that your account may be banned if you use this feature.
Add a cookies.txt
in ./local_resources
.
To generate this file, please see : https://github.com/yt-dlp/yt-dlp/wiki/FAQ#how-do-i-pass-cookies-to-yt-dlp.
You don't need to restart the bot, it will automatically reload the cookies when downloading a YouTube video.
# Global configuration
BOT_LANG=en
# Tokens
DEEZER_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
TELEGRAM_TOKEN=1234567890:ABCDEFghijklmnopqrstuvwxyz012345678
# Specific configuration
COPY_FILES_PATH=/files
FILE_LINK_TEMPLATE=https://example.com/dl/{0}
FORMAT=zip