[Hpr] php script to redirect url to an ice cast url

Windigo jacob at fragdev.com
Wed Dec 12 14:10:43 PST 2012


It looks like you can trick the audio player into redirecting if you 
return it a playlist file, instead of a HTTP redirect.

The following code worked when I tried it in VLC, but not in Deadbeef, 
so YMMV:

--Begin Code--
<?php
header('Content-Type: audio/x-scpls');
?>
[playlist]
File1=http://s7.voscast.com:7722/
Title1=Title of the stream
Length1=-1
NumberOfEntries=1
Version=2
--End Code--

Just switch the Stream URL and Title to whatever you like, and you're 
off to the races.

- Windigo



On 2012-12-12 4:29 pm, Bradley Booms wrote:
> Try adding a 301 Moved Permanently/302 Found redirection header? 
> 301's
> should be cached by the client, 302 will do a new look-up each time.
>
> header( "HTTP/1.1 302 Found" );
>
> or doing a .htaccess redirect?
>
>
> On Wed, Dec 12, 2012 at 2:33 PM, Ken Fallon <ken.fallon at gmail.com> 
> wrote:
>> Yes it works in a web browser but not in mplayer or vlc :(
>>
>> On Wed, 12 Dec 2012 11:55:12 -0800 (PST)
>> Matthew K <matt_hew at rocketmail.com> wrote:
>>
>>> You could use a meta tag.
>>>
>>> <meta http-equiv="refresh" content=0;http://s7.voscast.com:7722>
>>>
>>>
>>> --
>>>
>>> Matt
>>>
>>>
>>>
>>> >________________________________
>>> > From: Ken Fallon <ken.fallon at gmail.com>
>>> >To: hpr at hackerpublicradio.org
>>> >Sent: Wednesday, December 12, 2012 12:43 PM
>>> >Subject: [Hpr] php script to redirect url to an ice cast url
>>> >
>>> >Hi All,
>>> >
>>> >Anyone know a way to redirect a URL to a icecast url ?
>>> >
>>> >For example
>>> >
>>> >http://hackerpublicradio.org/mp3/index.php ->
>>> >http://s7.voscast.com:7722
>>> >
>>> >Currently I have but it doesn't redirect cleanly,
>>> >
>>> ><?php
>>> >header( 'Location: http://s7.voscast.com:7722/' );
>>> >?>
>>> >
>>> >
>>> >Any and all help appreciated.
>>> >
>>> >Ken.
>>> >
>>> >_______________________________________________
>>> >Hpr mailing list
>>> >Hpr at hackerpublicradio.org
>>> 
>>> >http://hackerpublicradio.org/mailman/listinfo/hpr_hackerpublicradio.org
>>> >
>>> >
>>> >
>>
>>
>> _______________________________________________
>> Hpr mailing list
>> Hpr at hackerpublicradio.org
>> 
>> http://hackerpublicradio.org/mailman/listinfo/hpr_hackerpublicradio.org
>
> _______________________________________________
> Hpr mailing list
> Hpr at hackerpublicradio.org
> 
> http://hackerpublicradio.org/mailman/listinfo/hpr_hackerpublicradio.org





More information about the Hpr mailing list