@milad
@ali.bayat
@mhyeganeh
@hesammousavi
من این سایت را کرال میکنم اما کوکی داره نمیشه و این که میخوام در داخلش سرچ کنم میشه راهنمایی کنید این کد منه
public function proxy_list()
{
$proxy_ip='127.0.0.1'; //proxy IP
$proxy_port = 34; //proxy port
$url = 'https://downsub.com/'; //URL
$data="https://www.youtube.com/watch?v=lSM-9RBk3HQ";//URL for search
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
// curl_setopt($ch, CURLOPT_HEADER, 0); // no headers in the output
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // output to variable
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); // output to variable
curl_setopt($ch, CURLOPT_HTTPPROXYTUNNEL , 1);
curl_setopt($ch, CURLOPT_PROXY, $proxy_ip);
curl_setopt($ch, CURLOPT_PROXYPORT, $proxy_port);
// curl_setopt($ch, CURLOPT_MAXREDIRS, 2);
curl_setopt($ch, CURLOPT_FRESH_CONNECT, 1);
curl_setopt($ch, CURLOPT_TIMEOUT_MS, 300);
curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36");
// curl_setopt($ch, CURLOPT_PROXYTYPE, 'HTTP');or
curl_setopt($ch, CURLOPT_PROXYTYPE, CURLPROXY_HTTP);
curl_setopt($ch, CURLOPT_PROXYAUTH, CURLAUTH_BASIC);
curl_setopt($ch, CURLOPT_VERBOSE, true);
curl_setopt($ch, CURLOPT_TIMEOUT, 300);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 300);
curl_setopt($ch, CURLOPT_REFERER, "");
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); // false for https
curl_setopt($ch, CURLOPT_POST, true);//POST
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);//PosTFIELD
$headers = array();
$headers[] = 'Authority: mc.yandex.ru';
$headers[] = 'User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.116 Safari/537.36';
$headers[] = 'Accept: */*';
$headers[] = 'Origin: https://www.yousubtitles.com';
$headers[] = 'Sec-Fetch-Site: cross-site';
$headers[] = 'Sec-Fetch-Mode: cors';
$headers[] = 'Sec-Fetch-Dest: empty';
$headers[] = 'Referer: https://www.yousubtitles.com/';
$headers[] = 'Accept-Language: fa,en;q=0.9';
$headers[] = 'Cookie: yuidss=3298541131603830130; yandexuid=3298541131603830130; i=h8WiS+brvAfLxKEMdXP+WXvEak44FDlb6H1xL7DPns4q68UpKn56uOvkxK/OYKUhtbW8/B3ffPURunQlDLoYwkppq9M=; ymex=1919193270.yrts.1603833270#1919193269.yrtsi.1603833269; yabs-sid=1518458491603866028';
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$result = curl_exec($ch);
$r=curl_error($ch);
curl_close($ch);
if ($result === FALSE)
die("Error: " . $r);
else
echo $result;
}
این ارور رو میده
We're sorry but DownSub doesn't work properly without JavaScript enabled. Please enable it to continue.
لینک زیر رو بررسی کن
و میتونی کوکی رو بگیری و توی یک فایل تکست ذخیره کنی و ازش استفاده کنی
curl_setopt($ch, CURLOPT_COOKIEJAR, 'cookie.txt');
آیا مایل به ارسال نوتیفیکیشن و اخبار از طرف راکت هستید ؟