How to Install and Set Up TTUtilities on $user
Author: Owen Macasu and Roel Cabante
Created on: October 28, 2024
Install these two packages: pip3
and unzip
.
sudo apt install python3-pip
sudo apt install unzip
The user example for this tutorial is: bot
.
- Log in to your terminal with
sudo
or root privileges. - Create a user for another instance of this bot by typing:
adduser bot
- Add the user bot to the
sudo
group by typing:usermod -aG sudo bot
- Add the user bot to the systemd profile by typing:
loginctl enable-linger bot
- Log in now as the user you created (for example,
bot
). - Download TTUtilities by typing this command:
wget https://blindmasters.org/TTUtilities/TTUtilities-linux.zip
- Extract the downloaded file:
unzip TTUtilities-linux.zip
- Change to the extracted directory by running:
cd TTUtilities-linux
- Set up a virtual environment by running this command:
python3 -m venv venv
- Activate the virtual environment by running:
source venv/bin/activate
- Install the bot’s requirements by running:
pip3 install -r requirements.txt --upgrade
- Make
setup.sh
executable by running:chmod +x setup.sh
- Run
setup.sh
to complete the bot configuration. - Run the bot after installing all requirements. Do not close the terminal. You should search for a video to allow the bot to log in to your account. Use the command
/p
. This will not play anything on the first run; instead, you’ll see “yt-dlp” prompting you to go to the following link to add a new device: https://www.google.com/device. You should also see a code that you need to enter in your browser to complete the sign-in. - Close the terminal and log in again using the username you created (for example,
bot
). - Go to the
.config
folder by typing:cd ~/.config/
- Make a directory for
systemd/user
by typing:mkdir -p systemd/user/
- Using any SFTP client like FileZilla, upload
pulseaudio.service
andpulseaudio.socket
. - Create a new file by typing:
nano .config/systemd/user/TTUtilities.service
- The service file should look like this. Edit it based on your preferences, but this time the username is bot:
[Unit] Description=TTUtilities bot for TeamTalk [Service] Type=simple ExecStart=/home/bot/linux/venv/bin/python /home/bot/linux/TTUtilities.py Restart=on-failure Environment="CONFIG_FILE=/home/bot/linux/config.ini" WorkingDirectory=/home/bot/linux/ StandardOutput=syslog StandardError=syslog [Install] WantedBy=default.target
- Enable and start the bot by running these two commands separately:
systemctl --user enable TTUtilities.service systemctl --user start TTUtilities.service
That’s all! Enjoy!