Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INGESTING https icecast streams does not work #2938

Open
kmahelona opened this issue Feb 7, 2024 · 1 comment
Open

INGESTING https icecast streams does not work #2938

kmahelona opened this issue Feb 7, 2024 · 1 comment
Labels

Comments

@kmahelona
Copy link
Contributor

kmahelona commented Feb 7, 2024

Describe the bug

To reproduce

  1. Create a new webstream with an HTTPS url such as https://stream.iwi.radio/Awa_FM.aac
  2. Schedule the new stream to play, it should fail
  3. Create another webstream with an HTTP url such as http://icecast.iwi.radio:8000/te_hiku_fm.m3u and it should play
  4. Try to reschedule the secure URL, and notice that the previous, insecure URL will play instead.

Expected behavior

Option 1

We should expect https icecast urls to play in liquidsoap. The fallback to playing a previous insecure icecast URL has actually been a life saver for us as we've sometimes forgot, scheduled an https icecast link, it fails to play, but instead we'll play the previous icecast url we had sch3eduled, so we don't have any dead air in that instance. I don't think we should change that fallback behavior. We should only support playing https icecast links.

Option 2

We should not accept https streams. We should alert the user that the stream is invalid and require them to add another stream. So some level for form field validation or backend validation.

Relevant log output or error messages

2024-02-06 21:43:06 playout-1     | 2024-02-07 07:43:06,959 | INFO     | libretime_playout.message_handler:on_message:47 - handling event update_schedule: {'schedule': {'media': {'2024-02-07-07-41-21': {'row_id': 18, 'id': 4, 'uri': 'https://stream.iwi.radio/Awa_FM.aac', 'show_name': 'Untitled Show', 'start': '2024-02-07-07-41-16', 'end': '2024-02-07-07-41-16', 'type': 'stream_buffer_start'}, '2024-02-07-07-41-21_0': {'row_id': 18, 'id': 4, 'uri': 'https://stream.iwi.radio/Awa_FM.aac', 'show_name': 'Untitled Show', 'start': '2024-02-07-07-41-21', 'end': '2024-02-07-08-11-21', 'type': 'stream_output_start'}, '2024-02-07-08-11-20': {'row_id': 18, 'id': 4, 'uri': 'https://stream.iwi.radio/Awa_FM.aac', 'show_name': 'Untitled Show', 'start': '2024-02-07-08-11-20', 'end': '2024-02-07-08-11-20', 'type': 'stream_buffer_end'}, '2024-02-07-08-11-20_0': {'row_id': 18, 'id': 4, 'uri': 'https://stream.iwi.radio/Awa_FM.aac', 'show_name': 'Untitled Show', 'start': '2024-02-07-08-11-20', 'end': '2024-02-07-08-11-20', 'type': 'stream_output_end'}, '2024-02-07-08-11-21': {'row_id': 19, 'id': 5, 'uri': 'http://icecast.iwi.radio:8000/Awa_FM.aac', 'show_name': 'Untitled Show', 'start': '2024-02-07-08-11-16', 'end': '2024-02-07-08-11-16', 'type': 'stream_buffer_start'}, '2024-02-07-08-11-21_0': {'row_id': 19, 'id': 5, 'uri': 'http://icecast.iwi.radio:8000/Awa_FM.aac', 'show_name': 'Untitled Show', 'start': '2024-02-07-08-11-21', 'end': '2024-02-07-08-41-21', 'type': 'stream_output_start'}, '2024-02-07-08-41-20': {'row_id': 19, 'id': 5, 'uri': 'http://icecast.iwi.radio:8000/Awa_FM.aac', 'show_name': 'Untitled Show', 'start': '2024-02-07-08-41-20', 'end': '2024-02-07-08-41-20', 'type': 'stream_buffer_end'}, '2024-02-07-08-41-20_0': {'row_id': 19, 'id': 5, 'uri': 'http://icecast.iwi.radio:8000/Awa_FM.aac', 'show_name': 'Untitled Show', 'start': '2024-02-07-08-41-20', 'end': '2024-02-07-08-41-20', 'type': 'stream_output_end'}, '2024-02-07-08-41-21': {'id': 11, 'type': 'file', 'track_title': 'Nam Must Stay', 'artist_name': 'Troy Kingi', 'mime': 'audio/mp4', 'row_id': 12, 'uri': 'http://nginx:8080/rest/media/11', 'fade_in': 500, 'fade_out': 500, 'cue_in': 0, 'cue_out': 233.523, 'start': '2024-02-07-08-41-21', 'end': '2024-02-07-08-45-15', 'show_name': 'Untitled Show', 'replay_gain': -7.46, 'filesize': 8522176}}}, 'event_type': 'update_schedule'}
2024-02-06 21:43:06 nginx-1       | 192.168.65.1 - - [07/Feb/2024:07:43:06 +0000] "POST /showbuilder/schedule-move HTTP/1.1" 200 12 "http://localhost:8080/showbuilder" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:122.0) Gecko/20100101 Firefox/122.0" "-"
2024-02-06 21:43:06 playout-1     | 2024-02-07 07:43:06,969 | INFO     | libretime_playout.player.fetch:handle_message:110 - New timeout: 400.0
2024-02-06 21:43:06 playout-1     | 2024-02-07 07:43:06,969 | INFO     | libretime_playout.player.fetch:main:311 - Loop #31
2024-02-06 21:43:06 liquidsoap-1  | 2024/02/07 07:43:06 [server:3] New client: 172.18.0.7.
2024-02-06 21:43:06 liquidsoap-1  | 2024/02/07 07:43:06 [lang:3] web_stream.get_id
2024-02-06 21:43:06 playout-1     | 2024-02-07 07:43:06,971 | INFO     | libretime_playout.player.push:main:62 - heartbeat
2024-02-06 21:43:06 liquidsoap-1  | 2024/02/07 07:43:06 [server:3] Client 172.18.0.7 disconnected.
2024-02-06 21:43:06 playout-1     | 2024-02-07 07:43:06,971 | INFO     | libretime_playout.player.queue:main:57 - New schedule received
2024-02-06 21:43:06 playout-1     | 2024-02-07 07:43:06,971 | INFO     | libretime_playout.player.queue:main:39 - waiting 1693.028643s until next scheduled item
2024-02-06 21:43:07 legacy-1      | 172.18.0.12 -  07/Feb/2024:07:43:06 +0000 "GET /index.php" 200
2024-02-06 21:43:07 nginx-1       | 192.168.65.1 - - [07/Feb/2024:07:43:07 +0000] "GET /api/get-usability-hint?format=json&userPath=%2Fshowbuilder&_=1707291786989 HTTP/1.1" 200 12 "http://localhost:8080/showbuilder" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:122.0) Gecko/20100101 Firefox/122.0" "-"
2024-02-06 21:43:07 legacy-1      | 172.18.0.12 -  07/Feb/2024:07:43:06 +0000 "POST /index.php" 200
2024-02-06 21:43:07 nginx-1       | 192.168.65.1 - - [07/Feb/2024:07:43:07 +0000] "POST /showbuilder/builder-feed HTTP/1.1" 200 9269 "http://localhost:8080/showbuilder" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:122.0) Gecko/20100101 Firefox/122.0" "-"
2024-02-06 21:43:08 legacy-1      | 172.18.0.12 -  07/Feb/2024:07:43:08 +0000 "GET /index.php" 200
2024-02-06 21:43:08 nginx-1       | 192.168.65.1 - - [07/Feb/2024:07:43:08 +0000] "GET /Schedule/get-current-playlist/format/json?_=1707291788573 HTTP/1.1" 200 2429 "http://localhost:8080/showbuilder" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:122.0) Gecko/20100101 Firefox/122.0" "-"
2024-02-06 21:43:11 legacy-1      | 2024-02-07T07:43:11+00:00 INFO (6): removing gaps from show instance #1
2024-02-06 21:43:11 legacy-1      | 2024-02-07T07:43:11+00:00 INFO (6): adjusting start, end times of scheduled items to account for crossfades show instance #1
2024-02-06 21:43:11 rabbitmq-1    | 2024-02-07 07:43:11.442693+00:00 [info] <0.2464.0> accepting AMQP connection <0.2464.0> (172.18.0.10:37324 -> 172.18.0.3:5672)
2024-02-06 21:43:11 rabbitmq-1    | 2024-02-07 07:43:11.443944+00:00 [info] <0.2464.0> connection <0.2464.0> (172.18.0.10:37324 -> 172.18.0.3:5672): user 'libretime' authenticated and granted access to vhost '/libretime'
2024-02-06 21:43:11 rabbitmq-1    | 2024-02-07 07:43:11.445285+00:00 [info] <0.2464.0> closing AMQP connection <0.2464.0> (172.18.0.10:37324 -> 172.18.0.3:5672, vhost: '/libretime', user: 'libretime')
2024-02-06 21:43:11 legacy-1      | 172.18.0.12 -  07/Feb/2024:07:43:11 +0000 "POST /index.php" 200
2024-02-06 21:43:11 nginx-1       | 192.168.65.1 - - [07/Feb/2024:07:43:11 +0000] "POST /showbuilder/schedule-remove HTTP/1.1" 200 12 "http://localhost:8080/showbuilder" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:122.0) Gecko/20100101 Firefox/122.0" "-"
2024-02-06 21:43:11 playout-1     | 2024-02-07 07:43:11,445 | INFO     | libretime_playout.message_handler:on_message:47 - handling event update_schedule: {'schedule': {'media': {'2024-02-07-07-43-11': {'row_id': 19, 'id': 5, 'uri': 'http://icecast.iwi.radio:8000/Awa_FM.aac', 'show_name': 'Untitled Show', 'start': '2024-02-07-07-43-06', 'end': '2024-02-07-07-43-06', 'type': 'stream_buffer_start'}, '2024-02-07-07-43-11_0': {'row_id': 19, 'id': 5, 'uri': 'http://icecast.iwi.radio:8000/Awa_FM.aac', 'show_name': 'Untitled Show', 'start': '2024-02-07-07-43-11', 'end': '2024-02-07-08-13-11', 'type': 'stream_output_start'}, '2024-02-07-08-13-10': {'row_id': 19, 'id': 5, 'uri': 'http://icecast.iwi.radio:8000/Awa_FM.aac', 'show_name': 'Untitled Show', 'start': '2024-02-07-08-13-10', 'end': '2024-02-07-08-13-10', 'type': 'stream_buffer_end'}, '2024-02-07-08-13-10_0': {'row_id': 19, 'id': 5, 'uri': 'http://icecast.iwi.radio:8000/Awa_FM.aac', 'show_name': 'Untitled Show', 'start': '2024-02-07-08-13-10', 'end': '2024-02-07-08-13-10', 'type': 'stream_output_end'}, '2024-02-07-08-13-11': {'id': 11, 'type': 'file', 'track_title': 'Nam Must Stay', 'artist_name': 'Troy Kingi', 'mime': 'audio/mp4', 'row_id': 12, 'uri': 'http://nginx:8080/rest/media/11', 'fade_in': 500, 'fade_out': 500, 'cue_in': 0, 'cue_out': 233.523, 'start': '2024-02-07-08-13-11', 'end': '2024-02-07-08-17-04', 'show_name': 'Untitled Show', 'replay_gain': -7.46, 'filesize': 8522176}}}, 'event_type': 'update_schedule'}
2024-02-06 21:43:11 liquidsoap-1  | 2024/02/07 07:43:11 [server:3] New client: 172.18.0.7.

LibreTime version

4.0.0

Installation method and OS / Environment

Operating system: MacOS Docker, Debian
Method: docker-compose, vanilla install

Installation details

This happens in the latest version 4.0.0 running in docker and in a very old version we have running in production (probably 3.0 beta).

Client Environment

N/A

Screenshots

Not Necessary

@kmahelona
Copy link
Contributor Author

kmahelona commented Feb 7, 2024

Looking at the liquidsoap scripts for 1.4, it's calling the server command http.url to set the stream url. This command throws an error for https,

2024-02-07 01:00:25 2024/02/07 11:00:25 [lang:3] ["Usage: http.url [url]\r", "  Get or set the stream's HTTP URL. Setting a new URL will not affect an ongoing connection."]
2024-02-07 01:00:25 2024/02/07 11:00:25 [lang:3] executing http.url https://stream.iwi.radio/Awa_FM.aac
2024-02-07 01:00:25 2024/02/07 11:00:25 [lang:3] ["Invalid URL"]

There's a place where an initial URL is set, and that uses input.http which can be changed to input.https if there's 'https' in the initial_url, but that doesn't actually solve the problem (though in a strange edge case it will actually play the https url). I noticed in Liquidsoap 2 there's no input.https command, so I wonder if this "just works" in a newer version of liquidsoap (assuming the server.execute command of http.url can handle an https url).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant