It is not a problem to replace headers, referrer, unique un, cookies.

What is a problem is to track the list of redirections, modification of cookies in the process of redirections, especially if there are many js on the site or God forbid more complicated technologies / dozens of requests and it is necessary to understand each

Using the Firefox debugger, it is possible to check transmitted cookies, the necessary headers may be too labor-intensive.

What are the means to analyze the chain of requests to obtain the final result, ideally generating the code themselves, or greatly facilitating the generation of code in php? Browser plug-ins come to mind, but I don’t know these

    1 answer 1

    It is necessary to manually process redirects, for this you need to turn off auto-redirects (for example, the CURLOPT_FOLLOWLOCATION option is responsible for cURL, in other libraries - read the documentation).

    The request must be made in a loop. When you receive a response, process the received headers. At the end of the iteration, check the response code - if 301 , 302 (or another one responsible for the redirect) and there is a location header, then extract the following URL from this header and repeat the iteration of the loop.