GithubHelp home page GithubHelp logo

nwithan8 / tauticord Goto Github PK

View Code? Open in Web Editor NEW
96.0 8.0 23.0 1.4 MB

A Discord bot that displays live data from Tautulli

License: GNU General Public License v3.0

Python 99.45% Dockerfile 0.40% Makefile 0.15%

tauticord's Introduction

Tauticord

A Discord bot that displays live data from Tautulli

Release Docker Licence

Buy Me A Coffee GitHub Sponsors

logo

Features ⚙️

Tauticord uses the Tautulli API to pull information from Tautulli and display them in a Discord channel, including:

Overview:

  • Number of current streams
  • Number of transcoding streams
  • Total bandwidth
  • Total LAN bandwidth
  • Total remote bandwidth
  • Library item counts

For each stream:

  • Stream state (playing, paused, stopped, loading)
  • Media type (tv show/movie/song/photo)
  • User
  • Media title
  • Product and player
  • Quality profile
  • Stream bandwidth
  • If stream is transcoding
  • Progress of stream
  • ETA of stream completion

Administrator (the bot owner) can react to Tauticord's messages to terminate a specific stream (if they have Plex Pass).

Users can also indicate what libraries they would like monitored. Tauticord will create/update a voice channel for each library name with item counts every hour.

Announcements 📢

See ANNOUNCEMENTS.

Documentation 📄

See DOCUMENTATION.

Development 🛠️

See DEVELOPMENT.

Contact 📧

Please leave a pull request if you would like to contribute.

Also feel free to check out my other projects here on GitHub or join the #developer channel in my Discord server below.

Shout-outs 🎉

Sponsors

JetBrains

upamanyudas  l33xu  

Contributors

Nate
Nate Harris
Thomas
Thomas White
Tim
Tim Wilson
Ben
Ben Waco
Thomas
Thomas Durieux
Roy
Roy Du

tauticord's People

Contributors

benwaco avatar github-actions[bot] avatar nwithan8 avatar tdurieux avatar tomw1605 avatar twilsonco avatar yoruio 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  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

tauticord's Issues

[CRITICAL]: Fatal error occurred

Hey mate,
I'm running UnRaid and pulled the image today. I did the setup as per the github page and am receiving the below error;

2023-03-22T15:00:34: PM2 log: Launching in no daemon mode
2023-03-22T15:00:34: PM2 log: App [pm2-logrotate:0] starting in -fork mode-
2023-03-22T15:00:34: PM2 log: App [pm2-logrotate:0] online
2023-03-22T15:00:34: PM2 log: App [keepalive:1] starting in -fork mode-
2023-03-22T15:00:34: PM2 log: App [monitor:2] starting in -fork mode-
2023-03-22T15:00:34: PM2 log: App [keepalive:1] online
2023-03-22T15:00:34: PM2 log: App [monitor:2] online
2023-03-22T15:00:36: PM2 log: App [monitor:2] exited with code [1] via signal [SIGINT]
2023-03-22T15:00:36: PM2 log: App [monitor:2] starting in -fork mode-
2023-03-22T15:00:36: PM2 log: App [monitor:2] online
2023-03-22T15:00:36: PM2 log: App [monitor:2] exited with code [1] via signal [SIGINT]
2023-03-22T15:00:36: PM2 log: App [monitor:2] starting in -fork mode-
2023-03-22T15:00:36: PM2 log: App [monitor:2] online
2023-03-22T15:00:37: PM2 log: App [monitor:2] exited with code [1] via signal [SIGINT]
2023-03-22T15:00:37: PM2 log: App [monitor:2] starting in -fork mode-
2023-03-22T15:00:37: PM2 log: App [monitor:2] online
2023-03-22 04:00:38,211 - [INFO]: Starting Tauticord...
2023-03-22 04:00:38,386 - [CRITICAL]: Fatal error occurred. Shutting down: Expecting value: line 1 column 1 (char 0)
CRITICAL:Fatal error occurred. Shutting down: Expecting value: line 1 column 1 (char 0)
2023-03-22T15:00:38: PM2 log: App [monitor:2] exited with code [1] via signal [SIGINT]
2023-03-22T15:00:38: PM2 log: App [monitor:2] starting in -fork mode-
2023-03-22T15:00:38: PM2 log: App [monitor:2] online
2023-03-22 04:00:38,930 - [INFO]: Starting Tauticord...
2023-03-22 04:00:39,134 - [CRITICAL]: Fatal error occurred. Shutting down: Expecting value: line 1 column 1 (char 0)
CRITICAL:Fatal error occurred. Shutting down: Expecting value: line 1 column 1 (char 0)
2023-03-22T15:00:39: PM2 log: App [monitor:2] exited with code [1] via signal [SIGINT]
2023-03-22T15:00:39: PM2 log: App [monitor:2] starting in -fork mode-
2023-03-22T15:00:39: PM2 log: App [monitor:2] online
2023-03-22 04:00:39,675 - [INFO]: Starting Tauticord...

It loops like that until it gives up.

Tried to join ur discord but the Verify bot is broken... so cant see/talk anywhere.

Cheers

Missing Permissions?

after running docker run, this is my output.

WARNING:PyNaCl is not installed, voice will NOT be supported
Ignoring exception in on_ready

Traceback (most recent call last):

File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 343, in _run_event

await coro(*args, **kwargs)

File "/app/modules/discord_connector.py", line 130, in on_ready

await start_bot(discord_connector=self, analytics=self.analytics)

File "/app/modules/discord_connector.py", line 22, in start_bot

message = await discord_connector.get_old_message_in_tautulli_channel()

File "/app/modules/discord_connector.py", line 321, in get_old_message_in_tautulli_channel

await send_starter_message(tautulli_connector=self.tautulli, discord_channel=self.tautulli_channel)

File "/app/modules/discord_connector.py", line 74, in send_starter_message

await discord_channel.send(embed=embed)

File "/usr/local/lib/python3.10/site-packages/discord/abc.py", line 1065, in send

data = await state.http.send_message(channel.id, content, tts=tts, embed=embed,

File "/usr/local/lib/python3.10/site-packages/discord/http.py", line 248, in request

raise Forbidden(r, data)

discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions

Docker installation?

Hi, like your bots. Is it possible for you to create the images so I can run them in my docker environment please :) Thank you

syntax error after update

After the update. I tried to run the program after getting the new requirements but it seems there may be an issue.

root@plex:/etc/tauticord# python3 Tauticord.py
Traceback (most recent call last):
  File "/etc/tauticord/Tauticord.py", line 7, in <module>
    import modules.discord_connector as discord
  File "/etc/tauticord/modules/discord_connector.py", line 122
    match channel_type:
          ^
SyntaxError: invalid syntax

Channels now Unreadable

As you can see in your example image too, the statistics are now cut off and no longer display the number properly just simply an ellipsis.

Could I suggest the ability to use emojis instead of the name for a more low profile look and to allow more digits? You can see what I've managed to achieve with Notifiarr below the Tauticord stats.

Image

Doesn't like "/" in library name

Thanks for making this awesome bot!

I think I found a small bug. I have a library named "PPV / Events"

It won't pull stats for this library. All others work. I'm guessing it's the "/"

Log entries

2023-02-26 00:48:46,806 - [INFO]: Collecting stats about library "PPV / Events" INFO:Collecting stats about library "PPV / Events" 2023-02-26 00:48:46,826 - [ERROR]: Could not get ID for library PPV / Events ERROR:Could not get ID for library PPV / Events 2023-02-26 00:48:46,826 - [INFO]: Updating PPV / Events voice channel with new library size: 0 INFO:Updating PPV / Events voice channel with new library size: 0

Tauticord auto killing every stream

Fresh install, first time using, everything works, but as soon as a stream is detected, it posts, but then immediately reacts and kills the stream. The logs look like this when it happens:

DEBUG:Count: 1
2023-01-01 16:36:51,765 - [INFO]: Updating Streams voice channel with new stream count: 1
INFO:Updating Streams voice channel with new stream count: 1
2023-01-01 16:36:51,923 - [INFO]: Updating Transcodes voice channel with new stream count: 1
INFO:Updating Transcodes voice channel with new stream count: 1
2023-01-01 16:36:52,095 - [INFO]: Updating Bandwidth voice channel with new bandwidth: 2.6 Mbps
INFO:Updating Bandwidth voice channel with new bandwidth: 2.6 Mbps
2023-01-01 16:36:52,351 - [INFO]: Updating Remote Bandwidth voice channel with new bandwidth: 0.0 bps
INFO:Updating Remote Bandwidth voice channel with new bandwidth: 0.0 bps
DEBUG:Using old message...
DEBUG:Editing old message...
DEBUG:Stopping stream 1️⃣...
2023-01-01 16:36:53,807 - [INFO]: User attempting to stop session 1️⃣, id c3a96bcac397ffb7-com-plexapp-android
INFO:User attempting to stop session 1️⃣, id c3a96bcac397ffb7-com-plexapp-android
2023-01-01 16:36:54,275 - [INFO]: Stream 1️⃣ was stopped.
INFO:Stream 1️⃣ was stopped.
DEBUG:JSON returned by GET request: {'stream_count': '0', 'sessions': [], 'stream_count_direct_play': 0, 'stream_count_direct_stream': 0, 'stream_count_transcode': 0, 'total_bandwidth': 0, 'lan_bandwidth': 0, 'wan_bandwidth': 0}
DEBUG:Count: 0

display stats in text channel

Hi,

can stats of Tautulli displayed within a text channel?
because I have many plex servers and can't display stats of Tautulli in voice channel.

thanks

Bot stops updating in Discord after a while

Howdy,
I have an issue where the bot just stops updating in Discord and requires a reboot to fix. For example, I currently have 8 active streams but Tauticord says I have zero. If I reboot the docker container it immediately updates to show correct info and is good for about 12-24hrs.

Any tips on how to fix this? I can't imagine it'd be hard to just setup a script to reboot the container every like 3 hours but that's not really fixing the issue.

Thanks a lot.

Timezone Help

Hi, I am in the Eastern time zone, I put EST in and works, but is an hour off. So I tried EDT and ET but the gave me an error saying that was invalid. How do I adjust for daylight savings time and such?

KeyError

I'm getting a KeyError while running Tauticord.py through SSH.

Traceback (most recent call last):
File "Tauticord.py", line 22, in
t = tautulli.TautulliConnector(base_url=config.tautulli_connection_details['http://192.168.1.2:8181'],
KeyError: 'http://192.168.1.2:8181'

I don't see what's wrong with it to be honest :/ did I miss something?

Bot won't start: tautaulli.api not found

@WebServer:~/discord/tauticord$ python3 Tauticord.py Traceback (most recent call last): File "/home/john/discord/tauticord/Tauticord.py", line 8, in <module> import modules.tautulli_connector as tautulli File "/home/john/discord/tauticord/modules/tautulli_connector.py", line 2, in <module> from tautulli.api import RawAPI ModuleNotFoundError: No module named 'tautulli.api'

Everything in config seems to be correct.

[Enhancement] Support Timezones?

Hope you're not tired of me just yet :) I love this bot though!

The new notification & everything looks awesome. I think the only thing left (for now 😄) that I'd love to see is timezone support. Maybe this could be configured in the config.py?

This comes from noticing that the 'ETA' displays in UTC & as 24h format. I'd ideally prefer supporting 12h format (and am/pm) and the ability to define a timezone so that it could display in my timezone (not the user's timezone) what the ETA is. I'm in America/Chicago, for example, so would want that to show 9:24am.

Thank you for everything! Wish I knew Python well enough to save you the time & do PRs...

image

Ability to Rename Channels

Can we get the ability to rename the channels? I'd love to put an emoji in the name of the channel rather than the full name, as on certain devices channels can't be read properly.

So "TV Shows:" I could change to "📺 Total:"

Traceback

Traceback (most recent call last):

  File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 409, in _run_event

    await coro(*args, **kwargs)

  File "/app/modules/discord_connector.py", line 240, in on_raw_reaction_add

    message = await self.tautulli_channel.fetch_message(payload.message_id)

  File "/usr/local/lib/python3.10/site-packages/discord/abc.py", line 1599, in fetch_message

    data = await self._state.http.get_message(channel.id, id)

  File "/usr/local/lib/python3.10/site-packages/discord/http.py", line 740, in request

    raise NotFound(response, data)

discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message

ERROR:Ignoring exception in on_raw_reaction_add

Traceback (most recent call last):

  File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 409, in _run_event

    await coro(*args, **kwargs)

  File "/app/modules/discord_connector.py", line 240, in on_raw_reaction_add

    message = await self.tautulli_channel.fetch_message(payload.message_id)

  File "/usr/local/lib/python3.10/site-packages/discord/abc.py", line 1599, in fetch_message

    data = await self._state.http.get_message(channel.id, id)

  File "/usr/local/lib/python3.10/site-packages/discord/http.py", line 740, in request

    raise NotFound(response, data)

discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message

[2022-10-26 01:09:57] [ERROR   ] discord.client: Ignoring exception in on_raw_reaction_add

Traceback (most recent call last):

  File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 409, in _run_event

    await coro(*args, **kwargs)

  File "/app/modules/discord_connector.py", line 240, in on_raw_reaction_add

    message = await self.tautulli_channel.fetch_message(payload.message_id)

  File "/usr/local/lib/python3.10/site-packages/discord/abc.py", line 1599, in fetch_message

    data = await self._state.http.get_message(channel.id, id)

  File "/usr/local/lib/python3.10/site-packages/discord/http.py", line 740, in request

    raise NotFound(response, data)

discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message

ERROR:Ignoring exception in on_raw_reaction_add

Traceback (most recent call last):

  File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 409, in _run_event

    await coro(*args, **kwargs)

  File "/app/modules/discord_connector.py", line 240, in on_raw_reaction_add

    message = await self.tautulli_channel.fetch_message(payload.message_id)

  File "/usr/local/lib/python3.10/site-packages/discord/abc.py", line 1599, in fetch_message

    data = await self._state.http.get_message(channel.id, id)

  File "/usr/local/lib/python3.10/site-packages/discord/http.py", line 740, in request

    raise NotFound(response, data)

discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message

ValueError: Single '}' encountered in format string

Hey @nwithan8 thanks for the update! I pulled down the latest updates & gave it a go. Looks like I run into the below error. I tried cloning into a new repository to make sure it wasn't due to the pull, but I still encountered this.

Stack below - I looked into this but couldn't figure out what might need to be changed :(

Ignoring exception in on_ready Traceback (most recent call last): File "/home/(user)/.local/lib/python3.8/site-packages/discord/client.py", line 333, in _run_event await coro(*args, **kwargs) File "/opt/tauticord/Tauticord2/Tauticord/modules/discord_connector.py", line 97, in on_ready await start_bot(discord_connector=self, analytics=self.analytics) File "/opt/tauticord/Tauticord2/Tauticord/modules/discord_connector.py", line 20, in start_bot message = await discord_connector.edit_message(previous_message=message) File "/opt/tauticord/Tauticord2/Tauticord/modules/discord_connector.py", line 112, in edit_message new_message, count = self.tautulli.refresh_data() File "/opt/tauticord/Tauticord2/Tauticord/modules/tautulli_connector.py", line 219, in refresh_data overview_message = activity.message File "/opt/tauticord/Tauticord2/Tauticord/modules/tautulli_connector.py", line 45, in message overview_message += f" ({vars.transcodes_message.format(transcode_count=self.transcode_count, word=utils.make_plural(word='transcode', count=self.transcode_count))})" ValueError: Single '}' encountered in format string

only send mesage on state change

this is a great bot however i think it would be better if it only sent a mesage when the state actualy changes.

i think a good way to do this would be to store the state and compair it to the new state pulled from Tautulli befor actualy sending a message

Streams under 1 Mbps don't work properly

When a stream under 1 Mbps is by itself, it doesn't add to the total stream count. When there are other streams playing concurrently, it will add the low bitrate stream to the total stream count, but it won't display it in the message. It simply skips over it
image (2)

[Feature Request] Live Stats as voice channels

Hey 😄
If it's possible, it would be awesome with an option to show some of the live stats as voice channels, like the library stats.

Like the number of current streams / number of transcoding streams, or one of the other options, being updated every 15 second or whatever specified in the config.yaml.example.

Sorry that I can't do a pull request myself, but I know barely anything about Python.

Voice channel library stats update.

In the config.yaml it states that the discord voice channels are meant to update every hour with new stats.

However after rescanning my library, a few times, it's sticking on the same numbers. I have stopped/started the bot. Deleted the channels to remake them and it's still displaying the same numbers.

Traceback

[2022-09-16 01:21:12] [ERROR   ] discord.client: Ignoring exception in on_ready

Traceback (most recent call last):

  File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 409, in _run_event

    await coro(*args, **kwargs)

  File "/app/modules/discord_connector.py", line 146, in on_ready

    await start_bot(discord_connector=self, analytics=self.analytics)

  File "/app/modules/discord_connector.py", line 22, in start_bot

    message = await discord_connector.get_old_message_in_tautulli_channel()

  File "/app/modules/discord_connector.py", line 338, in get_old_message_in_tautulli_channel

    return await self.tautulli_channel.fetch_message(id=last_bot_message_id)

TypeError: Messageable.fetch_message() got some positional-only arguments passed as keyword arguments: 'id'

ERROR:Ignoring exception in on_ready

Traceback (most recent call last):

  File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 409, in _run_event

    await coro(*args, **kwargs)

  File "/app/modules/discord_connector.py", line 146, in on_ready

    await start_bot(discord_connector=self, analytics=self.analytics)

  File "/app/modules/discord_connector.py", line 22, in start_bot

    message = await discord_connector.get_old_message_in_tautulli_channel()

  File "/app/modules/discord_connector.py", line 338, in get_old_message_in_tautulli_channel

    return await self.tautulli_channel.fetch_message(id=last_bot_message_id)

TypeError: Messageable.fetch_message() got some positional-only arguments passed as keyword arguments: 'id'

Running into errors

So i'm both trying to run it as docker and manually but it both ways runs into issues, for docker it just spits out an error aswell.

I have filled in the api, ip, discord server, channel and such it does create them but it doesn't seem to be working properly.

any chance I could get some assistance?

I ctrl C because it doesn't appear to be doing anything after that point (waited for ~20 minutes)

Docker & manually spits out this:

image

Feature Request: Split bandwidth into local and remote bandwidth

Offer the option to split bandwidth into local and remote bandwidth and allow hiding of either option.

Use Case:
I and countless others suffer from having cable internet. Our download is ample, but upload is severely limited. Differentiating between LAN and WAN traffic will allow sysadmins to better tune their system to work within the confines of their bandwidth.

Plex creates new channels every time the script is run even though the channel already exists

Found this issue while testing changes to the config file. On the first run, it created the "PlexStats" channel since it didn't exist.
Then it kept creating it while I reran the script to validate my config file. I had 5 channels with the same name before I realized what was happening.

Let me know if you want me to attach the config file. I'll mask the tokens and send it.

`2023-01-05 00:09:38,360 - [DEBUG]: Loaded config from C:\Users\Megatron\Documents\tauticord\config.yaml

2023-01-05 00:09:38,360 - [INFO]: Starting Tauticord...

2023-01-05 00:09:40,421 - [INFO]: Connecting to Discord...

2023-01-05 00:09:43,057 - [INFO]: Connected to Discord.

2023-01-05 00:09:43,060 - [INFO]: Loading Tautulli text settings...

2023-01-05 00:09:43,066 - [INFO]: Getting "None" channel

2023-01-05 00:09:43,068 - [ERROR]: Could not load None channel. Attempting to create...

2023-01-05 00:12:15,205 - [DEBUG]: Loaded config from C:\Users\Megatron\Documents\tauticord\config.yaml

2023-01-05 00:12:15,205 - [INFO]: Starting Tauticord...

2023-01-05 00:12:17,257 - [INFO]: Connecting to Discord...

2023-01-05 00:12:19,871 - [INFO]: Connected to Discord.

2023-01-05 00:12:19,871 - [INFO]: Loading Tautulli text settings...

2023-01-05 00:12:19,872 - [INFO]: Getting "PlexStats" channel

2023-01-05 00:12:19,872 - [ERROR]: Could not load PlexStats channel. Attempting to create...

2023-01-05 00:12:20,006 - [INFO]: PlexStats channel collected.

2023-01-05 00:12:20,089 - [INFO]: Couldn't find old message, sending initial message...

2023-01-05 00:12:20,289 - [INFO]: Loading Tautulli voice settings...

2023-01-05 00:12:20,289 - [INFO]: Getting Tautulli Stats voice category

2023-01-05 00:12:20,289 - [INFO]: Tautulli Stats voice category collected.

2023-01-05 00:12:20,290 - [INFO]: Getting Tautulli Libraries voice category

2023-01-05 00:12:20,290 - [INFO]: Tautulli Libraries voice category collected.

2023-01-05 00:12:20,290 - [INFO]: Loading Tautulli summary message service...

2023-01-05 00:12:20,290 - [INFO]: Starting Tautulli library stats service...`

Unable to launch docker

I try to use it on Unraid docker (its on prupose in apps community)
but i get this error ;(

`Traceback (most recent call last):
File "/usr/local/lib/python3.10/site-packages/confuse/yaml_util.py", line 86, in load_yaml
with open(filename, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: '/app/config.yaml'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/app/./Tauticord.py", line 12, in
config = config_parser.Config(app_name="Tauticord", config_path="config.yaml")
File "/app/modules/config_parser.py", line 206, in init
self.config.set_file(filename=config_path)
File "/usr/local/lib/python3.10/site-packages/confuse/core.py", line 604, in set_file
self.set(YamlSource(filename, base_for_paths=base_for_paths,
File "/usr/local/lib/python3.10/site-packages/confuse/sources.py", line 76, in init
self.load()
File "/usr/local/lib/python3.10/site-packages/confuse/sources.py", line 84, in load
value = yaml_util.load_yaml(self.filename,
File "/usr/local/lib/python3.10/site-packages/confuse/yaml_util.py", line 89, in load_yaml
raise ConfigReadError(filename, exc)
confuse.exceptions.ConfigReadError: /app/config.yaml could not be read: [Errno 2] No such file or directory: '/app/config.yaml'`

Add Episodes Stat

Is it possible to add an env value to show total episodes as well as or in place of the series total statistics?

Bot stopped working.

Hi team,

The bot was working all yesterday but now won't work?
I've tried re-installing, creating another bot etc and still nothing.

Have tried running via docker and natively.

Below is the error message I get

`WARNING:PyNaCl is not installed, voice will NOT be supported

Ignoring exception in on_ready

Traceback (most recent call last):

  File "/usr/local/lib/python3.9/site-packages/discord/client.py", line 343, in _run_event

    await coro(*args, **kwargs)

  File "/app/modules/discord_connector.py", line 104, in on_ready

    await start_bot(discord_connector=self, analytics=self.analytics)

  File "/app/modules/discord_connector.py", line 24, in start_bot

    message = await discord_connector.edit_message(previous_message=message)

  File "/app/modules/discord_connector.py", line 119, in edit_message

    new_message, count, activity = self.tautulli.refresh_data()

  File "/app/modules/tautulli_connector.py", line 216, in refresh_data

    overview_message = activity.message

  File "/app/modules/tautulli_connector.py", line 49, in message

    if self.total_bandwidth:

  File "/app/modules/tautulli_connector.py", line 30, in total_bandwidth

    return utils.human_bitrate(float(json_bandwidth))

  File "/app/modules/utils.py", line 35, in human_bitrate

    return f'{int(B / KB):.{d}} kbps'

ValueError: Precision not allowed in integer format specifier

Failed to start the application

Hello, I followed attentively all the prerequisites necessary to the execution of the script, however I still have a problem during the execution of this one I put you the screenshot of the problem in question, hoping that you can enlighten me on the subject.

Capture d’écran 2022-12-20 150816

Traceback errors

[2022-09-12 20:42:29] [ERROR   ] discord.client: Ignoring exception in on_ready
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 409, in _run_event
    await coro(*args, **kwargs)
  File "/app/modules/discord_connector.py", line 130, in on_ready
    await start_bot(discord_connector=self, analytics=self.analytics)
  File "/app/modules/discord_connector.py", line 24, in start_bot
    message = await discord_connector.edit_message(previous_message=message)
  File "/app/modules/discord_connector.py", line 173, in edit_message
    new_message = await send_message(content=data_wrapper,
  File "/app/modules/discord_connector.py", line 96, in send_message
    await message.edit(content=content.message)
  File "/usr/local/lib/python3.10/site-packages/discord/message.py", line 2086, in edit
    data = await self._state.http.edit_message(self.channel.id, self.id, params=params)
  File "/usr/local/lib/python3.10/site-packages/discord/http.py", line 744, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message
ERROR:Ignoring exception in on_ready
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/site-packages/discord/client.py", line 409, in _run_event
    await coro(*args, **kwargs)
  File "/app/modules/discord_connector.py", line 130, in on_ready
    await start_bot(discord_connector=self, analytics=self.analytics)
  File "/app/modules/discord_connector.py", line 24, in start_bot
    message = await discord_connector.edit_message(previous_message=message)
  File "/app/modules/discord_connector.py", line 173, in edit_message
    new_message = await send_message(content=data_wrapper,
  File "/app/modules/discord_connector.py", line 96, in send_message
    await message.edit(content=content.message)
  File "/usr/local/lib/python3.10/site-packages/discord/message.py", line 2086, in edit
    data = await self._state.http.edit_message(self.channel.id, self.id, params=params)
  File "/usr/local/lib/python3.10/site-packages/discord/http.py", line 744, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 400 Bad Request (error code: 50006): Cannot send an empty message

Rate limited

WARNING:We are being rate limited. Retrying in 0.09 seconds. Handled under the bucket "0987123049813:None:/channels/{channel_id}/messages/{message_id}/reactions/{emoji}/@me"

Getting this, then after a while Tauticord stops working.

System Stats(?)

Is it possible to get full system stats included too? Like the full servers bandwidth in/out & CPU, RAM usage?

As whilst Tautulli does do some reporting, users can't really see if the server itself is performing well.

Provide Progress Bar or Progress Details?

Would love if the Tauticord notification could show the progress of what's being watched. This could be in the form of something like '5:00/45:00 (11%) ETA: 18:32' or something, and/or a progress bar similar to what is shown in Tautulli at the bottom of a 'now playing' notification.

E.g. a means of displaying this data within the Discord notification that Tauticord creates:

image

No actualization

Hello,

The bot doesn't seem to actualize Discord Voice Channels or Embed message

Multiple Owner ID's

Is it possible to be able to provide these in an array? If not, could we have the ability to specify a role instead?

Exception: Tautulli did not report a version number.

Hello - I'm seeing this on a fresh deployment on unraid, any ideas?

Traceback (most recent call last):
File "/app/./Tauticord.py", line 31, in
tautulli_connector=tautulli.TautulliConnector(
File "/app/modules/tautulli_connector.py", line 290, in init
self.api = tautulli.RawAPI(base_url=base_url, api_key=api_key)
File "/usr/local/lib/python3.10/site-packages/tautulli/api/json_api.py", line 29, in init
if verify and not self._verify_compatibility(min_version=min_api_version):
File "/usr/local/lib/python3.10/site-packages/tautulli/api/json_api.py", line 47, in _verify_compatibility
raise Exception("Tautulli did not report a version number.")
Exception: Tautulli did not report a version number.
Traceback (most recent call last):
File "/app/./Tauticord.py", line 31, in
tautulli_connector=tautulli.TautulliConnector(
File "/app/modules/tautulli_connector.py", line 290, in init
self.api = tautulli.RawAPI(base_url=base_url, api_key=api_key)
File "/usr/local/lib/python3.10/site-packages/tautulli/api/json_api.py", line 29, in init
if verify and not self._verify_compatibility(min_version=min_api_version):
File "/usr/local/lib/python3.10/site-packages/tautulli/api/json_api.py", line 47, in _verify_compatibility
raise Exception("Tautulli did not report a version number.")
Exception: Tautulli did not report a version number.

Command prompt error when started

HI!
I am getting the following upon starting Tauticord:
No connection adapters were found for '192.168.10.111:8181/api/v2?apikey=e0c5f80452a340e9bc84c57569edd8fb&cmd=get_activity'

The Channel I have the BOT pointed to posts a message saying "Start up" but nothing happens after that.

Is there something I need to set up in Tautulli or is it something else?

Tauticord Breaking after Tautulli Disconnection

Our Tautulli instance is set to back up data etc and isn't always a 24/7 online instance. Once Tauticord loses connectivity, the script seems to break entirely and requires a manual restart of the container. Is it possible to add some kind of reconnect functionality so the script does not terminate and dump?

Shard ID None blocked for more than x seconds

I'm unsure where to begin with this, bot appears online but doesn't seem to be able to create any channels or anything, the bot has every permission.

Full error:

WARNING:PyNaCl is not installed, voice will NOT be supported
WARNING:Shard ID None heartbeat blocked for more than 10 seconds.
Loop thread traceback (most recent call last):
  File "/home/john/discord/tauticord/Tauticord.py", line 40, in <module>
    d.connect()
  File "/home/john/discord/tauticord/modules/discord_connector.py", line 107, in connect
    self.client.run(self.token)
  File "/home/john/.local/lib/python3.9/site-packages/discord/client.py", line 713, in run
    loop.run_forever()
  File "/usr/lib/python3.9/asyncio/base_events.py", line 596, in run_forever
    self._run_once()
  File "/usr/lib/python3.9/asyncio/base_events.py", line 1890, in _run_once
    handle._run()
  File "/usr/lib/python3.9/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/home/john/.local/lib/python3.9/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "/home/john/discord/tauticord/modules/discord_connector.py", line 103, in on_ready
    await start_bot(discord_connector=self, analytics=self.analytics)
  File "/home/john/discord/tauticord/modules/discord_connector.py", line 19, in start_bot
    analytics.event(event_category="Platform", event_action=sys.platform)
  File "/home/john/discord/tauticord/modules/analytics.py", line 68, in event
    return self._send(final_params=final_params)
  File "/home/john/discord/tauticord/modules/analytics.py", line 46, in _send
    if objectrest.post(url=url):
  File "/home/john/.local/lib/python3.9/site-packages/objectrest/base_requests.py", line 142, in post
    return _make_request(request_type=RequestType.POST, url=url, session=session, use_proxy=use_proxy, log=log,
  File "/home/john/.local/lib/python3.9/site-packages/objectrest/base_requests.py", line 39, in _make_request
    res = session.post(url, **kwargs) if session else requests.post(url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 119, in post
    return request('post', url, data=data, json=json, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/lib/python3/dist-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/lib/python3/dist-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 382, in _make_request
    self._validate_conn(conn)
  File "/usr/lib/python3/dist-packages/urllib3/connectionpool.py", line 1012, in _validate_conn
    conn.connect()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 353, in connect    conn = self._new_conn()
  File "/usr/lib/python3/dist-packages/urllib3/connection.py", line 169, in _new_conn
    conn = connection.create_connection(
  File "/usr/lib/python3/dist-packages/urllib3/util/connection.py", line 86, in create_connection
    sock.connect(sa)```

Edit;
After letting it go through the whole thing after a minute and a half it does seem to work, although if has more errors.

```ERROR:Could not load Status channel. Attempting to create...
<Message id=938164175883096084 channel=<TextChannel id=938164174838726696 name='status' position=13 nsfw=False news=False category_id=None> type=<MessageType.default: 0> author=<Member id=938156002711335024 name='Tautulli' discriminator='3489' bot=True nick=None guild=<Guild id=937128957604691999 name='The Plex Center' shard_id=None chunked=False member_count=5>> flags=<MessageFlags value=0>>
Ignoring exception in on_ready
Traceback (most recent call last):
  File "/home/john/.local/lib/python3.9/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "/home/john/discord/tauticord/modules/discord_connector.py", line 102, in on_ready
    self.update_libraries.start()
  File "/home/john/.local/lib/python3.9/site-packages/discord/ext/tasks/__init__.py", line 205, in start
    raise RuntimeError('Task is already launched and is not completed.')
RuntimeError: Task is already launched and is not completed.```

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.