<?php
$URL = 'https://www.vseinstrumenti.ru/instruction/1486389_manual.docx';
$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $URL);
$headers = [
'authority: www.vseinstrumenti.ru',
'accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7',
'accept-language: ru-RU,ru;q=0.9,en-US;q=0.8,en;q=0.7',
'cookie: shouldBeSaleTeaser=1; showAdminPanel=1; showChooseShopNote=1; is-visited=1; favToken=SuapUN3kaV1MRv3CaADxU4A0F8Df70h7; rrpvid=65117632021305; device_uid=AHZ4lLiB3XmG8f7UZXH3L2vqOV0Q0SmhfF2Q8p6Zfw7rOGvR9gK0I2rJo4C6UxD4; _ga=GA1.1.583074507.1687726942; _gcl_au=1.1.2146863371.1687726943; ab_exps=%7B%22237%22%3A5%2C%22243%22%3A9%2C%22245%22%3A0%2C%22248%22%3A3%2C%22249%22%3A1%2C%22262%22%3A0%2C%22280%22%3A3%2C%22362%22%3A0%2C%22368%22%3A0%2C%22380%22%3A3%2C%22408%22%3A3%2C%22415%22%3A2%2C%22462%22%3A1%2C%22468%22%3A1%2C%22493%22%3A3%2C%22523%22%3A2%2C%22535%22%3A0%2C%22541%22%3A0%2C%22547%22%3A1%2C%22553%22%3A0%2C%22559%22%3A2%2C%22565%22%3A3%2C%22589%22%3A0%2C%22595%22%3A0%2C%22607%22%3A4%2C%22613%22%3A4%2C%22619%22%3A2%2C%22625%22%3A2%2C%22631%22%3A1%2C%22637%22%3A2%2C%22643%22%3A0%2C%22649%22%3A1%2C%22655%22%3A0%2C%22656%22%3A1%2C%22662%22%3A1%2C%22668%22%3A2%2C%22698%22%3A1%2C%22710%22%3A0%2C%22721%22%3A2%2C%22739%22%3A0%2C%22771%22%3A0%2C%22777%22%3A0%2C%22802%22%3A1%2C%22808%22%3A0%2C%22818%22%3A4%2C%22849%22%3A4%2C%22855%22%3A5%2C%22885%22%3A3%7D; vi_represent_id=-1; vi_represent_type=common; vi_features=%7B%22listing-delivery-dates%22%3A%220%22%7D; wucf=7; acctoken=eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJ2aXRlY2giLCJhdWQiOiJ2c2VpbnN0cnVtZW50aS5ydSIsImlhdCI6MTY4Nzc2ODc2NywiZXhwIjoxNjg3NzcyMzY3LCJkZXZpZCI6IjViMjdkZmIzLTVkODUtNDIyNS1iN2E3LTkzMDEyNzFkZjI1ZSIsInRpZCI6IjQzMGZkNTI2LWI4YmEtNDMwMC1hMjNkLTU1ZGZiODk2MWNlNCJ9.8oGiSxlYZ1B9hcXo67p-4-R-1lHNad8AlQkY-4r_KSw8rlFI6tx4BeYkOIXnnNeVx41ea6BmYr0GLUCn4j4n7A; reftoken=eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJpc3MiOiJ2aXRlY2giLCJhdWQiOiJ2c2VpbnN0cnVtZW50aS5ydSIsImlhdCI6MTY4Nzc2ODc2NywiZXhwIjoxNjk2NDA4NzY3LCJkZXZpZCI6IjViMjdkZmIzLTVkODUtNDIyNS1iN2E3LTkzMDEyNzFkZjI1ZSIsInRpZCI6IjQzMGZkNTI2LWI4YmEtNDMwMC1hMjNkLTU1ZGZiODk2MWNlNCJ9.b7WodAlBkxKd20Pyi53-xZLzxJz7AW7mHC14h0oFqKb2E7UphZq049hT0FY4fEjRnmJfukC0D1xFHSTPh5zIuQ; isNewCart=0; cartToken=wyqu1vMlg7LXE6Vk30wrCXAL7yQAP7uc; tmr_lvid=5606a4ec3fdd26a862a14d128f0050d5; tmr_lvidTS=1687768767843; tmr_detect=1%7C1687768767860; iap.uid=12f2cad8720845078060ed46c95b8439; _ga_87X8FGBH35=GS1.1.1687768767.2.1.1687768769.0.0.0',
'if-modified-since: Mon, 26 Jun 2023 14:52:52 GMT',
'sec-ch-ua: "Not.A/Brand";v="8", "Chromium";v="114", "Google Chrome";v="114"',
'sec-ch-ua-mobile: ?0',
'sec-ch-ua-platform: "Windows"',
'sec-fetch-dest: document',
'sec-fetch-mode: navigate',
'sec-fetch-site: none',
'sec-fetch-user: ?1',
'upgrade-insecure-requests: 1',
'user-agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/114.0.0.0 Safari/537.36',
];
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
$data = curl_exec($ch);
curl_close($ch);
file_put_contents($_SERVER['DOCUMENT_ROOT'] . '/data.docx', $data);
var_dump($data);
то выведется несколько пустых строк.
Открыл doc.txt, а там html-код, а не docx. И в коде можно заметить такую последовательность:
__cf_chl_tk
. Если загуглить, то найдется информация про Cloudflare:https://isotropic.co/what-is-__cf_chl_jschl_tk__/
Выходит, там защита Cloudflare. Это и есть TLS? Или TLS - это другое?