nimroddolev / chime_tts

A custom Home Assistant integration to play combined audio files before and/or after text-to-speech (TTS) messages
https://nimroddolev.github.io/chime_tts/
MIT License
196 stars 14 forks source link

Every ChimeTTS use through MPD integration results in ban attempt #159

Closed ser closed 2 months ago

ser commented 4 months ago

System Health details

Logger: homeassistant.components.http.ban
Source: components/http/ban.py:135
integration: HTTP ([documentation](https://www.home-assistant.io/integrations/http), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+http%22))
First occurred: 28 June 2024 at 20:45:02 (65 occurrences)
Last logged: 08:21:29

    Login attempt or request with invalid authentication from 192.168.41.13 (192.168.41.13). Requested URL: '/media/local/sounds/temp/chime_tts/cover.tiff'. (Music Player Daemon 0.22.6)
    Login attempt or request with invalid authentication from 192.168.41.13 (192.168.41.13). Requested URL: '/media/local/sounds/temp/chime_tts/cover.bmp'. (Music Player Daemon 0.22.6)
    Login attempt or request with invalid authentication from 192.168.41.27 (192.168.41.27). Requested URL: '/media/local/sounds/temp/chime_tts/cover.png'. (Music Player Daemon 0.23.12)
    Login attempt or request with invalid authentication from 192.168.41.27 (192.168.41.27). Requested URL: '/media/local/sounds/temp/chime_tts/cover.jpg'. (Music Player Daemon 0.23.12)
    Login attempt or request with invalid authentication from 192.168.41.27 (192.168.41.27). Requested URL: '/media/local/sounds/temp/chime_tts/cover.webp'. (Music Player Daemon 0.23.12)

Checklist

Describe the issue

It seems that MPD integration forces MPD server to get an album cover for ChimeTTS served audio file, which obviously is not possible as ChimeTTS does not provide it.

The result is super ugly as every chime there is a scary system notification which comes from the ban module, as MPD tries to get an not existing file resulting in 401 error.

My proposition to solve the issue is for ChimeTTS to serve requested images with a nice ChimeTTS logo.

Reproduction steps

  1. ChimeTTS used via MPD integration

Debug logs

Logger: homeassistant.components.http.ban
Source: components/http/ban.py:135
integration: HTTP ([documentation](https://www.home-assistant.io/integrations/http), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+http%22))
First occurred: 28 June 2024 at 20:45:02 (65 occurrences)
Last logged: 08:21:29

    Login attempt or request with invalid authentication from 192.168.41.13 (192.168.41.13). Requested URL: '/media/local/sounds/temp/chime_tts/cover.tiff'. (Music Player Daemon 0.22.6)
    Login attempt or request with invalid authentication from 192.168.41.13 (192.168.41.13). Requested URL: '/media/local/sounds/temp/chime_tts/cover.bmp'. (Music Player Daemon 0.22.6)
    Login attempt or request with invalid authentication from 192.168.41.27 (192.168.41.27). Requested URL: '/media/local/sounds/temp/chime_tts/cover.png'. (Music Player Daemon 0.23.12)
    Login attempt or request with invalid authentication from 192.168.41.27 (192.168.41.27). Requested URL: '/media/local/sounds/temp/chime_tts/cover.jpg'. (Music Player Daemon 0.23.12)
    Login attempt or request with invalid authentication from 192.168.41.27 (192.168.41.27). Requested URL: '/media/local/sounds/temp/chime_tts/cover.webp'. (Music Player Daemon 0.23.12)


### Diagnostics dump

there is a related bug existing for years in HA: https://github.com/home-assistant/core/issues/77997
ser commented 4 months ago

it's debug of the mpd server side:

Jun 29 09:06:01 bigmic mpd[698976]: output: opened "My ALSA Device" (alsa) audio_format=24000:24:2
Jun 29 09:06:01 bigmic mpd[698976]: client: [279] command returned 0
Jun 29 09:06:01 bigmic mpd[698976]: client: [279] process command "currentsong"
Jun 29 09:06:01 bigmic mpd[698976]: client: [279] command returned 0
Jun 29 09:06:01 bigmic mpd[698976]: client: [279] process command "commands"
Jun 29 09:06:01 bigmic mpd[698976]: client: [279] command returned 0
Jun 29 09:06:01 bigmic mpd[698976]: client: [279] process command "readpicture "http://192.168.41.114:8123/media/local/sounds/temp/chime_tts/idlwe3m6.mp3?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlZjE2OWIxZWQ1Yjg0YmM3YTc1ZDM0NTk4M2Y1OGEyNSIsInBhdGgiOiIvbWVkaWEvbG9jYWwvc291bmRzL3RlbXAvY2hpbWVfdHRzL2lkbHdlM202Lm1wMyIsInBhcmFtcyI6W10sImlhdCI6MTcxOTYyNjc2MSwiZXhwIjoxNzE5NzEzMTYxfQ.mGyw5Fzz3J_2JFglw6F7pReqaDTENE3BZ2hNklnTB88" "0""
Jun 29 09:06:01 bigmic mpd[698976]: client: [279] command returned 0
Jun 29 09:06:01 bigmic mpd[698976]: client: [279] process command "albumart "http://192.168.41.114:8123/media/local/sounds/temp/chime_tts/idlwe3m6.mp3?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlZjE2OWIxZWQ1Yjg0YmM3YTc1ZDM0NTk4M2Y1OGEyNSIsInBhdGgiOiIvbWVkaWEvbG9jYWwvc291bmRzL3RlbXAvY2hpbWVfdHRzL2lkbHdlM202Lm1wMyIsInBhcmFtcyI6W10sImlhdCI6MTcxOTYyNjc2MSwiZXhwIjoxNzE5NzEzMTYxfQ.mGyw5Fzz3J_2JFglw6F7pReqaDTENE3BZ2hNklnTB88" "0""
Jun 29 09:06:01 bigmic mpd[698976]: exception: CURL failed: The requested URL returned error: 401
Jun 29 09:06:01 bigmic mpd[698976]: exception: CURL failed: The requested URL returned error: 401
Jun 29 09:06:01 bigmic mpd[698976]: exception: CURL failed: The requested URL returned error: 401
Jun 29 09:06:01 bigmic mpd[698976]: client: [279] command returned 3
Jun 29 09:06:01 bigmic mpd[698976]: client: [279] closed
Jun 29 09:06:04 bigmic mpd[698976]: player: played "http://192.168.41.114:8123/media/local/sounds/temp/chime_tts/idlwe3m6.mp3?authSig=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJlZjE2OWIxZWQ1Yjg0YmM3YTc1ZDM0NTk4M2Y1OGEyNSIsInBhdGgiOiIvbWVkaWEvbG9jYWwvc291bmRzL3RlbXAvY2hpbWVfdHRzL2lkbHdlM202Lm1wMyIsInBhcmFtcyI6W10sImlhdCI6MTcxOTYyNjc2MSwiZXhwIjoxNzE5NzEzMTYxfQ.mGyw5Fzz3J_2JFglw6F7pReqaDTENE3BZ2hNklnTB88"
Jun 29 09:06:04 bigmic mpd[698976]: playlist: stop
Jun 29 09:06:04 bigmic mpd[698976]: output: closed "My ALSA Device" (alsa)
nimroddolev commented 4 months ago

I have released a new beta version, v1.1.4-beta4, which embeds an image in the generated MP3 file's ID3 tag. Do you know if this will satisfy MDP's requirements?

To install the new beta version:

  1. Open the Chime TTS repository in HACS
  2. Click on the button in the top right
  3. Select the ↻ Redownload option
  4. Enable the Show beta versions option (it may take a moment to update the list)
  5. Select version v1.1.4-beta4 from the updated version drop-down list
  6. Restart Home Assistant
ser commented 4 months ago

Hello, it hasn't helped, It seems MPD and MPD integration ignores embedding.

nimroddolev commented 2 months ago

This issue seems to be related to MDP and not Chime TTS