Attempting to Open URL for online streaming

#1

Hello
i am having issues getting HTTPS URL’s to load. it seems like kodi is re-opening the URL and malforming it in the process. trying the connections as HTTP and not HTTPS. I am wondering if it is possible to to disable the reopening process? HTTP links seems to work but the issue is that the API only offers HTTPS

if i send the following the kodi will play the audio
kodi-send --action=‘PlayMedia(http://16843.live.streamtheworld.com/WUOMFM_SC,0)’

this link does not work
kodi-send --action=‘PlayMedia(https://ice2.wmuk.org:8443/mp31)’

produces the following debug
20:27:38.897 T:1925548544 DEBUG: CFileCache::Open - opening using cache
20:27:38.897 T:1925548544 DEBUG: CurlFile::Open(0x53ecd20) https://ice2.wmuk.org:8443/mp31
20:27:38.902 T:1506788096 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)RcvMessageLength: 82
20:27:38.902 T:1506788096 DEBUG: AddOnLog: MythTV PVR Client: (CPPMyth)RcvBackendMessage: UPDATE_FILE_SIZE 1564 2019-05-13T00:00:00Z 603041208 (4)
20:27:39.469 T:1925548544 DEBUG: CCurlFile::Open - File https://ice2.wmuk.org:8443/mp31 is a shoutcast stream. Re-opening
20:27:39.469 T:1925548544 DEBUG: File::Open - redirecting implementation for https://ice2.wmuk.org:8443/mp31
20:27:39.486 T:1925548544 DEBUG: CurlFile:TonguearseAndCorrectUrl() adding custom header option ‘Icy-MetaData: 1’
20:27:39.486 T:1925548544 DEBUG: CurlFile::Open(0x6adab58) http://ice2.wmuk.org:8443/mp31
20:27:39.487 T:1925548544 INFO: easy_aquire - Created session to http://ice2.wmuk.org
20:27:39.677 T:1925548544 ERROR: CCurlFile::FillBuffer - Failed: HTTP returned error 400
20:27:39.677 T:1925548544 ERROR: CCurlFile::Open failed with code 400 for http://ice2.wmuk.org:8443/mp31|&noshout=...MetaData=1
20:27:39.677 T:1180693248 DEBUG: Thread ShoutcastFile start, auto delete: false
20:27:39.677 T:1180693248 DEBUG: Thread ShoutcastFile 1180693248 terminating
20:27:39.677 T:1925548544 ERROR: Open - failed to open source https://ice2.wmuk.org:8443/mp31
20:27:39.677 T:1925548544 ERROR: Init: Error opening file https://ice2.wmuk.org:8443/mp31
20:27:39.678 T:1925548544 ERROR: CAudioDecoder: Unable to Init Codec while loading file https://ice2.wmuk.org:8443/mp31
20:27:39.678 T:1925548544 WARNING: PAPlayer::QueueNextFileEx - Failed to create the decoder

#2

The root cause is that when you first go to https://ice2.wmuk.org, for some reason the code then redirects you to http://ice2.wmuk.org – presumably with a view to adding custom header option ‘Icy-MetaData: 1’. It’s not clear why it then drops the TLS part but the site doesn’t accept connections over plain http, so it fails.

BTW, the first site seems to accept both http and https connections.

#3

is there any any to prevent OSMC from doing this? or a fourm i can post in to get more info? i cant relay on just using a http link as the API i am trying to use presents the links with 443/8443 in the URL so redirecting to HTTP will break it every time.

example playlist https://playerservices.streamtheworld.com/pls/WUOMFM.pls
File1=https://18093.live.streamtheworld.com:443/WUOMFM_SC
File2=https://20803.live.streamtheworld.com:443/WUOMFM_SC
File3=https://17003.live.streamtheworld.com:443/WUOMFM_SC

#4

I’d suggest that you try the Kodi forum, https://forum.kodi.tv . It might be a bug in the code or a design decision; I’ve no way of knowing.

If I have time this evening, I’ll see if I can locate the relevant code, though if anyone else is able to chip in, then please do so.

#5

The same thing happened with me when I was going to use the application after the install itunes on windows 7 it was showing the same error whenever I was going to play any song.

#6

A quick update. Looking at the code, once it thinks it’s getting a shoutcast stream, it calls ShoutcastFile.cpp. Line 60 says:

url2.SetProtocol("http");

so it’s deliberately choosing http to open a Shoutcast stream. The code looks to pre-date the (post-Snowden) move towards sending everything over https.

Finally, I came across a piece of RasPlex code that seems to address the issue (lines 76 and 77):

  if (url2.GetProtocol() != "http" && url2.GetProtocol() != "https")
    url2.SetProtocol("http");

so it looks like Kodi is probably broken.

#7

well that is a bummer. I guess i will have edit the play list before trying to play the sream. Thank you for the help!