Results 1 to 3 of 3

Thread: SHOUTcast - Get stream info

  1. #1

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    SHOUTcast - Get stream info

    I have a Shoutcast stream up and running (http://lime.citrus3.com:8178/)
    And when I try to use the "Shoutcast class" it works fine on my localhost.

    When I upload it to my public web server it gives me a time out error (110) which I'm assuming is due to fsock/fsockopen being disabled.

    I tried doing a work around using cURL, which worked again on my localhost.

    But when I uploaded it to my public web server it just sits there loading, and I think it's trying to download the stream rather then the html page.


    I've tried a few snippets from here and there, and they all work on my localhost, but always seem to fail on my web server.

    This is part of one of the scripts I'm using, which does work (just not on my silly web server)
    PHP Code:
    $mysession curl_init();
    curl_setopt($mysessionCURLOPT_URL"http://$server/admin.cgi?mode=viewxml");
    curl_setopt($mysessionCURLOPT_HEADERfalse);
    curl_setopt($mysessionCURLOPT_RETURNTRANSFERtrue);
    curl_setopt($mysessionCURLOPT_POSTfalse);
    curl_setopt($mysessionCURLOPT_HTTPAUTHCURLAUTH_BASIC);
    curl_setopt($mysessionCURLOPT_USERPWD"admin:$password");
    curl_setopt($mysessionCURLOPT_FOLLOWLOCATIONtrue);
    curl_setopt($mysessionCURLOPT_USERAGENT$_SERVER['HTTP_USER_AGENT']);
    $xml curl_exec($mysession);
    curl_close($mysession); 

    Is there anything i can do to fix this?

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629

    Re: SHOUTcast - Get stream info

    umm, without being able to play with it myself, I probably can't help you. if you PM me whatever $password is supposed to be, I'll try to take a look.

  3. #3

    Thread Starter
    Addicted Member Jazz00006's Avatar
    Join Date
    Feb 2006
    Posts
    185

    Re: SHOUTcast - Get stream info

    I'd rather not if its all the same and you don't need it.


    The page that has the information on it, is "http://lime.citrus3.com:8178/index.html"

    So if you use the above code, and just forget about the admin page, it's something like:

    PHP Code:
    $mysession curl_init();
    curl_setopt($mysessionCURLOPT_URL"http://lime.citrus3.com:8178/index.html");
    curl_setopt($mysessionCURLOPT_HEADERfalse);
    curl_setopt($mysessionCURLOPT_RETURNTRANSFERtrue);
    curl_setopt($mysessionCURLOPT_POSTfalse);
    curl_setopt($mysessionCURLOPT_FOLLOWLOCATIONtrue); //Tried setting this to false too
    $xml curl_exec($mysession);
    curl_close($mysession); 

    echo 
    $xml
    Even defining the port in the cURL options still makes the script download the stream rather then the page. (Only on my stupid web server)


    This is the bit I've been working on. But it still doesn't like it.
    Which is funny, because websites like this: http://www.rexswain.com/httpview.html can get the page source no worries at all.
    PHP Code:
    <?php
        $ch 
    curl_init();
        
    $host "lime.citrus3.com:8178";
        
    //curl_setopt($ch, CURLOPT_PORT, "8178");
        
        
    curl_setopt($chCURLOPT_URL$host);
        
    curl_setopt($chCURLOPT_PROTOCOLSCURLPROTO_HTTP);
        
    curl_setopt($chCURLOPT_HTTPGETtrue);
        
    curl_setopt($chCURLOPT_REFERER"None");
        
        
    curl_setopt($chCURLOPT_HTTP_VERSIONCURL_HTTP_VERSION_1_1);    
        
    curl_setopt($chCURLOPT_ENCODING"ISO-8859-1,UTF-8;q=0.7,*;q=0.7");
        
    curl_setopt($chCURLOPT_USERAGENT"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1)");    
        
    curl_setopt($chCURLOPT_FOLLOWLOCATIONtrue);
        
    curl_setopt($chCURLOPT_FRESH_CONNECTtrue);    
        
    curl_setopt($chCURLOPT_RETURNTRANSFER1);
        
        
    $contents curl_exec ($ch);
        
    curl_close ($ch);

        echo 
    $contents

    ?>
    Last edited by Jazz00006; Jan 31st, 2010 at 04:38 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width