is the above posted code fragment your whole script? i can't see where are you even launching vlc? here is the full script which will work with vlc streams available on the site.
Code:
<?php
echo "KSV ZapniTV Downloader\n";
$format = "%-8s : %s\n";
function runAsync($command)
{
$WshShell = new COM("WScript.Shell");
$oExec = $WshShell->Run($command, 1, false);
unset($WshShell, $oExec);
}
if ($argc <= 1)
{
echo "Enter URL : ";
$url = trim(fgets(STDIN));
}
else
$url = $argv[1];
echo "Retrieving html . . .\n";
$html = file_get_contents($url);
preg_match('/<a.*?>(.*?[vlc|vlc_2].php.*?)<\/a>/i', $html, $links);
if (file_exists("C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe"))
$vlc = "C:\\Program Files (x86)\\VideoLAN\\VLC\\vlc.exe";
else
$vlc = "C:\\Program Files\\VideoLAN\\VLC\\vlc.exe";
if (isset($links[1]))
{
$command = "\"$vlc\" \"$links[1]\"";
printf($format, "Command", $command);
runAsync($command);
}
echo "Finished.\n";
?>
Code:
http://www.mediafire.com/file/xdp7efl44fjv74f/KSV%20-%20ZapniTV.zip