XMLHttpRequest cannot load / shoutcast

Greetings,

 

I'm in the process of creating a couple channels - and am learning both Python and the Plug-In interface at the same time... so I could very easily be doing something wrong.  I used a combination of 'FeedMe' and the YouTube sample code that was previously posted to this Forum.

 

I've got navigation working well enough for now (in some cases the Thumbnails aren't showing up - still tracking that down).   But the main problem is the streams are not playing.  Whenever trying to play a stream or file (podcast), I get the following error in the Browser's error console :

 

     XMLHttpRequest cannot load http://host/dir/file.m3u8. Origin http://127.0.0.1:32400 is not allowed by Access-Control-Allow-Origin

 

I tried this on some streams located on one of my servers and I see this in the apache log - 

 

 

     71.57.x.x - - [30/Mar/2013:16:18:12 -0400] "OPTIONS /dir/file.m3u8 HTTP/1.1" 200 230 "http://127.0.0.1:32400/web/index.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/536.28.10 (KHTML, like Gecko) Version/6.0.3 Safari/536.28.10"
 
There is nothing in the apache error log.
 
Separately, I've got another plugin that plays audio podcasts and just fine (using a combination of OPML and RSS as sources - the base code is purely Feed Me).   The audio streams play fine, however none of the shoutcast channels are playing.   The player appears to start but nothing plays.
 
I'm running the latest PlexPass server release  on a Mac.
 
Any help/pointers is greatly appreciated.
 
Thanks,
Pax.
 
 

It might be worth your while to check out the code of the existing ShoutCast plugin. As I recall, the "shoutcast" protocol is not explicitly supported by PMS but it's fairly simple to parse for the actual file url.

The code is on github here.

In regards to your first question, are the files hosted locally?

 

I had taken a look at the shoutcast bundle and used some of the code (sorry for not mentioning it, I did that work a few weeks ago..)    The extra bit I should have mentioned is that the shoutcast bundle is not working for me either - I have not been able to play any of the streams in that bundle.   I've tried with Safari/Mac, Android and iOS.

As to your question on servers, the .m3u8 I referenced in the previous message is on a server at the office (with an external IP address).   I have the same browser error when going against that server as well as hulu, cnn and other servers.  

Thanks,

Pax.

If you're having issues accessing with ShoutCast, Hulu, and CNN as well as your office server, it seems to me that there is something wrong with your setup beyond just a little bit of buggy channel code.

Ok, I'll be happy for it to be an installation problem...   I just did a fresh install of the latest PlexPass release (.19) on a Mac running the latest OSX (laptop is running an i7, 16GB, and lightly loaded).   I've also tried this on a Win8 machine as well with the same results, but its easier for me to work on the Mac.

Using the latest Shoutcast plug-in, I get the following in the Plex Media Server log.   The messages are essentially the same regardless of using iOS, Android or Web based clients.  And I've tried this both at the office and at home with similar results.   

Apr 01, 2013 12:36:36 [0xb0185000] DEBUG - Request: GET /music/:/transcode/generic.mp3?format=mp3&audioCodec=libmp3lame&audioBitrate=256&url=http%3A%2F%2F127.0.0.1%3A32400%2Fmusic%2Fshoutcast%2F%3A%2Ffunction%2FPlayAudio.mp3%3Ffunction_args%3DY2VyZWFsMQoxCmRpY3QKMQpzNzcKaHR0cDovL3lwLnNob3V0Y2FzdC5jb20vc2Jpbi90dW5laW4tc3RhdGlvbi5wbHM%2540aWQ9MTQxMjQwOSZrPXNoMXQ3aHluM0toMGpobFZzMwp1cmxyMAo_&session=4DA1F911-6592-44D8-BB0B-AB5BCBAE592D&X-Plex-Client-Capabilities=protocols%3Dhttp-live-streaming%2Chttp-mp4-streaming%2Chttp-streaming-video%2Chttp-streaming-video-720p%2Chttp-mp4-video%2Chttp-mp4-video-720p%3BvideoDecoders%3Dh264%7Bprofile%3Ahigh%26resolution%3A1080%26level%3A41%7D%3BaudioDecoders%3Dmp3%2Caac%7Bbitrate%3A160000%7D&X-Plex-Device=iPhone&X-Plex-Token=KezsW7JFARfpox9cSZ9J&X-Plex-Client-Platform=iOS&X-Plex-Device-Name=Garry%20M.%20Paxinos%E2%80%99s%20iPhone%205&X-Plex-Model=5%2C1&X-Plex-Platform=iOS&X-Plex-Client-Identifier=4DA1F911-6592-44D8-BB0B-AB5BCBAE592D&X-Plex-Product=Plex%2FiOS&X-Plex-Platform-Version=6.1.3&X-Plex-Version=3.1.1 [172.16.105.83:59440] (1 live)
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * format => mp3
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * audioCodec => libmp3lame
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * audioBitrate => 256
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * url => http://127.0.0.1:32400/music/shoutcast/:/function/PlayAudio.mp3?function_args=Y2VyZWFsMQoxCmRpY3QKMQpzNzcKaHR0cDovL3lwLnNob3V0Y2FzdC5jb20vc2Jpbi90dW5laW4tc3RhdGlvbi5wbHM%40aWQ9MTQxMjQwOSZrPXNoMXQ3aHluM0toMGpobFZzMwp1cmxyMAo_
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * session => 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * X-Plex-Client-Capabilities => protocols=http-live-streaming,http-mp4-streaming,http-streaming-video,http-streaming-video-720p,http-mp4-video,http-mp4-video-720p;videoDecoders=h264{profile:high&resolution:1080&level:41};audioDecoders=mp3,aac{bitrate:160000}
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * X-Plex-Device => iPhone
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * X-Plex-Token => KezsW7JFARfpox9cSZ9J
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * X-Plex-Client-Platform => iOS
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * X-Plex-Device-Name => Garry M. Paxinos’s iPhone 5
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * X-Plex-Model => 5,1
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * X-Plex-Platform => iOS
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * X-Plex-Client-Identifier => 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * X-Plex-Product => Plex/iOS
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * X-Plex-Platform-Version => 6.1.3
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG -  * X-Plex-Version => 3.1.1
Apr 01, 2013 12:36:36 [0xb0185000] VERBOSE - [IDLE] Adding (0->1) work item transcoder - 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D
Apr 01, 2013 12:36:36 [0xb0185000] VERBOSE - [IDLE] Server is now active
Apr 01, 2013 12:36:36 [0xb0185000] VERBOSE - [IDLE] * transcoder - 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D - 1 active item(s)
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG - Cleaning directory for session 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D (/var/folders/53/rxs_s65d6jg7crxgjq88gmm80000gn/T/plex-transcode-4DA1F911-6592-44D8-BB0B-AB5BCBAE592D-154c39b1-99d0-4977-8b99-7d65495a9519)
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG - Starting a transcode session 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D at offset -1.0 (stopped=1)
Apr 01, 2013 12:36:36 [0xb0185000] VERBOSE - [Event] Firing plex.event.transcodesessionmanager.sessionstarted to 0 sink(s)
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG - Job running: /Applications/Plex Media Server.app/Contents/Resources/Plex Transcoder -i http://127.0.0.1:32400/music/shoutcast/:/function/PlayAudio.mp3?function_args=Y2VyZWFsMQoxCmRpY3QKMQpzNzcKaHR0cDovL3lwLnNob3V0Y2FzdC5jb20vc2Jpbi90dW5laW4tc3RhdGlvbi5wbHM%40aWQ9MTQxMjQwOSZrPXNoMXQ3aHluM0toMGpobFZzMwp1cmxyMAo_ -async 1 -f mp3 -acodec libmp3lame -ar 48000 -ab 256k -ac 2 -threads 0 - 
Apr 01, 2013 12:36:36 [0xb0185000] DEBUG - Started session successfully, now saving it: 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D
Apr 01, 2013 12:36:36 [0xb071b000] DEBUG - Started generic transcode output thread
Apr 01, 2013 12:36:36 [0xb0185000] VERBOSE - [IDLE] Adding (0->1) work item http_download - /music/:/transcode/generic.mp3?format=mp3&audioCodec=libmp3lame&audioBitrate=256&url=http%3A%2F%2F127.0.0.1%3A32400%2Fmusic%2Fshoutcast%2F%3A%2Ffunction%2FPlayAudio.mp3%3Ffunction_args%3DY2VyZWFsMQoxCmRpY3QKMQpzNzcKaHR0cDovL3lwLnNob3V0Y2FzdC5jb20vc2Jpbi90dW5laW4tc3RhdGlvbi5wbHM%2540aWQ9MTQxMjQwOSZrPXNoMXQ3aHluM0toMGpobFZzMwp1cmxyMAo_&session=4DA1F911-6592-44D8-BB0B-AB5BCBAE592D&X-Plex-Client-Capabilities=protocols%3Dhttp-live-streaming%2Chttp-mp4-streaming%2Chttp-streaming-video%2Chttp-streaming-video-720p%2Chttp-mp4-video%2Chttp-mp4-video-720p%3BvideoDecoders%3Dh264%7Bprofile%3Ahigh%26resolution%3A1080%26level%3A41%7D%3BaudioDecoders%3Dmp3%2Caac%7Bbitrate%3A160000%7D&X-Plex-Device=iPhone&X-Plex-Token=KezsW7JFARfpox9cSZ9J&X-Plex-Client-Platform=iOS&X-Plex-Device-Name=Garry%20M.%20Paxinos%E2%80%99s%20iPhone%205&X-Plex-Model=5%2C1&X-Plex-Platform=iOS&X-Plex-Client-Identifier=4DA1F911-6592-44D8-BB0B-AB5BCBAE592D&X-Plex-Product=Plex%2FiOS&X-Plex-Platform-Version=6.1.3&X-Plex-Version=3.1.1
Apr 01, 2013 12:36:36 [0xb0185000] VERBOSE - [IDLE] * http_download - /music/:/transcode/generic.mp3?format=mp3&audioCodec=libmp3lame&audioBitrate=256&url=http%3A%2F%2F127.0.0.1%3A32400%2Fmusic%2Fshoutcast%2F%3A%2Ffunction%2FPlayAudio.mp3%3Ffunction_args%3DY2VyZWFsMQoxCmRpY3QKMQpzNzcKaHR0cDovL3lwLnNob3V0Y2FzdC5jb20vc2Jpbi90dW5laW4tc3RhdGlvbi5wbHM%2540aWQ9MTQxMjQwOSZrPXNoMXQ3aHluM0toMGpobFZzMwp1cmxyMAo_&session=4DA1F911-6592-44D8-BB0B-AB5BCBAE592D&X-Plex-Client-Capabilities=protocols%3Dhttp-live-streaming%2Chttp-mp4-streaming%2Chttp-streaming-video%2Chttp-streaming-video-720p%2Chttp-mp4-video%2Chttp-mp4-video-720p%3BvideoDecoders%3Dh264%7Bprofile%3Ahigh%26resolution%3A1080%26level%3A41%7D%3BaudioDecoders%3Dmp3%2Caac%7Bbitrate%3A160000%7D&X-Plex-Device=iPhone&X-Plex-Token=KezsW7JFARfpox9cSZ9J&X-Plex-Client-Platform=iOS&X-Plex-Device-Name=Garry%20M.%20Paxinos%E2%80%99s%20iPhone%205&X-Plex-Model=5%2C1&X-Plex-Platform=iOS&X-Plex-Client-Identifier=4DA1F911-6592-44D8-BB0B-AB5BCBAE592D&X-Plex-Product=Plex%2FiOS&X-Plex-Platform-Version=6.1.3&X-Plex-Version=3.1.1 - 1 active item(s)
Apr 01, 2013 12:36:36 [0xb0185000] VERBOSE - [IDLE] * transcoder - 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D - 1 active item(s)
Apr 01, 2013 12:36:36 [0xb081f000] DEBUG - [TranscodeOutputStream] Input processing thread started at offset 0 for -1 bytes.
Apr 01, 2013 12:36:36 [0xb0185000] VERBOSE - Completed request: GET /music/:/transcode/generic.mp3?format=mp3&audioCodec=libmp3lame&audioBitrate=256&url=http%3A%2F%2F127.0.0.1%3A32400%2Fmusic%2Fshoutcast%2F%3A%2Ffunction%2FPlayAudio.mp3%3Ffunction_args%3DY2VyZWFsMQoxCmRpY3QKMQpzNzcKaHR0cDovL3lwLnNob3V0Y2FzdC5jb20vc2Jpbi90dW5laW4tc3RhdGlvbi5wbHM%2540aWQ9MTQxMjQwOSZrPXNoMXQ3aHluM0toMGpobFZzMwp1cmxyMAo_&session=4DA1F911-6592-44D8-BB0B-AB5BCBAE592D: -2
Apr 01, 2013 12:36:36 [0xb0081000] DEBUG - Request: GET /music/shoutcast/:/function/PlayAudio.mp3?function_args=Y2VyZWFsMQoxCmRpY3QKMQpzNzcKaHR0cDovL3lwLnNob3V0Y2FzdC5jb20vc2Jpbi90dW5laW4tc3RhdGlvbi5wbHM%40aWQ9MTQxMjQwOSZrPXNoMXQ3aHluM0toMGpobFZzMwp1cmxyMAo_ [127.0.0.1:60672] (2 live)
Apr 01, 2013 12:36:36 [0xb0081000] DEBUG -  * function_args => Y2VyZWFsMQoxCmRpY3QKMQpzNzcKaHR0cDovL3lwLnNob3V0Y2FzdC5jb20vc2Jpbi90dW5laW4tc3RhdGlvbi5wbHM@aWQ9MTQxMjQwOSZrPXNoMXQ3aHluM0toMGpobFZzMwp1cmxyMAo_
Apr 01, 2013 12:36:36 [0xb0081000] DEBUG - Plug-in com.plexapp.plugins.shoutcast has been used 86 times.
Apr 01, 2013 12:36:36 [0xb0081000] DEBUG - [com.plexapp.plugins.shoutcast] Sending command over HTTP (GET): /music/shoutcast/:/function/PlayAudio.mp3?function_args=Y2VyZWFsMQoxCmRpY3QKMQpzNzcKaHR0cDovL3lwLnNob3V0Y2FzdC5jb20vc2Jpbi90dW5laW4tc3RhdGlvbi5wbHM%40aWQ9MTQxMjQwOSZrPXNoMXQ3aHluM0toMGpobFZzMwp1cmxyMAo_
Apr 01, 2013 12:36:36 [0xb0081000] DEBUG - HTTP requesting to: http://127.0.0.1:59896/music/shoutcast/:/function/PlayAudio.mp3?function_args=Y2VyZWFsMQoxCmRpY3QKMQpzNzcKaHR0cDovL3lwLnNob3V0Y2FzdC5jb20vc2Jpbi90dW5laW4tc3RhdGlvbi5wbHM%40aWQ9MTQxMjQwOSZrPXNoMXQ3aHluM0toMGpobFZzMwp1cmxyMAo_
Apr 01, 2013 12:36:36 [0xb0081000] DEBUG - [com.plexapp.plugins.shoutcast] HTTP reply status 302, with 0 bytes of content.
Apr 01, 2013 12:36:36 [0xb0081000] VERBOSE - Completed request: GET /music/shoutcast/:/function/PlayAudio.mp3?function_args=Y2VyZWFsMQoxCmRpY3QKMQpzNzcKaHR0cDovL3lwLnNob3V0Y2FzdC5jb20vc2Jpbi90dW5laW4tc3RhdGlvbi5wbHM%40aWQ9MTQxMjQwOSZrPXNoMXQ3aHluM0toMGpobFZzMwp1cmxyMAo_: 302
Apr 01, 2013 12:36:36 [0xb071b000] DEBUG - Generic transcode session finished reading output.
Apr 01, 2013 12:36:36 [0xb071b000] DEBUG - Finished generic transcode output thread
Apr 01, 2013 12:36:36 [0xb071b000] DEBUG - Notifying stream that data is complete.
Apr 01, 2013 12:36:36 [0xb081f000] DEBUG - [TranscodeOutputStream] Input processing thread exited after writing 0 bytes, m_closed=0, m_endOfFileReached=1, session->isStopped()=0
Apr 01, 2013 12:36:36 [0xb040f000] DEBUG - [TranscodeOutputStream] Reached end of file
Apr 01, 2013 12:36:36 [0xb040f000] VERBOSE - [TranscodeOutputStream] Told to teardown
Apr 01, 2013 12:36:36 [0xb040f000] DEBUG - Removed transcode output stream 0x42a7400, active count 1 => 0
Apr 01, 2013 12:36:36 [0xb040f000] VERBOSE - [IDLE] Removing (1->0) work item http_download - /music/:/transcode/generic.mp3?format=mp3&audioCodec=libmp3lame&audioBitrate=256&url=http%3A%2F%2F127.0.0.1%3A32400%2Fmusic%2Fshoutcast%2F%3A%2Ffunction%2FPlayAudio.mp3%3Ffunction_args%3DY2VyZWFsMQoxCmRpY3QKMQpzNzcKaHR0cDovL3lwLnNob3V0Y2FzdC5jb20vc2Jpbi90dW5laW4tc3RhdGlvbi5wbHM%2540aWQ9MTQxMjQwOSZrPXNoMXQ3aHluM0toMGpobFZzMwp1cmxyMAo_&session=4DA1F911-6592-44D8-BB0B-AB5BCBAE592D&X-Plex-Client-Capabilities=protocols%3Dhttp-live-streaming%2Chttp-mp4-streaming%2Chttp-streaming-video%2Chttp-streaming-video-720p%2Chttp-mp4-video%2Chttp-mp4-video-720p%3BvideoDecoders%3Dh264%7Bprofile%3Ahigh%26resolution%3A1080%26level%3A41%7D%3BaudioDecoders%3Dmp3%2Caac%7Bbitrate%3A160000%7D&X-Plex-Device=iPhone&X-Plex-Token=KezsW7JFARfpox9cSZ9J&X-Plex-Client-Platform=iOS&X-Plex-Device-Name=Garry%20M.%20Paxinos%E2%80%99s%20iPhone%205&X-Plex-Model=5%2C1&X-Plex-Platform=iOS&X-Plex-Client-Identifier=4DA1F911-6592-44D8-BB0B-AB5BCBAE592D&X-Plex-Product=Plex%2FiOS&X-Plex-Platform-Version=6.1.3&X-Plex-Version=3.1.1
Apr 01, 2013 12:36:36 [0xb040f000] VERBOSE - [IDLE] * transcoder - 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D - 1 active item(s)
Apr 01, 2013 12:36:42 [0xb09a5000] DEBUG - Shutting down idle session 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D (idle time is 180 seconds)
Apr 01, 2013 12:36:42 [0xb09a5000] DEBUG - Stopping transcode session 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D
Apr 01, 2013 12:36:42 [0xb09a5000] DEBUG - Killing job.
Apr 01, 2013 12:36:42 [0xb09a5000] DEBUG - Signalling job ID 22878 with 9
Apr 01, 2013 12:36:42 [0xb09a5000] DEBUG - Cleaning directory for session 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D (/var/folders/53/rxs_s65d6jg7crxgjq88gmm80000gn/T/plex-transcode-4DA1F911-6592-44D8-BB0B-AB5BCBAE592D-154c39b1-99d0-4977-8b99-7d65495a9519)
Apr 01, 2013 12:36:42 [0xb09a5000] VERBOSE - [IDLE] Removing (1->0) work item transcoder - 4DA1F911-6592-44D8-BB0B-AB5BCBAE592D
Apr 01, 2013 12:36:42 [0xb09a5000] VERBOSE - [IDLE] Server is now idle
Apr 01, 2013 12:36:42 [0xb09a5000] VERBOSE - [Event] Firing plex.event.transcodesessionmanager.idle to 0 sink(s)
Apr 01, 2013 12:36:42 [0xb09a5000] DEBUG - Whacked session, 0 remaining.
Apr 01, 2013 12:36:42 [0xb09a5000] DEBUG - Killed 1 idle sessions, and 0 remain.

OK. I was able to confirm that at least part of the issue is that since audio transcoding capabilities have been made available, the Shoutcast plugin doesn't return enough data for the clients to determine whether the media is direct playable. The desktop client direct plays the streams and iOS etc. are capable of it as well but, they request that the streams be transcoded due to uncertainty. I'm not sure why the transcode fails. That is still a mystery to me. I hope to be able to upgrade the shoutcast plugin to correct the issue soon. I wonder if the other problems you're having also relate to the transcoder. Have you tried switching the new "Universal Transcoder" on/off in the client settings and comparing results?

Unfortunately the option for the Universal Transcoder is only for Video.  I've turned it off, and am still starting a transcode when trying to play a shoutcast stream - it appears from the logfile the same transcoder is running (URL and options are reasonably alike)

Looking forward to seeing your changes to the shoutcast plugin.

However, turning off the Universal Transcoder is working for the content from my video server, Thanks!!     Not all of the other content is playing, but it is a great start and helps quite a bit.

Thanks,

Pax.

Ya, theoretically most clients shouldn't need transcoding for Shoutcast streams. The underlying format is almost always MP3 or AAC. The issue with the plugin is that it doesn't specify the codec details. The clients rely on that info to determine whether they should attempt to direct play the media. Prior to audio transcoding being available, it didn't matter since the only option was to attempt to direct play which (usually) worked.

I guess this sort of thing is a good example of why the new "Universal Transcoder" is still in the experimental stage B)   

I (with Sander's help) spent more time on than expected this past weekend getting the ShoutCast plugin working again across platforms. It *should* work for you now. The code is still available on Github at the link I gave previously, if you want to see how it's implemented.

The Universal Transcoder is still being upgraded regularly so, it's likely the other issues will get ironed out. However, if you are interested in helping get things sorted out, I would suggest making a post in the PMS forum for your platform describing the issues you see between the Universal Transcoder and the "Old" transcoder. Providing as much detail as possible (ie. the channels that work with old transcoder vs new, the Media Info for local content that works with old transcoder vs. new, etc) makes the best bug report and more likely to have the issue resolved.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.