Go to file
Clay 9fd80a272d first commit 2023-11-13 22:48:01 -05:00
README.md first commit 2023-11-13 22:48:01 -05:00
start.py first commit 2023-11-13 22:48:01 -05:00

README.md

  1. Create a working dir mkdir /absolute/path/to/
  2. Create a python virtual environment python3 -m venv /absolute/path/to/venv
  3. Install depends in venv /absolute/path/to/venv/bin/pip install spotdl /absolute/path/to/venv/bin/pip install python-telegram-bot script was written with version 4.14.0 /absolute/path/to/venv/bin/pip install python-telegram-bot==4.14.0
  4. Edit start.py with correct telegram API token and change directories

start the script /absolute/path/to/venv/bin/python start.py

Unit file

[Unit]
Description=tg_spotdl
After=network-online.target

[Service]
User=clay
ExecStart=/absolute/path/to/venv/bin/python /absolute/path/to/start.py
Restart=always
RestartSec=5s
RuntimeMaxSec=12h

[Install]
WantedBy=multi-user.target

start script

#!/bin/bash
/absolute/path/to/venv/bin/python /absolute/path/to/start.py
exit

https://github.com/eternnoir/pyTelegramBotAPI