写一个文件 a.php 运行 a.php?matchid= 文件大致内容: 获取 $matchid $matchid1=substr($matchid,0,3); //取前三位 $matchid2=substr($matchid,-3); //取后三位 组合接口:“https://static03.zanstartv.com/bocatsports//uploads/GameScoreJson/".$matchid1."/".$matchid2.".json?v=".$v."&callback=gameStatus" ; // $v 为 当前时间得时间戳(毫秒) 下面以案例为说明: 1 依次获取 streamAm streamAmAli streamNa streamNaAli 下的status 如果 status 为 true $pcurl=flv地址 $murl=m3u8地址 如果status不为true 则继续判断下一个 2 如果上面四个都没有找到满足得条件 则获取 "epg": 下的内容 a 先找"nickname" 包含 "高清直播" 并且 "status" 为 true,的部分则获得对应"url" b 如果没有符合a的情况, 则获取 epg中第一个符合 "status" 为 true的部分的 url c 如果a或b能获取到url,继续获取url的代码内容,提取anchordata= 里面的 地址 $pcurl=stream_url_Flv 里面的1080 部分,没有1080则取 720部分 $murl= stream_url_Hls 里面的1080 部分,没有1080则取 720部分 ////////// 接口案例/// gameStatus({ "code": 0, "result": { "data": { "sportId": 2, "sportName": "篮球", "mid": 740024, "leisuId": "3554101", "188Id": 4148263, "hgId": null, "aisportId": "ib_531980", "feijingId": null, "lid": 12069, "lhidden": 0, "lname": "NBA", "lnameEN": "NBA", "lfullname": "美国男子职业篮球联赛", "lfullnameEN": "National Basketball Association", "llevel": 1, "licon": "https://static04.dsoog.cn/uploads/teamIcon/1638/cD7bHpW032E.png", "hid": "4d2809faf9f811e9933642010a8c0073", "hname": "火箭", "hnameEN": "Houston Rockets", "hfullname": "休斯顿火箭", "hfullnameEN": "Houston Rockets", "hicon": "https://static04.dsoog.cn/uploads/teamIcon/1410/9gqiU1qi3Wk.png", "aid": "4d6017e6f9f811e9933642010a8c0073", "aname": "雄鹿", "anameEN": "Milwaukee Bucks", "afullname": "密尔沃基雄鹿", "afullnameEN": "Milwaukee Bucks", "aicon": "https://static04.dsoog.cn/uploads/teamIcon/1117/9l8g9gviAGB.png", "gameTime": "2020-08-03T08:30:00+08:00", "gameEndTime": "2020-08-03T11:30:00+08:00", "hiddenScore": 0, "hTotalScore": 62, "hHalfScore": 62, "hRedCard": null, "hYellowCard": null, "hCornerKick": null, "aTotalScore": 54, "aHalfScore": 54, "aRedCard": null, "aYellowCard": null, "aCornerKick": null, "gameProgress": null, "gameStage": "第二节完", "gameStageType": 5, "tag": "热门", "hot": 1, "cover_image_url": null, "matchStatus": 0, "extradata": { "1": [ 10, 4 ], "2": [ 9, 17 ], "3": [ 14, 8 ], "4": [ 4, 6 ], "5": [ 0, 0 ], "6": [ 100, 88.9 ], "7": [ 6, 6 ], "bhs": [ 32, 30, 0, 0, 0 ], "bas": [ 29, 25, 0, 0, 0 ], "round": null, "home_position": null, "away_position": null }, "updated_at": "2020-08-03 09:49:56", "custom": 0, "stream": [], "streamAm": { "am-871822393-740024": { "preview": "https://static04.dsoog.cn/uploads/thumb/20080308/871822393.jpg", "flv": "https://sm.lssjy.cn/armenia/871822393.flv?wsSecret=2c906f5813704097473634b6636e03b9&wsABSTime=5f27a0d8", "m3u8": "https://sm.lssjy.cn/armenia/871822393/playlist.m3u8?wsSecret=ebcf38bbd1d393a27a7887c6f9131759&wsABSTime=5f27a0d8", "rtmp": "rtmp://sm.lssjy.cn/armenia/871822393?wsSecret=416392e832159f4465600889e8c2b431&wsABSTime=5f27a0d8", "status": flase } }, "streamAmAli": { "amali-871822393-740024": { "preview": "https://static04.dsoog.cn/uploads/thumb/20080308/871822393.jpg", "flv": "https://pull.hbqsly.com/armenia/871822393.flv?auth_key=1596432600-0-0-ca4f2217a5d8cba1b88a36f9e2e43197", "m3u8": "https://pull.hbqsly.com/armenia/871822393.m3u8?auth_key=1596432600-0-0-916561bb5824261d07a4657762ff64f6", "rtmp": "rtmp://pull.hbqsly.com/armenia/871822393?auth_key=1596432600-0-0-d07e16eb3b7639b9f1f4fc3d15c86b9d", "status": } }, "streamNa": { "anim-294629016743583745-740024": { "anim": "https://live.zanstartv.com/#/cartoon/basketball/294629016743583745", "status": true }, "live-295051716888764416-740024": { "preview": "https://static04.dsoog.cn/uploads/thumb/20080308/295051716888764416.jpg", "flv": "https://sm.lssjy.cn/liveb/295051716888764416.flv?wsSecret=a3a9bd7f2af14cd4c16fd138d368fae4&wsABSTime=5f27a0d8", "m3u8": "https://sm.lssjy.cn/liveb/295051716888764416/playlist.m3u8?wsSecret=7b850e78f36cc515630e3cb63ef0a897&wsABSTime=5f27a0d8", "rtmp": "rtmp://sm.lssjy.cn/liveb/295051716888764416?wsSecret=892d7a15d4c214b855a78eee16b788af&wsABSTime=5f27a0d8", "status": true } }, "streamNaAli": { "liveali-295051716888764416-740024": { "preview": "https://static04.dsoog.cn/uploads/thumb/20080308/295051716888764416.jpg", "flv": "https://pull.hbqsly.com/leisub/295051716888764416.flv?auth_key=1596432600-0-0-0aed0c9f00130b6e7fc9a174b5125187", "m3u8": "https://pull.hbqsly.com/leisub/295051716888764416.m3u8?auth_key=1596432600-0-0-903a1721a8f1495cd5cea292087e9333", "rtmp": "rtmp://pull.hbqsly.com/leisub/295051716888764416?auth_key=1596432600-0-0-2fa7697e8cbfb808af22dba50331727a", "status": true } }, "streamZb": [], "streamMx": [], "epg": [ { "name": null, "nickname": "玄羽", "icon": "https://static02.zgyjjj.cn/avatar/f6d05d48eb620680/5d6d0bd4-f6d0-5d48-eb62-0680-3f695209.png", "info": "❤️小羽走心不走水❤️", "cover": null, "url": "https://smtv.io/embed_player/2305412.html?openbacksourcebtn=false", "room_num": "2305412", "account_id": "2305412", "stateCategory": 4, "anchorTags": [], "uuid": "5d6d0bd4-f6d0-5d48-eb62-0680-3f695209", "status": }, { "name": null, "nickname": "大波解球", "icon": "https://static02.zgyjjj.cn/avatar/82b411eaaffc42010a8c007c/ad91a12c-82b4-11ea-affc-42010a8c007c.png", "info": "大波解球,带你摸大波", "cover": null, "url": "https://smtv.io/embed_player/2305601.html?openbacksourcebtn=false", "room_num": "2305601", "account_id": "2305601", "stateCategory": 4, "anchorTags": [], "uuid": "ad91a12c-82b4-11ea-affc-42010a8c007c", "status": true }, { "name": null, "nickname": "高清直播10", "icon": "https://static02.zgyjjj.cn/avatar/20191125/32da521d3c1d8017096a2089af7f9aad.png", "info": null, "cover": null, "url": "https://smtv.io/embed_player/2323673.html?openbacksourcebtn=false", "room_num": "2323673", "account_id": "2323673", "stateCategory": 4, "anchorTags": [], "uuid": "5d919e17-1b85-ae7d-9ec7-4c35-e95c0274", "status": true } ], "hTeamMatchesUrl": "https://static04.dsoog.cn/teams/af9f811e9933642010a8c0073/4d2809faf9f811e9933642010a8c0073.json", "aTeamMatchesUrl": "https://static04.dsoog.cn/teams/6f9f811e9933642010a8c0073/4d6017e6f9f811e9933642010a8c0073.json", "id": 740024, "cover_img_url": "", "cover_img_url_second": "", "time": "2020-08-03 08:30:00", "end_time": "2020-08-03 11:30:00", "status": 0, "sport": 2, "live_types_child_id": 0, "video_id": null, "action": 0, "created_at": "2020-07-29 00:08:10", "relation_room_updated_at": "2020-08-03 09:50:07", "sch_id": 740024, "hot_tag": 1, "count_down": -1, "time_info": "第二节完", "situation": [ "分差 8", "总分 116" ], "hPause": 4, "aPause": 6, "hfoul": 0, "afoul": 0 }, "enabled": "Y" }, "message_key": "api_success", "message_params": [], "message": null, "data": null, "paginate": "last_updated_time=2020-08-03 09:51:04" }) ////////////////////////////