找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 2090|回复: 14

中秋快乐,另类赏月

[复制链接]
发表于 2020-10-1 08:01 | 显示全部楼层 |阅读模式
本帖最后由 bomiaomiao 于 2020-10-1 16:14 编辑

感谢诸位大佬指正,问题已解决!正确源码请爬楼自取。应个景,手动爬取了几个id,有兴趣的可以看看外面的月亮到底有没有我大中国的圆?

<?php
/*
https://api.earthonline.com/rest ... om_id=2006010200088
*/
$id=$_GET['id'];
$url="https://api.earthonline.com/rest/api/v5/content/live/get?live_room_id=".$id;  //接囗
$info=file_get_contents($url);
preg_match('|mississippi.flv(.*?)"|',$info,$m);  
$n="http://txlive.national-space.com/live/mississippi.flv".$m[1]
//echo $n;
header("location:".$n);
?>

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
发表于 2020-10-1 08:07 | 显示全部楼层
占楼支持,顶一下
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-10-1 08:16 来自手机 | 显示全部楼层
指点什么??
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-10-1 09:25 | 显示全部楼层

回帖奖励 +1 币恩山币

要替换\u0026为&
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-10-1 09:25 | 显示全部楼层
接口里面的源本就播放不了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-10-1 09:27 | 显示全部楼层
本帖最后由 kof97zip 于 2020-10-1 09:37 编辑

<?php
$id=$_GET['id'];
$url="https://api.earthonline.com/rest/api/v5/content/live/get?live_room_id=".$id;  //接囗
$info=file_get_contents($url);
preg_match('|mississippi.flv(.*?)"|',$info,$m);  
$n="http://txlive.national-space.com/live/mississippi.flv".$m[1];
$n=str_replace('\u0026','&',$n);
header("location:".$n);
?>
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-10-1 09:31 | 显示全部楼层
指点迷津,传道解惑!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-10-1 09:38 | 显示全部楼层

谢谢指正,可这样修正后还是没有代理输出?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-10-1 10:25 | 显示全部楼层

是的,谢谢提醒!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-10-1 10:27 | 显示全部楼层
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-10-1 10:29 | 显示全部楼层

谢谢大佬提醒,眼神不好,没看到
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-10-1 12:13 | 显示全部楼层
本帖最后由 silverchs 于 2020-10-1 12:16 编辑

mississippi是不同房间号的真实ID,所以你的原代码有很大的问题。
要正确代理所有的房间应该用下面的代码:


  1. <?php
  2. $id=$_GET['id'];
  3. $url='https://api.earthonline.com/rest/api/v5/content/live/get?live_room_id='.$id;  //接囗
  4. $info=file_get_contents($url);
  5. $json=json_decode($info);
  6. $live=$json->data->play_urls[0]->url;
  7. header('location:'.$live);
  8. ?>
复制代码




我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2020-10-1 12:54 | 显示全部楼层
silverchs 发表于 2020-10-1 12:13
mississippi是不同房间号的真实ID,所以你的原代码有很大的问题。
要正确代理所有的房间应该用下面的代码 ...

谢谢指点,更简洁啦!我改成下面这样也可以
preg_match('|space.com/live(.*?)"|',$info,$m);  
$n="http://txlive.national-space.com/live".$m[1];
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-10-1 13:20 | 显示全部楼层
bomiaomiao 发表于 2020-10-1 12:54
谢谢指点,更简洁啦!我改成下面这样也可以
preg_match('|space.com/live(.*?)"|',$info,$m);  
$n="ht ...

你这个接口是从哪里找到的?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2020-10-1 22:01 来自手机 | 显示全部楼层
id是什么呀?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-20 00:15

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表