wouterdebie / locast2tuner

Locast to Emby/Plex/Channels server
https://wouterdebie.github.io/locast2tuner/
MIT License
52 stars 8 forks source link

Application quit after receiving HTTP 500 #43

Closed jg-24 closed 3 years ago

jg-24 commented 3 years ago

Using locast2tuner 0.1.30 on Darwin 20.3.0

This looks like an opportunity to enhance exception handling and may not be anything that can be replicated easily. It doesn't appear there was anything in particular that triggered this event, likely something in the upstream locast network that got overwhelmed during high usage.

...

Apr 22 17:01:09.424 INFO Serving https://sea.locastnet.org/proxy/sea/kiro3161913831.ts (10 s) in 9.619995s
Apr 22 17:01:19.309 INFO Stream 7b22e62 - playing: segment "https://sea.locastnet.org/proxy/sea/kiro3161913831.ts"
Apr 22 17:01:19.449 INFO Stream 7b22e62 - added segment "https://sea.locastnet.org/proxy/sea/kiro3161913840.ts"
Apr 22 17:01:19.449 INFO Stream 7b22e62 - draining 10 segments
Apr 22 17:01:19.449 INFO Serving https://sea.locastnet.org/proxy/sea/kiro3161913832.ts (10 s) in 9.595947s
Apr 22 17:01:29.321 INFO Stream 7b22e62 - playing: segment "https://sea.locastnet.org/proxy/sea/kiro3161913832.ts"
Apr 22 17:01:29.471 INFO Stream 7b22e62 - added segment "https://sea.locastnet.org/proxy/sea/kiro3161913841.ts"
Apr 22 17:01:29.471 INFO Serving https://sea.locastnet.org/proxy/sea/kiro3161913833.ts (10 s) in 9.572998s
Apr 22 17:01:39.409 INFO Stream 7b22e62 - playing: segment "https://sea.locastnet.org/proxy/sea/kiro3161913833.ts"
Apr 22 17:01:39.578 INFO Stream 7b22e62 - added segment "https://sea.locastnet.org/proxy/sea/kiro3161913842.ts"
Apr 22 17:01:39.578 INFO Serving https://sea.locastnet.org/proxy/sea/kiro3161913834.ts (10 s) in 9.465942s
Apr 22 17:01:49.332 INFO Stream 7b22e62 - playing: segment "https://sea.locastnet.org/proxy/sea/kiro3161913834.ts"
Apr 22 17:01:49.475 INFO Stream 7b22e62 - added segment "https://sea.locastnet.org/proxy/sea/kiro3161913843.ts"
Apr 22 17:01:49.475 INFO Serving https://sea.locastnet.org/proxy/sea/kiro3161913835.ts (10 s) in 9.56897s
Apr 22 17:01:59.276 INFO Stream 7b22e62 - playing: segment "https://sea.locastnet.org/proxy/sea/kiro3161913835.ts"
Apr 22 17:02:06.073 WARN Unable to fetch media playlist, stopping stream.. expected `#EXTM3U` at the start of "{\"code\":500,\"message\":\"There was an error processing your request. It has been logged (ID ef41d566ef65cf96).\"}"
wouterdebie commented 3 years ago

One of the things we could do is to just serve the next segment and ignore the error. Once all known segments are depleted we stop the stream.

jg-24 commented 3 years ago

1 week with the same version running and this hasn't happened again. I'd say any exception handling to try and account for the HTTP 500 response would be fine to close this and wait to see if it happens again.