Packet capture problem in YY LVB

if you catch http://interface.yy.com/hls/new/get/41724742/41724742/1200?source=wapyy&callback=jsonp2
, return jsonp2 ({"height": 600, "width": 800, "code": 0, "hls": "http://proxy.hls.yy.com/livesystem/15013_xv_41724742_41724742_0_0_0-15013_xa_41724742_41724742_0_0_0.m3u8?org=yyweb&uuid=381d09547ed340c58413143ac4448bbe&t=1529034144&tk=b295cfe3c7fee95816cc8e7a017b094a"})

")

clipboard.png

clipboard.png

if you grab the package with php, you will return

.
jsonp2({"code":1,"hls":"404"})

Code

<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://interface.yy.com/hls/new/get/41724742/41724742/1200?source=wapyy&callback=jsonp2");
$headx = array();
$headx[] = "Host:interface.yy.com
Pragma:no-cache
Referer:http://wap.yy.com/";
curl_setopt($ch, CURLOPT_HTTPHEADER, $headx);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); //
$x = curl_exec($ch);
curl_close($ch);
var_dump($x);

I don"t seem to write the header correctly.

Mar.24,2021

not if php grabs the package, the result is different from that of the browser. Do you want to do something? grab the bag. I haven't studied much


.

set up header, especially cookie

http://php.net/manual/zh/func.

the following option,value should be set to an array:

CURLOPT_HTTPHEADER sets an array of HTTP header fields. Format: array ('Content-type: text/plain',' Content-length: 100')


I also encountered this problem. Through the comparison of packages in other editing languages, I found that as long as I disguise Referer: http://www.yy.com, I can solve , but I don't know how to do it in PHP?


how to solve the Hello problem

Menu