Giter Site home page Giter Site logo

gumerov-amir / ttmediabot Goto Github PK

View Code? Open in Web Editor NEW
57.0 25.0 63.0 697 KB

A bot for music streaming to TeamTalk Servers.

Home Page: https://ttmediabot.ru

License: MIT License

Python 99.67% Shell 0.08% Dockerfile 0.25%
python python3 teamtalk5 audio-streaming youtube-search youtube-dl youtube-downloader youtube-player vk vkontakte

ttmediabot's Introduction

TTMediaBot

A media streaming bot for TeamTalk.

Installation and usage

Requirements

  • To use the bot, you need to install Python 3.7 or later;
  • The bot requires the TeamTalk SDK component to be downloaded using the integrated tool from the command line. In order to download and extract the mentioned component, on Linux, you need to install p7zip or p7zip-full, or if you want to run the bot on Windows, 7Zip must be installed;
  • If you are going to use Linux as your main system for a bot, you will need pulseaudio and libmpv to route and play audio, but if you re using Windows, PulseAudio is not available, so you will need a virtual audio cable driver, such as VBCable and of course, the mpv player library must also be installed. on Windows this library can be installed using an integrated tool. On Debian-based systems the required package is libmpv1.

Installation

  • Download TTMediaBot;
  • install all python requirements from requirements.txt, using the "pip3 install -r requirements.txt" or just "pip install -r requirements.txt" command, without quotes;;
  • Run ttsdk_downloader.py from the tools folder;
  • If you're using Windows run libmpv_win_downloader.py from the tools folder;
  • Copy or rename config_default.json to config.json;
  • Fill in all required fields in config.json (Config description will be there later);
  • On Linux run TTMediaBot.sh --devices to list all available devices and their numbers;
  • On Windows run TTMediaBot.py --devices to list all available devices with their numbers;
  • Edit config.json (change device numbers appropriately for your purposes);

Usage

  • On Linux run ./TTMediaBot.sh;
  • On Windows run python TTMediaBot.py directly.

Running in Docker

You can also run the bot in a Docker container. First of all, You should build an image from the provided Dockerfile:

docker build -t ttmediabot .

Note: The first run could take some time.

Then you can run the Docker container with the following command:

docker run --rm --name ttmb_1 -dv <path/to/data/directory>:/home/ttbot/data ttmediabot

<path/to/data/directory> here means a directory where config.json file will be stored. It should not contain any other unrelated data. The cache and log files will be stored in the specified directory.

Startup options

  • --devices - Shows the list of all available input and output audio devices;
  • -c PATH - Sets the path to the configuration file.

Config file options

  • language - Sets the bot's interface language. Warning! to select a language you need an appropriate language folder inside the "locale" folder;
  • sound devices - Here you have to enter audio device numbers. Devices should be connected to each other (like Virtual audio cable or pulseaudio);
  • player - This section sets the configuration for the player such as default volume, maximum volume, etc;
  • teamtalk - here are main options for bot to connect and login to your TeamTalk server;
  • Services - Here you should configure available services for music search and playback;
  • logger - Here you can configure various logging related options.

Pulse audio or VB cable settings

Linux variant

  • Install pulseaudio.
  • type $pulseaudio --start
  • Next command creates null sink and this sink can be monitored by default pulse input device. $pacmd load-module module-null-sink
  • then run ./TTMediaBot.sh --devices and check its numbers. output should be null audio output, input should be pulse.
  • put this numbers to your config.json.

windows variant

  • install VB-cable, run "TTMediaBot.py --devices" and check numbers of VB-cable devices
  • put this numbers to your config.json.

Some notes about the Windows variant

  • When listing input and output devices in the Windows variant of TTMediaBot, please note, that the input device will be doubled, i.e., if the output device is line 1 with number 3, the input device for line 1 will be listed twice, at number 5 and, for example, at number 7.
  • The correct number will be the last one as input, that is, if we selected the output as line 1 with the number 3, the input device would be line 1 with number 7 of the two options, number 5 and number 7.
  • The same method applies to all numbers and all Input / Outputs.

support us

contacts

ttmediabot's People

Contributors

a11cf0 avatar beqabeqa473 avatar cyrmax avatar destranis avatar draganratkovich avatar grishakonzalaev avatar gumerov-amir avatar ivnc avatar kirill-jjj avatar rafaelfernandesbr avatar rexyamr avatar techexplorers123 avatar yukie-nobuharu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ttmediabot's Issues

Setting up on Ubuntu 16

Hello, I asume this bot works best on debian based distros. But, how i can install this bot to Ubuntu 16? I successfully ran it on 20.04 but, couldn't manage on 16.004. What do i need to install it? Thank you.

can type commands in oter channels

hello, it is a error, is there something i'm doing wrong? for example im on oter channel, and can disturb oters doing comands in a bot that are not in my channel.

Translation System

Hey all. I have a question here about translation system. May I know how can I get an empty translation string to translate the bot? I have try to use "import from source" method from poedit and it didn't return any string for me to translate. I also have try the CMD method using gettext tools that come with python as well. Same thing happend, nothing has been return for me to translate. May I know the exact way to do it? Thanks.

Ability to process the linked channel by default in the TeamTalk account.

Hello. I propose to implement a feature that will allow you to receive a default channel from the TeamTalk server in your account. This will allow you to change channel passwords without hindrance, without involving an administrator to edit the configuration file. And it will also avoid the moment when users change their password without warning, and as a result TTMediaBot cannot join the channel. Thanks.

VK API error when running the bot

Hi there,

I've gone ahead and used a GitHub script that allows creating API's for VK using my account, however, I can't seem to be able to use it after running the bot, with the following error:

ERROR [2021-11-02 12:54:11,033]: [8] Invalid request: versions below 5.81 are deprecated. Version param should be passed as "v". "version" param is invalid and not supported. For more information go to https://vk.com/dev/constant_version_up

What do I do in this case, where do I get the newer API? I tried their website but I can't find a way to get it directly from there.

Thanks.

Add ability to process youtube links with time signature

Youtube has ability to copy video link with timestamp parameter.
When you open such link in browser or youtube application, video automatically fastforwards to the given time in seconds.
Would be nice if TTMediaBot could parse such links with timestamp.

problem runnint TTMediaBot on docker

hello,
i'm not so experient in docker, just following readme
i run:
docker build -t ttmediabot .
docker run --rm --name ttmb_1 -dv root/TTMediaBot2:/home/ttbot/data ttmediabot
the folder TTMediaBot2 has 0 files just copied my config.json.
the docker builds, but not runs. just apears some random leters and numbers, but not epaers to run, bot not enter in my server. what i am doing wrong? thanks!

error in ubuntu 20, can't play from youtube

hello developer, i was try run this bot on ubuntu 20, but, if i use youtube services, i goting error like this:

INFO [2021-09-10 23:42:13,543]: New message p jakarta from Leon Scott Kennedy in MainThread file: init.py line 52 function run
ERROR [2021-08-19 23:42:14,393]: ERROR: vLeDFO-zeYI: YouTube said: Unable to extract video data in MainThread file: YoutubeDL.py line 523 function to_stderr
ERROR [2021-08-19 23:42:14,393]: in MainThread file: init.py line 79 function call
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 797, in extract_info
ie_result = ie.extract(url)
File "/usr/lib/python3/dist-packages/youtube_dl/extractor/common.py", line 530, in extract
ie_result = self._real_extract(url)
File "/usr/lib/python3/dist-packages/youtube_dl/extractor/youtube.py", line 1788, in _real_extract
raise ExtractorError(
youtube_dl.utils.ExtractorError: vLeDFO-zeYI: YouTube said: Unable to extract video data

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/root/TTMediaBot-2.0/bot/commands/init.py", line 71, in call
return command(arg, message.user)
File "/root/TTMediaBot-2.0/bot/commands/user_commands.py", line 37, in call
self.player.play(track_list)
File "/root/TTMediaBot-2.0/bot/player/init.py", line 58, in play
self._play(self.track.url)
File "/root/TTMediaBot-2.0/bot/player/track.py", line 27, in url
self._fetch_stream_data()
File "/root/TTMediaBot-2.0/bot/player/track.py", line 18, in _fetch_stream_data
track = self.service.get(self._url, extra_info=self.extra_info)[0]
File "/root/TTMediaBot-2.0/bot/services/yt.py", line 28, in get
info = ydl.extract_info(url, process=False)
File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 820, in extract_info
self.report_error(compat_str(e), e.format_traceback())
File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 625, in report_error
self.trouble(error_message, tb)
File "/usr/lib/python3/dist-packages/youtube_dl/YoutubeDL.py", line 595, in trouble
raise DownloadError(message, exc_info)
youtube_dl.utils.DownloadError: ERROR: vLeDFO-zeYI: YouTube said: Unable to extract video data
INFO [2021-08-19 23:42:14,399]: replied Error: ERROR: vLeDFO-zeYI: YouTube said: Unable to extract video data in MainThread file: init.py line 54 function run
ERROR [2021-08-19 23:42:14,421]: ERROR: vLeDFO-zeYI: YouTube said: Unable to extract video data in TTPlayerConnector file: YoutubeDL.py line 523 function to_stderr
ERROR [2021-08-19 23:42:14,795]: ERROR: vLeDFO-zeYI: YouTube said: Unable to extract video data in TTPlayerConnector file: YoutubeDL.py line 523 function to_stderr
ERROR [2021-08-19 23:42:15,256]: ERROR: vLeDFO-zeYI: YouTube said: Unable to extract video data in TTPlayerConnector file: YoutubeDL.py line 523 function to_stderr

About TeamTalkSDK

I was looking at the new versions of TeamTalkSDK, and the library was all refactored in version 8.12. The problem that I couldn't run it on TTMediaBOT, because of the acertion errors.
I would like to hear from the developers, if they intend to switch to this SDK or if they will continue on TeamTalkSDK 5.8.
I suggest that if they are going to continue in TeamTalk 5.8, that TTMediaBOT distributes its own TeamTalkSDK, as it has no way of implementing the missing functions of the library, such as _DoMoveUser, as they will be refused by BearWare, since they are too old.

Problems using pulseaudio

Hi there,
Whenever I start pulseaudio and load (pacmd load-module module-null-sink) on a non-root-user, it gives me no error but it also don't shows the pulse audio devices. I already reinstalled pulseaudio and libmpv1. Thanks for help.

Bot connects but get a database error if I send commands.

I've gotten the bot to connect to my server, but if I try to send any commands, I get the following error.
ERROR [2022-04-02 19:48:31,907]: [5] User authorization failed: no access_token passed. in MainThread file: vk.py line 69 function initialize
INFO [2022-04-02 19:48:33,622]: Started in MainThread file: init.py line 89 function run
INFO [2022-04-02 19:49:12,572]: New message h from username in MainThread file: init.py line 94 function run
ERROR [2022-04-02 19:49:12,572]: in Thread-4 file: init.py line 110 function run
Traceback (most recent call last):
File "C:\Users\username\Downloads\git\TTMediaBot\bot\commands_init
.py", line 95, in run
self.ttclient.send_message(
File "C:\Users\username\Downloads\git\TTMediaBot\bot\TeamTalk_init
.py", line 156, in send_message
message = TeamTalkPy.TextMessage()
File "C:\Users\username\Downloads\git\TTMediaBot\TeamTalkPy\TeamTalk5.py", line 727, in init
assert(DBG_SIZEOF(TTType.TEXTMESSAGE) == ctypes.sizeof(TextMessage))
AssertionError

a bug when the bot enter ina tt5Srv in ubuntu:

hy guys. how are you? well, i'm trying to use this bot and i can't. i follow the instructions as here in gitup, but i can't get the correct funcion of the bot. how can i do it?

INFO [2022-04-08 01:28:40,566]: Started in MainThread file: init.py line 89 function run
INFO [2022-04-08 01:28:55,621]: New message h from sanagui in MainThread file: init.py line 94 function run
ERROR [2022-04-08 01:28:55,623]: in Thread-4 file: init.py line 110 function _run
Traceback (most recent call last):
File "/home/music/TTMediaBot/bot/commands/init.py", line 95, in _run
self.ttclient.send_message(
File "/home/music/TTMediaBot/bot/TeamTalk/init.py", line 156, in send_message
message = TeamTalkPy.TextMessage()
File "/home/music/TTMediaBot/TeamTalkPy/TeamTalk5.py", line 727, in init
assert(DBG_SIZEOF(TTType.TEXTMESSAGE) == ctypes.sizeof(TextMessage))
AssertionError

Changing Download Format and startup script

Hello, I have a few problems and a question. How i can change file format of uploaded file to tt server? It's m4a and i want to make it mp3. Other problem is, could you say log levels of TTMediaBot? It doesn't accept info level and gives lots of tracebacks. Also, how i can set this bot to run at startup with systemd?

Extreme CPU usage caused by TeamTalk SDK update to 5.15

Since TeamTalk SDK was updated to 5.15, the bot causes a extreme & rising CPU load in the system, causing audio micro-cuts to the bot and performance problems for other services in the machine.
I've tried to downgrade all components except ttsdk and the problem persists. It can only be resolved downgrading the TeamTalk SDK to 5.8.1.
With 5.15 I have seen CPU usage values of up to 60 by the process running the bot, while with 5.8.1 it remains at 4/5 with eventual peaks, especially after startup, of 10/11. With 5.15 it starts at 10/11 as well, but keeps constantly rising.
If there are various bot instances running in the same machine this situation can cause a heavy CPU load and serious performance issues to the whole machine and the services it hosts.
I'm running Centos 7 (7.9.2009) with Docker 26.1.1, build 4cf5afa. I've also tested the new dockerfile in docker-behavior-improvements and the issue is still reproducible, the problem is apparently in the ttsdk.

Logging error and, maby mpv problem.

Good day devs.
the following error has occurred. so, we can't get a log.
Note: we are using debian10.
and, we'll send more logs because, we also noticed, when it's been open for a long time, the application crashed.
here is the errors:
Exception inside python-mpv event loop:
Traceback (most recent call last):
File "/opt/TTMediaBot/mpv.py", line 872, in _loop
self._log_handler(ev['level'], ev['prefix'], ev['text'])
File "/opt/TTMediaBot/bot/player/init.py", line 208, in log_handler
logging.log(level, "{}: {}: {}".format(level, component, message))
File "/usr/lib/python3.9/logging/init.py", line 2113, in log
root.log(level, msg, *args, **kwargs)
File "/usr/lib/python3.9/logging/init.py", line 1504, in log
raise TypeError("level must be an integer")
TypeError: level must be an integer
Exception inside python-mpv event loop:
Traceback (most recent call last):
File "/opt/TTMediaBot/mpv.py", line 872, in _loop
self._log_handler(ev['level'], ev['prefix'], ev['text'])
File "/opt/TTMediaBot/bot/player/init.py", line 208, in log_handler
logging.log(level, "{}: {}: {}".format(level, component, message))
File "/usr/lib/python3.9/logging/init.py", line 2113, in log
root.log(level, msg, *args, **kwargs)
File "/usr/lib/python3.9/logging/init.py", line 1504, in log
raise TypeError("level must be an integer")
TypeError: level must be an integer

Add a language changing option for bot admins

@gumerov-amir I have officially started translating this bot into Azerbaijani, Georgian and Turkish languages.
It would be great, if it was possible to change the language of the bot with administrator rights so that more users, depending on their language, can fully use the bot.
Depending on the name of the language, for example: ka, en, etc., the Bot will load a file of a specific language and display the interface in that language.

Error on Ubuntu 20.04 Server

I'm trying to get this to run on my Ubuntu 20.04 LTS VPS. I followed the instructions and it logs into the server, but it won't play anything. When I run it, I get this message as part of the output.
ERROR [2021-11-29 19:05:30,398]: [5] User authorization failed: no access_token
passed. in MainThread file: vk.py line 30 function initialize
INFO [2021-11-29 19:05:30,399]: Started in MainThread file: init.py line 47
function run

I've been told you have to activate some sort of trial for the SDK, but I can't find any documentation in this repo. What am I doing wrong?

TTMediaBot will Fall back to Empty Status With The Mail Gender Set

Hey there! I just download the latest TTMediaBot that was updated yesterday. This update was fix the bug so that when the TeamTalk server restart, it will automatic reconnect. A long with this update, I found 1 bug that is each time the TeamTalk server restart, TTMediaBot will fallback to an empty status with the mail gender set. To fix this problem, either I need to restart TTMediaBot or I play something and stop it. After I do one of the way above, it will back to the status that I said and the mail gender will automaticly removed. If I set the gender to female, this problem also happend. I need to use the same way to fix it. Thanks.

TTMediaBot not logging in at all but also doesn't give error.

Hi. I have just been trying to set up a tt media bot. I have done it before so i didn't think it would be a problem how ever it turns out that the bot doesn't connect at all to the server but doesn't give any error. What can i do to trace this?

we should get releaces versions for this bot

some people, doesn't know how to install python and other dependencys. a built version should be available, so we can download and use the bot like this, with out needing anything else installed. You should've known this need a long time ago

ttmediabot kurulum aşaması

ttmediabot.py --devices yazdığımızda aşağıdaki hatayı alıyorum ne yaptıysam çözemedim sizlerden destek bekliyorum

Traceback (most recent call last):
File "C:\Users\admin\Documents\TTMediaBot-master (1)\TTMediaBot-master\TTMediaBot.py", line 7, in
from bot import Bot, app_vars
File "C:\Users\admin\Documents\TTMediaBot-master (1)\TTMediaBot-master\bot_init_.py", line 10, in
from bot import (
File "C:\Users\admin\Documents\TTMediaBot-master (1)\TTMediaBot-master\bot\TeamTalk_init_.py", line 15, in
os.add_dll_directory(os.path.join(app_vars.directory, "TeamTalk_DLL"))
File "", line 1119, in add_dll_directory
FileNotFoundError: [WinError 2] Sistem belirtilen dosyayı bulamıyor: 'C:\Users\admin\Documents\TTMediaBot-master (1)\TTMediaBot-master\TeamTalk_DLL'

Getting system stats with bot admin command

Hello.
Would be nice to be able to get system stats by sending bot command as admin.
I think that the following output will be very useful.
CPU load: 2.5%
Memory used: 2 GB
Memory available: 6 GB
Disk used: 25 GB
Disk available: 185 GB
System uptime: 44 days 16 hours 55 minutes
TTMediaBot uptime: 18 days 6 hours 28 minutes

Also would be nice to see bot statistic like that:
Total requests processed: 1234
Total songs played: 228
Total users: 25 (means that 25 users have sent commands to bot since start)
Total downloads: 10

But bot stats is not as essential as system stats.

a few things.

hello,
i cant play dropbox links with u optio on ubuntu 20.03n
i put dl=1, i can download directly the link but cant play it.
please make a sample systemd file, i cant restart with rs option because i'm using cron job and sometimes i use screen. I relly need it, i cant do it because i dont know how to du spacially because i have to load pulseaudio, and pacmd.
I'm so gratefully.
can you create a command to call other bot? for example i want a bot in the channel a and annother in the channel b but i cant load more than one instanse because cache and configuration files. i would like for example a command in the main bot called call /talking that call annoter bot in anoter tread in the channel talking

Can't play anything Debian 11

We tried to set up the bot on Debian 11 using puslished instructions in the readme but audio not work. When we running bot we get list of errors below. What to do?
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib conf.c:5200:(snd_config_expand) Unknown parameters {AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM iec958:{AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
ALSA lib pcm_hw.c:1829:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1829:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1829:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1829:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4745:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5233:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM dmix

cant change language

hello,
in config.json or comand cl cant change language.
in config if i change to language "tr" it starts in english, and if i type cl tr says invalid language cl ru also

Bug when trying to stop playback and startt playback with new request or URL

Conditions:

  • Windows 8.1 64 bit;
  • Python 3.9.5;

Steps to reproduce:

  • Select youtube service;
  • Start playback from search or from URL;
  • Stop playback (not pause);
  • Immediately start another playback from search or from URL.

Expected behavior:
New playback starts as usualy.

Current behavior:
Bot throws the following error text in console and terminates:
WARNING [2021-05-25 22:01:50,218]: Could not send HEAD request to http://stream.zeno.fm/p7sv1v10ss8uv: HTTP Error 400: Bad Request in MainThread file: YoutubeDL.py line 607 function report_warning

Wishes:
Fix this please ASAP.

Problems with using the YouTube service

Hello there. I am using the TT Media Bot with Debian 10 Linux, with all python modules successfully installed, video and YTDL-Options disabled. Then, whenever I am trying to play a video using the YouTube service, it gives me this via private message in TT: "'NoneType' object has no atribute 'get'. In the Console Window of the Bot I get an HTTP Error 410, with the description "gone". Could someone help me?

Vaious ishues

hello, i have various ishues

  1. Team talk sdk doesnt extracts properly, the teamtalk5.dll is not present instead it downloads a big file, and puts it in a folder, you have to put the dll manually in root folder.
  2. mpv.dll downloaded gives error in windows, dinamic link routine load error.
    if you need more information i am available.

Suggestion for medias

I don't know how difficult it would be, but it would be interesting if the bot sent the media to the channel (ctrl+s dialog), and not using a virtual card to play back

libssl dependencies

I have tried set up a TTBot lately. Tried on ubuntu and debian and ever i have this answer:

/home/bot/.local/lib/python3.10/site-packages/pydantic/_migration.py:283: UserWarning: pydantic.error_wrappers:Validati onError has been moved to pydantic:ValidationError.
warnings.warn(f'{import_path} has been moved to {new_location}.')
Traceback (most recent call last):
File "/home/bot/TTMediaBot/TTMediaBot.py", line 7, in
from bot import Bot, app_vars
File "/home/bot/TTMediaBot/bot/init.py", line 10, in
from bot import (
File "/home/bot/TTMediaBot/bot/TeamTalk/init.py", line 19, in
from bot.TeamTalk.thread import TeamTalkThread
File "/home/bot/TTMediaBot/bot/TeamTalk/thread.py", line 14, in
from bot.TeamTalk.structs import *
File "/home/bot/TTMediaBot/bot/TeamTalk/structs.py", line 3, in
import TeamTalkPy
File "/home/bot/TTMediaBot/TeamTalkPy/init.py", line 1, in
from .TeamTalk5 import *
File "/home/bot/TTMediaBot/TeamTalkPy/TeamTalk5.py", line 24, in
dll = cdll.LoadLibrary("libTeamTalk5.so")
File "/usr/lib/python3.10/ctypes/init.py", line 452, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python3.10/ctypes/init.py", line 374, in init
self._handle = _dlopen(self._name, mode)
OSError: libssl.so.1.1: cannot open shared object file: No such file or directory

possibility to know the time remaining and total

hello, i am with a suggestion, can you add some commando to know the time remaining and the total? for example: 12:00 of 01:23:00
i want also to suggest that the favourites file is separate of the cache, for facility in backup purposes.

Ability to clear the cache automatically

I'm not sure if this is the correct place to post this, but there should be an option in the configuration file to specify an interval in minutes or seconds the cache should be automatically cleared. Failing to clear the cache after a while seems to result in crashes, so if the program could be set to clear its cache every hour or two, that would be great. Currently, this has to be manually done.

error running the sh

hello,
i have this error.
and when i start pulseaudio

ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned err
or: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directo
ry
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM default
ALSA lib confmisc.c:767:(parse_card) cannot find card '0'
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_card_driver return
ed error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_concat returned er
ror: No such file or directory
ALSA lib confmisc.c:1246:(snd_func_refer) error evaluating name
ALSA lib conf.c:4732:(_snd_config_evaluate) function snd_func_refer returned err
or: No such file or directory
ALSA lib conf.c:5220:(snd_config_expand) Evaluate error: No such file or directo
ry
ALSA lib pcm.c:2642:(snd_pcm_open_noupdate) Unknown PCM dmix
and when i start pulseaudio
W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
ubuntu 20.0.4

Error running in Ubuntu 22.04.

I'm trying to run the bot after performing a clean install of Ubuntu 22.04 LTS. I followed all the steps and installed all necessary requirements, but I receive the following error.
" /home/chris/.local/lib/python3.10/site-packages/pydantic/_migration.py:283: User
Warning: pydantic.error_wrappers:ValidationError has been moved to pydantic:V alidationError.
warnings.warn(f'{import_path} has been moved to {new_location}.')
Traceback (most recent call last):
File "/home/chris/TTMediaBot/TTMediaBot.py", line 7, in
from bot import Bot, app_vars
File "/home/chris/TTMediaBot/bot/init.py", line 10, in
from bot import (
File "/home/chris/TTMediaBot/bot/TeamTalk/init.py", line 19, in
from bot.TeamTalk.thread import TeamTalkThread
File "/home/chris/TTMediaBot/bot/TeamTalk/thread.py", line 14, in
from bot.TeamTalk.structs import *
File "/home/chris/TTMediaBot/bot/TeamTalk/structs.py", line 3, in
import TeamTalkPy
File "/home/chris/TTMediaBot/TeamTalkPy/init.py", line 1, in
from .TeamTalk5 import *
File "/home/chris/TTMediaBot/TeamTalkPy/TeamTalk5.py", line 24, in
dll = cdll.LoadLibrary("libTeamTalk5.so")
File "/usr/lib/python3.10/ctypes/init.py", line 452, in LoadLibrary
return self._dlltype(name)
File "/usr/lib/python3.10/ctypes/init.py", line 374, in init
self._handle = _dlopen(self._name, mode)
OSError: libssl.so.1.1: cannot open shared object file: No such file or director
y "
Is this perhaps an error with the TT SDK? When I installed the bot on Ubuntu 20.04, I noticed it was using 5.8, which may not be compatible with 22.04. I'm at a loss and not sure what to do to fix this.

error in the m command

Hello. I send the m command, and the following message appears: Error: 'ModeCommand' object has no attribute 'mode_names'

add ability for get channel ID

Hello master, please add ability for checking channel ID, for admin of bot, because sometime if you host bot like 10 or 15 on 1 server, then useing path for channel, the bot will not join to Specific path, it's will be stuck on root channel. After i used channel ID the bot will run normaly. for now to get the channel ID is to read tt5srv.xml or run ttCom, if TTMediaBot has the ability to check channel ID this will be very easy. Thank you. :)

setting 2 ttmediabot

hello, im on linux. how i can set 2 input devices in pulse? i want to set 2 bots to same teamtalk in 2 channels, playing different things. when i make annoter i can, but i ear the oter teamtalk song, and the mine channel song. what can i do? thanks!

Buffering audio on long youTube videos

I'm running the media bot in Docker on Debian 12. The host machine is a VPS from Vultr, with quite a fast network. I haven't put any memory or CPU limits on the docker container.

If I play a long youTube video, for instance this long compilatoin of all songs on a single album, the audio starts and stops intermittently, with pauses of around five seconds, as though the bot can't download the video fast enough to play it.

Not sure if this is a bug or a problem with my configuration, I didn't change anything in the YT section. But I'm not sure how to go about troubleshooting it. I'm pretty comfortable with Linux but I don't know a lot about how the bot operates or what I should be looking for. Thoughts welcome.

TT Media Bot does not Produce sound in Windows Virtual PrivateServer

happy day everyone.
May goodness always be with us.

Ask for your experience, about TTMediaBot on a Windows VPS.
I've tried to install virtual audio on a windows virtual private server, and I found out the line number using the command python TTMediaBot.py --devices
I followed the instructions carefully and made sure there were no errors Anywhere.
this is the umpteenth try, I'm using Windows Server 2019 (x64) build 17763.1
If so, please experience and answer yes?
Sharing is beautiful!

I can't change bot languaje

I'm trying to change bot languaje, but I can't
Even though I set the language in the config.json file, the bot is still in English. The same thing happens if I try to send the command cl languaje
When I send the command, it says the language has been changed, but it's still English

After Cache File is Modified, the Bot Is Prevented from Running because of It Not Properly Recognized (So It Seems)

As far as my limited Python knowledge goes it seems to me that after subsequent restarts of the bot, the cache file is not actually being loaded even though it clearly states it's the right one in the JSON file.

Here's what I get after running it with ./TTMediaBot.sh:

/home/chris/.local/lib/python3.10/site-packages/pydantic/_migration.py:283: UserWarning: `pydantic.error_wrappers:ValidationError` has been moved to `pydantic:ValidationError`.
  warnings.warn(f'`{import_path}` has been moved to `{new_location}`.')
Traceback (most recent call last):
  File "/home/chris/TTMediaBot/TTMediaBot.py", line 64, in <module>
    main()
  File "/home/chris/TTMediaBot/TTMediaBot.py", line 45, in main
    bot = Bot(config, cache, log)
  File "/home/chris/TTMediaBot/bot/__init__.py", line 60, in __init__
    self.cache_manager = cache.CacheManager(cache_file_name)
  File "/home/chris/TTMediaBot/bot/cache.py", line 42, in __init__
    self.data = cache_migrator.migrate(self, self._load())
  File "/home/chris/TTMediaBot/bot/cache.py", line 55, in _load
    return pickle.load(f)
  File "/home/chris/.local/lib/python3.10/site-packages/yt_dlp/utils/networking.py", line 70, in __setitem__
    super().__setitem__(key.title(), str(value).strip())
  File "/usr/lib/python3.10/collections/__init__.py", line 1109, in __setitem__
    self.data[key] = item
AttributeError: 'HTTPHeaderDict' object has no attribute 'data'

Running on a test instance of Ubuntu 22.04 before I upgrade my main server. Any reason why this is happening and can this be fixed?

teamtalk SDK license

Hello,
Do I as an end user of this application need to purchase a teamtalk SDK license?

Problem running the bot as a service

Hello,
I am trying to run the bot as a service as per the instructions in the attached file.

Running the command systemctl --user start TTMediaBot got the bot to connect to my server and it works fine, but it stops when I log out of the terminal.
I tried to copy the TTMediaBot/systemd/user/ files to /etc/systemd/system/ but when trying to run the bot I get the following error:

● TTMediaBot.service - TTMediaBot Loaded: loaded (/etc/systemd/system/TTMediaBot.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Wed 2022-08-03 21:20:43 EDT; 10min ago Process: 7318 ExecStart=/home/ubuntu/ttserver/TTMediaBot/TTMediaBot.sh -c /home/ubuntu/ttserver/TTMediaBot/config.j> Main PID: 7318 (code=exited, status=1/FAILURE) Aug 03 21:20:42 ip-172-31-41-144 systemd[1]: TTMediaBot.service: Main process exited, code=exited, status=1/FAILURE Aug 03 21:20:42 ip-172-31-41-144 systemd[1]: TTMediaBot.service: Failed with result 'exit-code'. Aug 03 21:20:43 ip-172-31-41-144 systemd[1]: TTMediaBot.service: Scheduled restart job, restart counter is at 5. Aug 03 21:20:43 ip-172-31-41-144 systemd[1]: Stopped TTMediaBot. Aug 03 21:20:43 ip-172-31-41-144 systemd[1]: TTMediaBot.service: Start request repeated too quickly. Aug 03 21:20:43 ip-172-31-41-144 systemd[1]: TTMediaBot.service: Failed with result 'exit-code'. Aug 03 21:20:43 ip-172-31-41-144 systemd[1]: Failed to start TTMediaBot.

What am I wrong?
Installing Bot on ubuntu 20.txt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.