Skip to main content
Telegram Bot MIT License Documentation Status PyPI Version GitHub Actions Build Status GitHub Actions CodeQL Status DeepSource Active Issues DeepSource Resolved Issues Code Climate Issue Count Codacy Build Status Codebeat Quality CodeFactor

Telegram Bot for downloading MP3 rips of tracks/sets from SoundCloud, Bandcamp, YouTube with tags and artwork.

scdlbot Usage in Telegram

Send /start or /help command to bot or refer directly to the help message.

Please report all bugs and issues and suggest your improvements to issues.

Supported sites and mainly used packages

scdlbot is standing on the shoulders of giants:

Run your own scdlbot

Installation & Configuration

Requirements

Those should be available in your PATH:

…or get unstable from Git source repository

git clone https://github.com/gpchelkin/scdlbot.git
cd scdlbot
pip3 install --requirement requirements.txt

# Update:
git pull
pip3 install --requirement requirements.txt

Configure Bot

Download or copy configuration file sample and set up config environment variables in it:

# If you've installed from PyPI - download sample config somewhere:
curl -o .env https://raw.githubusercontent.com/gpchelkin/scdlbot/master/.env.sample

# If you've got Git source - just copy sample config:
cp .env.sample .env

# Use your favourite editor. Sample config is self-documented:
nano .env

Telegram Bot Settings

Send the commands from respective filenames in telegram_settings dir to @BotFather, choose your bot and copy corresponding values in order to use the bot conveniently. Disable privacy mode if you want bot to read and check every message in group for links. Otherwise, it would work only for commands.

Running Locally or at Dedicated Server

Using Heroku Local (preferred)

You will need Heroku CLI installed.

# If you've installed from PyPI - download Procfile first (otherwise already present in Git repository):
curl -O https://raw.githubusercontent.com/gpchelkin/scdlbot/master/Procfile

# For long polling mode (when WEBHOOK_ENABLE=0):
heroku local -e .env worker
# For webhook mode (when WEBHOOK_ENABLE=1):
heroku local -e .env web

Using Python only

export $(grep -v '^#' .env | xargs)
python3 -m scdlbot
# or in one line:
env $(grep -v '^#' .env | xargs) python3 -m scdlbot

# If you've installed package from PyPI into the system,
# you can also replace 'python3 -m scdlbot' with only 'scdlbot'

Deploying to Heroku

Deploy

Register on Heroku, press the button above and configure variables for deploying. When app is deployed you must set only one dyno working on “Resources” tab in your app settings depending on which way of getting updates you have chosen and set in config variables: worker for polling or web for webhook.

Manually

You can do the same as the button above but using Heroku CLI, not as much of a fun. Assuming you are in scdlbot repository directory:

heroku login
# Create app with Python 3 buildpack and set it for upcoming builds:
heroku create --buildpack heroku/python
heroku buildpacks:set heroku/python
# Add FFmpeg buildpack needed for youtube-dl & scdl:
heroku buildpacks:add --index 1 https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest.git --app scdlbot
# Deploy app to Heroku:
git push heroku master
# Set config vars automatically from your local .env file
heroku plugins:install heroku-config
heroku config:push
# Or set them manually:
heroku config:set TG_BOT_TOKEN="<TG_BOT_TOKEN>" STORE_CHAT_ID="<STORE_CHAT_ID>" ...

If you use webhook, start web dyno and stop worker dyno:

heroku ps:scale web=1 worker=0
heroku ps:stop worker

If you use polling, start worker dyno and stop web dyno:

heroku ps:scale worker=1 web=0
heroku ps:stop web

Some useful commands:

# Attach to logs:
heroku logs -t
# Test run ffprobe
heroku run "ffprobe -version"

Deploying to Dokku

Use Dokku (your own Heroku) installed on your own server. App is tested and fully ready for deployment with polling (no webhook yet). https://github.com/dokku/dokku-letsencrypt

export DOKKU=<your_dokku_server>
scp .env $DOKKU:~
ssh $DOKKU
    export DOKKU=<your_dokku_server>
    dokku apps:create scdlbot
    dokku certs:generate scdlbot scdlbot.$DOKKU
    dokku config:set scdlbot $(cat .env | xargs)
    logout
git remote add dokku dokku@$DOKKU:scdlbot
git push dokku master
ssh $DOKKU
    dokku ps:scale scdlbot worker=1 web=0
    dokku ps:restart scdlbot

Release files for scdlbot 0.15.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scdlbot 0.15.0
File Size Uploaded
scdlbot-0.15.0.tar.gz 33.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scdlbot 0.15.0
File Interpreter ABI Platform
scdlbot-0.15.0-py3-none-any.whl Python 3 none any Details

Total release size: 70.4 kB

Release files / scdlbot-0.15.0.tar.gz

Download URL scdlbot-0.15.0.tar.gz
Size 33.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9372dfb0741b28c07db8742ef37dc57ef5f42feedba6ec87cdef01e2f077f7e0
BLAKE2b-256 checksum
How to use checksums
c770da9c61ddf45d80754120ba00a13ec00e166335adee728158eee76ffdd67c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.2 Linux/5.15.0-1033-azure

Release files / scdlbot-0.15.0-py3-none-any.whl

Download URL scdlbot-0.15.0-py3-none-any.whl
Size 36.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d3053d2eeaf61f11cce588cb5e008313cf67b06d6cc28dfd55855b85513f7249
BLAKE2b-256 checksum
How to use checksums
6f3aea5b5482a79177cc400f2cd5d36a2a0fea80fd1982fada00f1162d61ed8d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.3.2 CPython/3.11.2 Linux/5.15.0-1033-azure

Release history Release notifications | RSS feed

This release

0.15.0 This release

2 release files

0.14.2

2 release files

0.14.1

2 release files

0.14.0

2 release files

0.13.4

2 release files

0.13.3

2 release files

0.13.2

2 release files

0.13.0

2 release files

0.12.2

2 release files

0.12.1

2 release files

0.12.0

2 release files

0.11.0

2 release files

0.9.26

2 release files

0.9.24

2 release files

0.9.23

2 release files

0.9.22

2 release files

0.9.21

2 release files

0.9.20

2 release files

0.9.17

2 release files

0.9.14

2 release files

0.9.13

2 release files

0.9.12

2 release files

0.9.11

2 release files

0.9.10

2 release files

0.9.9

2 release files

0.9.8

2 release files

0.9.7

2 release files

0.9.6

2 release files

0.9.5

2 release files

0.9.4

2 release files

0.9.2

2 release files

0.9.1

2 release files

0.9.0

2 release files

0.8.3

2 release files

0.8.2

2 release files

0.8.1

2 release files

0.8.0

2 release files

0.7.9

2 release files

0.7.8

2 release files

0.7.7

2 release files

0.7.6

2 release files

0.7.5

2 release files

0.7.4

2 release files

0.7.3

2 release files

0.7.2

2 release files

0.7.1

2 release files

0.6.3

2 release files

0.6.2

2 release files

0.6.1

2 release files

0.6.0

2 release files

0.5.2

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.0

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page