Taiko2k / Tauon

The music player of today! :city_sunrise:
https://tauonmusicbox.rocks
GNU General Public License v3.0
1.76k stars 67 forks source link

HD Internet Radio steams #981

Open LukeZBaker opened 1 year ago

LukeZBaker commented 1 year ago

There is an issue with HD internet radio e.g

BBC Radio 3 HD doesn't play

http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_radio_three.m3u8

Error: Sorry, m3u parsing not fully implemented.

Taiko2k commented 1 year ago

Most of these types of streams such as the one you linked have regional restrictions (i.e you have to be in the UK for that stream to work), is why I haven't prioritised fixing this error.

LukeZBaker commented 1 year ago

Understood but a shame as even bash shell scripts like tera support the HD streams. These HD streams are very popular given their high bitrates

Taiko2k commented 1 year ago

Ive committed a fix that may solve this error now. I can't fully test it myself though but I assume it should work.

LukeZBaker commented 1 year ago

I tried a few HD streams but now get a different error message: Failed to establish a connection

Traceback (most recent call last): File "/usr/lib/python3.10/threading.py", line 1016, in _bootstrap_inner self.run() File "/usr/lib/python3.10/threading.py", line 953, in run self._target(*self._args, **self._kwargs) File "/home/luke/TauonMusicBox/t_modules/t_stream.py", line 177, in feed decoder.stdin.write(chunk) BrokenPipeError: [Errno 32] Broken pipe Abort stream connection URL error... Connection failed unknown url type: 'bbc_radio_three-audio=320000-262943254.ts' Start radio failed

Taiko2k commented 1 year ago

Hmm interesting, seems there's more to it. Could you paste me the contents of this file here for me? (It 403's for me)

http://as-hls-uk-live.akamaized.net/pool_904/live/uk/bbc_radio_three/bbc_radio_three.isml/bbc_radio_three-audio%3d320000.norewind.m3u8

LukeZBaker commented 1 year ago

EXTM3U

EXT-X-VERSION:3

Created with Unified Streaming Platform(version=1.8.4)

EXT-X-MEDIA-SEQUENCE:262943709

EXT-X-INDEPENDENT-SEGMENTS

EXT-X-TARGETDURATION:6

USP-X-TIMESTAMP-MAP:MPEGTS=6439916448,LOCAL=2023-04-30T07:28:51.200000Z

EXT-X-PROGRAM-DATE-TIME:2023-04-30T07:28:51.200000Z

EXTINF:6.4, no desc

bbc_radio_three-audio=320000-262943709.ts

EXTINF:6.4, no desc

bbc_radio_three-audio=320000-262943710.ts

EXTINF:6.4, no desc

bbc_radio_three-audio=320000-262943711.ts

EXTINF:6.4, no desc

bbc_radio_three-audio=320000-262943712.ts

EXTINF:6.4, no desc

bbc_radio_three-audio=320000-262943713.ts

Taiko2k commented 1 year ago

Ok ive made a new commit now for you to test. Its quite a shot in the dark though.

LukeZBaker commented 1 year ago

Appreciate it's hard for you as you can't test.

The new commit now gives the error:

Extracted URL is: http://as-hls-uk-live.akamaized.net/pool_904/live/uk/bbc_radio_three/bbc_radio_three.isml/bbc_radio_three-audio=320000-262944006.ts No socket to close? Open URL..... URL error... Connection failed 'HTTPResponse' object has no attribute 'url' Start radio failed

Hmm, I'm getting that error for all streams now, HD or not.

On Sun, Apr 30, 2023 at 8:55 AM Taiko2k @.***> wrote:

Ok ive made a new commit now for you to test. Its quite a shot in the dark though.

— Reply to this email directly, view it on GitHub https://github.com/Taiko2k/TauonMusicBox/issues/981#issuecomment-1528963142, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKDPS2DN4RYY33BCYYWFHBLXDYLFZANCNFSM6AAAAAAXOFG2PM . You are receiving this because you authored the thread.Message ID: @.***>

Taiko2k commented 1 year ago

Oh right, try pull again sorry

LukeZBaker commented 1 year ago

Start radio http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_radio_three.m3u8 Fetching M3U... Error: local variable 'line' referenced before assignment Extracted URL is: None Failed to extract stream from M3U

Taiko2k commented 1 year ago

Thats weird. Try pull again, hopefully it will give a more detailed error now.

LukeZBaker commented 1 year ago

Tauon Music Box v7.6.5 Copyright 2015-2023 Taiko2k captain.gxj@gmail.com

Window size: [1120, 600] Running in portable mode Found XDG-Downloads: /home/luke/Downloads Found XDG-Music: /home/luke/Music Install directory: /home/luke/TauonMusicBox Database loaded in 0.001 seconds. Pychromecast not found Start controller server Start PHAzOR backend... Using SDL version: 2.26.4 Applying theme: Turbo Start radio http://a.files.bbci.co.uk/media/live/manifesto/audio/simulcast/hls/uk/sbr_high/ak/bbc_radio_three.m3u8 Fetching M3U... Fetching M3U... Extracted URL is: http://as-hls-uk-live.akamaized.net/pool_904/live/uk/bbc_radio_three/bbc_radio_three.isml/bbc_radio_three-audio=320000-262944364.ts No socket to close? Open URL..... URL error... Connection failed local variable 'line' referenced before assignment Start radio failed

Taiko2k commented 1 year ago

Oh right got it. Ok try pull again. Such is the process of debugging.

LukeZBaker commented 1 year ago

HD streams play for a few seconds now, but then stop.

Fetching M3U... Extracted URL is: http://as-hls-uk-live.akamaized.net/pool_904/live/uk/bbc_radio_three/bbc_radio_three.isml/bbc_radio_three-audio=320000-262944452.ts No socket to close? Abort stream connection Exit feeder Open URL..... URL opened. video/MP2T Giving up looking for OGG pages pa: Buffering -> Playing

No other error messages

Taiko2k commented 1 year ago

I see, these streams use segmenting. Agghhhmumblemumblemumble.... Ok I try pull the latest commit. Im 50% sure it will work now.

LukeZBaker commented 1 year ago

Thanks! It works, will test more.

Taiko2k commented 1 year ago

So these are called HLS steams. Parsing them is complicated so what I've done is bypassed some code paths in Tauon and am letting FFMPEG do that parsing work instead. It does mean that recording and song metadata wont work in Tauon for them (not sure if there even is metadata), but at least playback will work.

LukeZBaker commented 1 year ago

Playback seems good.

Probably not important for many re recording. Certainly for the BBC HD streams, recording is best done with get_iplayer.