Audio/video stream recording forums

Attention Visitor:
You may have to register or log in before you can post:
  • Click the register link to sign up.
  • Registered members please fill in the form below and click the "Log in" button.
To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Audio/video stream recording forums > Streaming audio and video online. Audio and video downloads. > Playing online streaming in media players
Register FAQ Members List Calendar Mark Forums Read

Reply Post New Thread
 
Thread Tools Display Modes
  #1  
Old 10-24-2011, 09:04 AM
karlo2105 karlo2105 is offline
Senior Member
 
Join Date: Sep 2011
Posts: 318
karlo2105 is on a distinguished road
Default

Zapni.TV: make batch file with Zapni.TV channels for opening in VLC


Hello I would like to know how to make a php script for Zapni.tv channels. They use http for streaming with tickets. Here is an example: _www.zapni.tv/play.php?id=240 . My purpose is to make a batchfile with those channels.

I tried with that but it's not opening VLC in batchfile.

Quote:
<?php

$ch = curl_init("http://www.zapni.tv/play.php?id=240");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$page = curl_exec($ch);

preg_match_all('/(http):\/\/(www\.zapni\.tv\/stream\/vlc\.php)\?(.*)/', $page, $matches);

foreach($matches[0] as $v)
{
echo strip_tags($v) . "<br />";
}



?>
Thanks for help.

Last edited by karlo2105 : 10-24-2011 at 09:35 AM.
Reply With Quote
  #2  
Old 10-26-2011, 03:32 AM
KSV KSV is offline
Senior Member
 
Join Date: Apr 2011
Posts: 853
KSV is on a distinguished road
Cool

Re: Zapni.TV: make batch file with Zapni.TV channels for opening in VLC


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
Reply With Quote
  #3  
Old 10-26-2011, 04:54 AM
karlo2105 karlo2105 is offline
Senior Member
 
Join Date: Sep 2011
Posts: 318
karlo2105 is on a distinguished road
Default

Re: Zapni.TV: make batch file with Zapni.TV channels for opening in VLC


No I found this script on this website and I launched vlc in batchfile.

So my command was like that :

Code:
%php% ZapniTV.php
curl "http://www.zapni.tv/play.php?id=240" | %vlc% -
It gave me latest http address but without opening VLC.
So I replaced my script with yours in file ZapniTV.php.
When i launch this command :
Code:
call %php% ZapniTV.php
it asks me to give http address and I have to copy and paste link. After 30 seconds it stops. Is it possible to automatize stream launching because copy/paste isn't very interesting for batchfile. ;-)

Last edited by karlo2105 : 10-26-2011 at 05:55 AM.
Reply With Quote
  #4  
Old 10-26-2011, 06:29 AM
KSV KSV is offline
Senior Member
 
Join Date: Apr 2011
Posts: 853
KSV is on a distinguished road
Cool

Re: Zapni.TV: make batch file with Zapni.TV channels for opening in VLC


in batch file the following command works for me without explicitly asking for url. my script doesn't create any junk file.

Code:
call php ZapniTV.php "http://zapni.tv/play.php?id=240"
Reply With Quote
  #5  
Old 10-26-2011, 06:39 AM
karlo2105 karlo2105 is offline
Senior Member
 
Join Date: Sep 2011
Posts: 318
karlo2105 is on a distinguished road
Default

Re: Zapni.TV: make batch file with Zapni.TV channels for opening in VLC


Thanks that's working great. ;-)
Reply With Quote
Reply Post New Thread
Tags: , , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 04:41 AM.


Powered by All-streaming-media.com; 2006-2011
vB forum hacked with Zoints add-ons