54 lines
1.1 KiB
Markdown
54 lines
1.1 KiB
Markdown
# Set Up Guide
|
|
1. Create a working dir
|
|
|
|
`mkdir /absolute/path/to/`
|
|
|
|
3. Create a python virtual environment
|
|
|
|
`python3 -m venv /absolute/path/to/venv`
|
|
|
|
5. Install depends in venv
|
|
|
|
`/absolute/path/to/venv/bin/pip install spotdl`
|
|
|
|
`/absolute/path/to/venv/bin/pip install python-telegram-bot`
|
|
|
|
5b. This script was written with version 4.14.0 of the python-telegram-bot. If something goes wrong you can install that spcific version using this command.
|
|
|
|
`/absolute/path/to/venv/bin/pip install python-telegram-bot==4.14.0`
|
|
|
|
6. Edit start.py with correct telegram API token and change directories variables.
|
|
|
|
7. 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
|
|
```
|
|
|
|
## useful links
|
|
https://github.com/eternnoir/pyTelegramBotAPI
|