SHOUTcast parser not working

Please leave details of any bugs or errors that you encounter
Forum rules
Before posting a bug report please ensure that your profile signature includes relevant details about your setup. To help solve any issues it is recommended that you attach a logfile with logging level set to 8.
User avatar
klaasvaak
Senior Member
Senior Member
Posts: 2229
Joined: Fri Jun 01, 2007 4:32 pm
Location: The Netherlands
Contact:
Netherlands

SHOUTcast parser not working

Postby klaasvaak » Fri Dec 15, 2017 9:27 pm

On my system the SHOUTCAST parser is not working anymore. Is this a generic issue or just mine? And if it's a generic issue, is there any chance on repair... ?

cheers
SwissCenter SVN 1971
Apache 2.2.31 (Unix) / PHP 5.5.38 / MySQL v5.5.51-MariaDB / Linux QNAP 3.4.6 #1
QNAP TS-259 PRO+, firmware: 4.2.2, build 20161214
0PCH A-110/KAIFA EP-6000 firmware: 01-17-110314-15-POP-403 (05-04-2011)
PCH A-210, firmware: 02-04-110519-21-POP-411-000 (27-05-2011)

Image]

User avatar
klaasvaak
Senior Member
Senior Member
Posts: 2229
Joined: Fri Jun 01, 2007 4:32 pm
Location: The Netherlands
Contact:
Netherlands

Re: SHOUTcast parser not working

Postby klaasvaak » Sun Dec 17, 2017 10:49 am

I changed "function shoutcast_played( $host, $port )" into the following:

Code: Select all

  {
    $fp = @fsockopen( $host , $port , $errno , $errstr , 1);
    if (!$fp)
     {
       send_to_log(2, "SHOUTcast connection refused"); // Displays when sever is offline
     }
   else
     {
     fputs($fp, "GET /7.html HTTP/1.0\r\nUser-Agent: Mozilla\r\n\r\n");
    while (!feof($fp))
      {
      $info = fgets($fp);
      }
     $info = str_replace('</body></html>', "", $info);
     $split = explode(',', $info);
     if (empty($split[6]) )
       {
        send_to_log(2, "The current song is not available"); // Displays when sever is online but no song title
       }
     else
      {
      $title = str_replace('\'', '`', $split[6]);
      $title = str_replace(',', ' ', $title);
      $info = explode(' - ', $title);
      
        $tracks[] = array("TITLE" => ucfirst(strtolower($info[1])),
                          "ARTIST" => ucwords(strtolower($info[0])));
      
      return $tracks;
      }
     }
   }

and now it works again... cheers
SwissCenter SVN 1971
Apache 2.2.31 (Unix) / PHP 5.5.38 / MySQL v5.5.51-MariaDB / Linux QNAP 3.4.6 #1
QNAP TS-259 PRO+, firmware: 4.2.2, build 20161214
0PCH A-110/KAIFA EP-6000 firmware: 01-17-110314-15-POP-403 (05-04-2011)
PCH A-210, firmware: 02-04-110519-21-POP-411-000 (27-05-2011)

Image]

User avatar
Pernod
Senior Member
Senior Member
Posts: 4466
Joined: Thu Jan 25, 2007 6:21 am
Location: Croydon, UK
Age: 47
Contact:
Great Britain

Re: SHOUTcast parser not working

Postby Pernod » Sun Dec 17, 2017 12:23 pm

Arrggg! You said the parser was not working so I've been looking in the wrong place, this is the playing screen!

I have no way of testing this as my A200 recently died.
Players : Popcorn A-300 (unused) | Popcorn A-200 (dead) | Popcorn A-100 | Netgear EVA700 (stored)
Webserver : Simese v2.6.5 | Apache 2.2.21 | PHP v5.2.17 | MySQL v5.1.32
Server : Windows 10 Pro 64bit - Intel i7-4770K @4.2GHz - 16GB RAM - 5TB HDD | Synology DS412+
AV : Pioneer VSX-915 | Samsung LE40C650