Capture the source code-how to obtain the Douyu TV source address in PHP

Source: Internet
Author: User
I tried to find a lot of information on the Internet, but now the problem is how to generate live by using the parameter values in the interface address parameters. qq. comswf_apiro... this is because the interface address changes every time the t and sign parameters are refreshed. how can I obtain the parameters here or generate my... I have tried a lot of materials on the Internet, but the problem is how to generate the parameter values in the interface address parameters.
Http://live.qq.com/swf_api/ro...
This is because the interface address changes every time the t and sign parameters are refreshed. how can I obtain the parameters here or generate

I previously found an error in the address access interface generated by changing the Python language to PHP.

function getmd5($str){    $m=md5($str);    return $m;}function l_request($action){    $baseUrl = "http://www.douyutv.com/api/v1/room/";    $midReq = "?aid=android&cdn=ws&client_sys=android&time=";    $t=time();    $md5_url= $action . $t . 1231;    //$auth = getmd5($md5_url);    $requrl= $baseUrl . $action . $midReq . $t . "&auth=" . getmd5($md5_url);    return $requrl;}echo (l_request(10000346));

Reply content:

I have tried a lot of materials on the Internet, but the problem is how to generate the parameter values in the interface address parameters.
Http://live.qq.com/swf_api/ro...
This is because the interface address changes every time the t and sign parameters are refreshed. how can I obtain the parameters here or generate

I previously found an error in the address access interface generated by changing the Python language to PHP.

function getmd5($str){    $m=md5($str);    return $m;}function l_request($action){    $baseUrl = "http://www.douyutv.com/api/v1/room/";    $midReq = "?aid=android&cdn=ws&client_sys=android&time=";    $t=time();    $md5_url= $action . $t . 1231;    //$auth = getmd5($md5_url);    $requrl= $baseUrl . $action . $midReq . $t . "&auth=" . getmd5($md5_url);    return $requrl;}echo (l_request(10000346));

Https://github.com/soimort/yo...
This is the python version.

Php:


  'Ws ', 'rate' => '0', 'TT' => $ tt, 'did' => $ did, 'sign' => $ sign]; $ api_url = "http://www.douyu.com/lapi/live/getPlay ". $ room_id; $ api_data = curl ($ api_url, 'post', http_build_query ($ d); $ api_data = json_decode ($ api_data, 1 ); // print_r ($ api_data); if ($ api_data ['error'] = 0) {echo 'live stream address :'. $ api_data ['data'] ['rtmp _ url']. '/'. $ api_data ['data'] ['rtmp _ Live'];} else {echo 'api request error ';}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.