Telegram-Spotdl-Bot/README.md

60 lines
1.5 KiB
Markdown
Raw Normal View History

2023-11-13 22:53:03 -05:00
# Set Up Guide
2023-11-13 22:54:04 -05:00
1. Create a python virtual environment
2023-11-13 22:49:36 -05:00
2023-11-13 22:48:01 -05:00
`python3 -m venv /absolute/path/to/venv`
2023-11-13 22:50:04 -05:00
2023-11-13 22:54:04 -05:00
2. Install depends in venv
2023-11-13 22:49:36 -05:00
2023-11-13 22:48:01 -05:00
`/absolute/path/to/venv/bin/pip install spotdl`
2023-11-13 22:53:03 -05:00
2023-11-13 22:48:01 -05:00
`/absolute/path/to/venv/bin/pip install python-telegram-bot`
2023-11-13 22:49:36 -05:00
2023-11-13 22:54:04 -05:00
2b. 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.
2023-11-13 22:53:03 -05:00
2023-11-13 22:48:01 -05:00
`/absolute/path/to/venv/bin/pip install python-telegram-bot==4.14.0`
2023-11-13 22:49:36 -05:00
2023-11-13 22:54:04 -05:00
3. Edit start.py with correct telegram API token and change directories variables.
2023-11-13 22:48:01 -05:00
2023-11-13 22:54:04 -05:00
4. Start the script
2023-11-13 22:48:01 -05:00
`/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
```
2023-11-13 22:53:03 -05:00
## Start Script
2023-11-13 22:48:01 -05:00
```
#!/bin/bash
/absolute/path/to/venv/bin/python /absolute/path/to/start.py
exit
```
2023-11-13 23:03:18 -05:00
# Usage
1. Private message your bot.
2. Type `/start` in the PM
3. It will ask you for an artist name. It **NEEDS** to be excatly as you see it on the artists spotify page. The bot uses this as the directory name it downloads the music into.
4. The bot will ask for the artist url. It will look something like this `https://open.spotify.com/artist/lajs7ahska91187skas`
5. Wait, the bot will let you know when it's done and ready for another artist.
## Useful Links
2023-11-13 22:48:01 -05:00
https://github.com/eternnoir/pyTelegramBotAPI