找回密码
 注册需人工审核(节假日除外)
搜索
查看: 194|回复: 2

歪歪PHP源码,貌似已失效,待修复

[复制链接]

签到天数: 54 天

[LV.5]略有小成

发表于 昨天 10:45 | 显示全部楼层 |阅读模式
  1. <?php
  2. error_reporting(0);
  3. $rid = $_GET['id'];
  4. $bstrURL = 'http://interface.yy.com/hls/new/get/'.$rid.'/'.$rid.'/1200?source=wapyy&callback=jsonp3';
  5. $ch = curl_init();
  6. curl_setopt($ch, CURLOPT_URL, $bstrURL);
  7. curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  8. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  9. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  10. curl_setopt($ch, CURLOPT_POST, TRUE);
  11. curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36");
  12. curl_setopt($ch, CURLOPT_REFERER,'https://www.yy.com/');
  13. $data = curl_exec($ch);
  14. curl_close($ch);
  15. $n = preg_match('/"hls":"(.*?)"/',$data,$result);
  16. header('location:'.$result[1]);
  17. ?>
复制代码
第一


<?php
date_default_timezone_set("Asia/Shanghai");
$firstrid = empty($_GET['id']) ? "17829" : trim($_GET['id']);
$quality = "4";

$checkUrl = "https://wap.yy.com/mobileweb/$firstrid";
$header = array(
    'Referer: https://wap.yy.com',
    'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $checkUrl);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
$data = curl_exec($ch);
if(curl_errno($ch)){
    echo 'Curl error: ' . curl_error($ch);
    exit();
}
curl_close($ch);

$realdata = [];
$rid = "";
$reg = "/md5Hash[\s\S]*?sid.*'(.*)'.*?getQuery/i";
preg_match($reg, $data, $realdata);
if (count($realdata) > 0) {
    $rid = $realdata[1];
} else {
    echo "Failed to get rid";
    exit();
}

$millis_13 = round(microtime(true) * 1000);
$millis_10 = time();
$data = '{"head":{"seq":' . $millis_13 . ',"appidstr":"0","bidstr":"121","cidstr":"' . $rid . '","sidstr":"' . $rid . '","uid64":0,"client_type":108,"client_ver":"5.14.13","stream_sys_ver":1,"app":"yylive_web","playersdk_ver":"5.14.13","thundersdk_ver":"0","streamsdk_ver":"5.14.13"},"client_attribute":{"client":"web","model":"","cpu":"","graphics_card":"","os":"chrome","osversion":"106.0.0.0","vsdk_version":"","app_identify":"","app_version":"","business":"","width":"1536","height":"864","scale":"","client_type":8,"h265":0},"avp_parameter":{"version":1,"client_type":8,"service_type":0,"imsi":0,"send_time":' . $millis_10 . ',"line_seq":-1,"gear":' . $quality . ',"ssl":1,"stream_format":0}}';
$url = "https://stream-manager.yy.com/v3/channel/streams?uid=0&cid=$rid&sid=$rid&appid=0&sequence=$millis_13&encode=json&quality=$quality";
$headers = array(
    'Content-Type: text/plain;charset=UTF-8',
    'Referer: https://wap.yy.com/',
    'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.42'
);
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

$result = curl_exec($ch);
if(curl_errno($ch)){
    echo 'Curl error: ' . curl_error($ch);
    exit();
}
$result = json_decode($result, true);
curl_close($ch);

if (array_key_exists('avp_info_res', $result)) {
    $a = $result['avp_info_res']['stream_line_addr'];
    $mediaurl = array_values($a)[0]['cdn_info']['url'];
    header('location:' . $mediaurl);
    exit();
} else {
    echo "Failed to get media URL";
    exit();
}
?>

第二
  1. <?php
  2. date_default_timezone_set("Asia/Shanghai");
  3. $firstrid = empty($_GET['id']) ? "17829" : trim($_GET['id']);
  4. $quality = "4";

  5. $checkUrl = "https://wap.yy.com/mobileweb/$firstrid";
  6. $header = array(
  7.     'Referer: https://wap.yy.com',
  8.     'User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 16_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/16.3 Mobile/15E148 Safari/604.1'
  9. );
  10. $ch = curl_init();
  11. curl_setopt($ch, CURLOPT_URL, $checkUrl);
  12. curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
  13. curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  14. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  15. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  16. $data = curl_exec($ch);
  17. curl_close($ch);

  18. function aes_decrypt($ciphertext, $key, $iv)
  19. {
  20.     return openssl_decrypt($ciphertext, 'AES-256-CBC', $key, 0, $iv);
  21. }

  22. $key = "abcdefghijklmnopqrstuvwxyz123456";
  23. $iv = "1234567890123456";
  24. $mediaurl = aes_decrypt("vcnTSiZsSUWtlZRxx+FuRnM7F1b1FlSVueFKcxewvKVbe9bXE49HXuq1dHha2K7cSic4yOuClWpau1RibQeO2g==", $key, $iv);

  25. $realdata = "";
  26. $rid = "";
  27. $reg = "/md5Hash[\s\S]*?sid.*'(.*)'.*?getQuery/i";
  28. preg_match($reg, $data, $realdata);
  29. if (count($realdata) > 0) {
  30.     $rid = $realdata[1];
  31. } else {
  32.     header('location:' . $mediaurl);
  33.     exit();
  34. }

  35. $millis_13 = round(microtime(true) * 1000);
  36. $millis_10 = time();
  37. $data = '{"head":{"seq":' . $millis_13 . ',"appidstr":"0","bidstr":"121","cidstr":"' . $rid . '","sidstr":"' . $rid . '","uid64":0,"client_type":108,"client_ver":"5.11.0-alpha.4","stream_sys_ver":1,"app":"yylive_web","playersdk_ver":"5.11.0-alpha.4","thundersdk_ver":"0","streamsdk_ver":"5.11.0-alpha.4"},"client_attribute":{"client":"web","model":"","cpu":"","graphics_card":"","os":"chrome","osversion":"106.0.0.0","vsdk_version":"","app_identify":"","app_version":"","business":"","width":"1536","height":"864","scale":"","client_type":8,"h265":0},"avp_parameter":{"version":1,"client_type":8,"service_type":0,"imsi":0,"send_time":' . $millis_10 . ',"line_seq":-1,"gear":' . $quality . ',"ssl":1,"stream_format":0}}';
  38. $url = "https://stream-manager.yy.com/v3/channel/streams?uid=0&cid=$rid&sid=$rid&appid=0&sequence=$millis_13&encode=json";
  39. $headers = array(
  40.     'Content-Type: text/plain;charset=UTF-8',
  41.     'Referer: https://www.yy.com/',
  42.     'User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36 Edg/106.0.1370.42'
  43. );
  44. $ch = curl_init($url);
  45. curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  46. curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  47. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  48. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  49. curl_setopt($ch, CURLOPT_POST, true);
  50. curl_setopt($ch, CURLOPT_POSTFIELDS, $data);

  51. $result = curl_exec($ch);
  52. $result = json_decode($result, true);
  53. curl_close($ch);
  54. if (array_key_exists('avp_info_res', $result)) {
  55.     $a = $result['avp_info_res']['stream_line_addr'];
  56.     $mediaurl = array_values($a)[0]['cdn_info']['url'];
  57.     header('location:' . $mediaurl);
  58.     exit();
  59. } else {
  60.     header('location:' . $mediaurl);
  61.     exit();
  62. }
复制代码


点评

该源码可以局域网转发,但不能走服务器  发表于 昨天 11:01

人生没有彩排,每天都是直播。

Welcome to iptv.cc !

回复

使用道具 举报

签到天数: 2 天

[LV.1]初学乍练

发表于 昨天 17:36 | 显示全部楼层

人生没有彩排,每天都是直播。

Welcome to iptv.cc !

回复

使用道具 举报

本版积分规则

Archiver|手机版|小黑屋|IPTV论坛 | 管理员邮箱:a@8494.net

本站以兴趣爱好为宗旨,非经营性质,不以任何形式收取任何费用。IPTV论坛没有任何官方Q群,V群,T群,禁止留任何联系方式,请配合。

免责声明:本站上述内容来自网络,不得用于商业或非法用途,您必须在下载后24小时内,从设备中删除,否则后果自负。如内容侵犯您的版权、著作权,请联系我,第一时间处理。

GMT+8, 2025-4-3 17:50 , Processed in 0.092986 second(s), 18 queries .

IPTV论坛 创建于 2023年5月1日