Note that there are some explanatory texts on larger screens.

plurals
  1. POEmbebed player can't connect to the network - CURL
    primarykey
    data
    text
    <p>I've made, using CURL, script that log in to the page which provides free streaming, then with CURL I'm going to subpage with choosen stream to watch. </p> <p>Everything works fine while script is running via localhost (I'm using xampp), but when I put it on my web server it says that it can't connect to the network. Only thing that looks different is the cookie, on the web server it has not new lines /n. Everything is in one line. </p> <p>How to deal with it? This is my class, which i use to connect with page:</p> <pre><code>class openTV { public $channel; function __construct($channel) { $this -&gt; channel = $channel; } function openChannel() { $login_email = 'mail@gmail.com'; $login_pass = 'pass'; $fp = fopen("cookie.txt", "w"); fclose($fp); $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://strona/user/login'); curl_setopt($ch, CURLOPT_POSTFIELDS,'email='.urlencode($login_email).'&amp;password='.urlencode($login_pass)); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_HEADER, 0); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt'); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3"); curl_setopt($ch, CURLOPT_REFERER, "http://strona/user/login"); $page = curl_exec($ch); curl_setopt($ch, CURLOPT_URL, $this-&gt;channel); curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3"); curl_setopt($ch, CURLOPT_REFERER, $this-&gt;channel); curl_setopt($ch, CURLOPT_COOKIEFILE, 'cookie.txt'); curl_setopt($ch, CURLOPT_POST, 0); $info = curl_getinfo ($ch); $page = curl_exec($ch); preg_match('/session_token=\[[a-zA-Z0-9]{8}\]/', $page, $matches); $return['token'] = substr($matches[0], 31, 8); preg_match('/&lt;object(.*)&gt;[.\s\S]*&lt;\/object&gt;/', $page, $matches); $return['player'] = $matches[0]; //$return['player'] = $page; $return['channel'] = $this-&gt;channel; return $return; } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload