How to fix the grabber?

Hello!
Trying to write a grabber website bymas.ru
the code itself:
<?php
$url = 'http://bymas.ru/downloads/0';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl,CURLOPT_USERAGENT,'Opera/9.80 (Windows NT 5.1; U; ru) Presto/2.2.15 Version/10.10');
curl_setopt($curl, CURLOPT_REFERER, "http://bymas.ru");
curl_setopt($curl, CURLOPT_RETURNTRANSFER,1);
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
$file = curl_exec($curl);
curl_close($curl);

echo $file;
?>


Page without stopping brushes and brushes and all. MB someone tell me how to solve this problem?
September 26th 19 at 07:31
1 answer
September 26th 19 at 07:33
Solution
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true);try to add after init
does not help. - willy_Reynol commented on September 26th 19 at 07:36
Looked alive.
1) tip for the future - see the page source )
It is evident that there is js that sets the cookie.
2), Respectively add
curl_setopt($curl, CURLOPT_COOKIE, 'bb_mode=1825743668; sid=gjshvnrf6esqq8029halvj9iq0');
and it can be a smart parser that would need to catch, if they change them in the code. - Jordon_Hickle91 commented on September 26th 19 at 07:39
thanks, it works =) - willy_Reynol commented on September 26th 19 at 07:42

Find more questions by tags PHP