Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

请教凤凰台的php搭建,折腾好长时间搞不定,先谢谢! #3

Closed
outcastveron opened this issue Nov 29, 2023 · 2 comments

Comments

@outcastveron
Copy link

No description provided.

@qist
Copy link
Owner

qist commented Dec 4, 2023

<?php
error_reporting(0);
$id = isset($_GET['id'])?$_GET['id']:'fhzx';
$fmt = isset($_GET['fmt'])?$_GET['fmt']:'hls';//hls flv
$n = [
  'fhzx' => '7c96b084-60e1-40a9-89c5-682b994fb680',  //资讯台
  'fhzw' => 'f7f48462-9b13-485b-8101-7b54716411ec',  //中文台
  'fhhk' => '15e02d92-1698-416c-af2f-3e9a872b4d78',  //香港台
  ];
if($fmt == 'hls') $url = "https://m.fengshows.com/api/v3/hub/live/auth-url?stream_type=hls&live_id={$n[$id]}&live_qa=HD";
if($fmt == 'flv') $url = "https://m.fengshows.com/api/v3/hub/live/auth-url?stream_type=flv&live_id={$n[$id]}&live_qa=HD";
$live = get_headers(json_decode(file_get_contents($url))->data->live_url,1)['Location'];
if($fmt == 'flv') {
   header('Location:'.$live);
   //echo $live;
   }
if($fmt == 'hls') {
   $burl = "http://qctv.fengshows.cn/live/";
   $cur = preg_replace("/(.*?.ts)/i", $burl."$1",file_get_contents($live));
   if($id == 'fhzw') $cur = $cur;
   else $cur = preg_replace("/48-/","72-",$cur);
   header("Content-Type: application/vnd.apple.mpegurl");
   print_r($cur);
   }
?>

用这个

@outcastveron
Copy link
Author

我试试看,多谢多谢

@qist qist closed this as completed Mar 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants