找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 1085|回复: 7

[iptv信源 资源分享或寻求] 哪位大神做个云听APP后BBC World Service的EPG啊

[复制链接]
发表于 2022-9-12 16:22 | 显示全部楼层 |阅读模式
悬赏100恩山币已解决
小弟感激不尽!BBC World Service 节目单地址https://www.bbc.co.uk/schedules/p00fzl9p

我的恩山、我的无线 The best wifi forum is right here.
发表于 2022-9-12 16:22 | 显示全部楼层
  1. <?php
  2. error_reporting(0);
  3. header('Content-Type: text/json;charset=UTF-8',true,200);
  4. $title = 'BBC World Service';
  5. for($i=0;$i<7;$i++){
  6. $dates[] = date("Y/m/d",strtotime("+".$i." day"));
  7. }
  8. for($i=0;$i<count($dates);$i++){
  9. $result[] = getepg($dates[$i]);
  10. }
  11. for($i=0;$i<count($result);$i++){
  12. $starttime[] = json_decode(explode("|",$result[$i])[0]);
  13. $endtime[] = json_decode(explode("|",$result[$i])[1]);
  14. $contents[] = json_decode(explode("|",$result[$i])[2]);
  15. }
  16. $starttime = array_merge((array)$starttime[0],(array)$starttime[1],(array)$starttime[2],(array)$starttime[3],(array)$starttime[4],(array)$starttime[5],(array)$starttime[6]);
  17. $endtime = array_merge((array)$endtime[0],(array)$endtime[1],(array)$endtime[2],(array)$endtime[3],(array)$endtime[4],(array)$endtime[5],(array)$endtime[6]);
  18. $contents = array_merge((array)$contents[0],(array)$contents[1],(array)$contents[2],(array)$contents[3],(array)$contents[4],(array)$contents[5],(array)$contents[6]);
  19. for($i=0;$i<count($starttime);$i++){
  20. $re.='
  21. <programme channel="'.$title.'" start="'.$starttime[$i].' +0000" stop="'.$endtime[$i].' +0000">
  22.         <title lang="zh">'.$contents[$i].'</title>
  23. </programme>';
  24. }
  25. $re = '<channel id="'.$title.'">
  26.     <display-name lang="zh">'.$title.'</display-name>
  27. </channel>&#65279;
  28. '.trim($re);
  29. print_r($re);

  30. function getepg($date){
  31. $url = "https://www.bbc.co.uk/schedules/p00fzl9p/".$date."?utcoffset=%2B08%3A00";
  32. $header = array(
  33. "User-Agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:82.0) Gecko/20100101 Firefox/82.0",
  34. "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
  35. "Accept-Language: zh-CN,zh;q=0.8,zh-TW;q=0.7,zh-HK;q=0.5,en-US;q=0.3,en;q=0.2",
  36. "Accept-Encoding: gzip, deflate, br",
  37. "Connection: keep-alive",
  38. "Referer: https://www.bbc.co.uk/schedules/p00fzl9p",
  39. );
  40. $ch = curl_init();
  41. curl_setopt($ch, CURLOPT_URL, $url);
  42. curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
  43. curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);
  44. curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE);
  45. curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
  46. curl_setopt($ch, CURLOPT_ENCODING,'gzip, deflate, br');
  47. $result = curl_exec($ch);
  48. curl_close($ch);
  49. $result = str_replace('@','','{"@context":"'.explode('</script>',explode('{"@context":"',$result)[1])[0]);
  50. $result = json_decode($result)->graph;
  51. for($i=0;$i<count($result);$i++){
  52. $starttime[] = str_replace(['-','T',':'],'',explode('+',$result[$i]->publication->startDate)[0]);
  53. $endtime[] = str_replace(['-','T',':'],'',explode('+',$result[$i]->publication->endDate)[0]);
  54. $contents[] = $result[$i]->partOfSeries->name;
  55. }
  56. return json_encode($starttime)."|".json_encode($endtime)."|".json_encode($contents);
  57. }
  58. ?>
复制代码

点评

大神,我又找到一个BBC World Service的节目单网址,这个节目单带节目描述,还有节目logo。可以再麻烦做一个吗?🙏  详情 回复 发表于 2022-9-12 22:26
http://live cooltv top/bbcwsepg.php。兄弟再请教一下,这个到底怎么使用啊。我看别人的EPG网址都是.xml啊  详情 回复 发表于 2022-9-12 21:52
bbcwsepg.phphttp://live cooltv top/bbcwsepg.phpepg.xmlлл🙏  详情 回复 发表于 2022-9-12 21:50
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2022-9-12 21:50 来自手机 | 显示全部楼层
kof97zip  2022-9-12 18:49

bbcwsepg.phphttp://live cooltv top/bbcwsepg.phpepg.xmlлл&#128591;
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2022-9-12 21:52 | 显示全部楼层
本帖最后由 coolguy007 于 2022-9-12 22:02 编辑

http://live cooltv top/bbcwsepg.php。兄弟再请教一下,这个到底怎么使用啊。我看别人的EPG网址都是.xml啊。另外,这个节目表好像是得变时区了吧?他用的是GMT时间。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-9-12 21:56 | 显示全部楼层
coolguy007 发表于 2022-9-12 21:52
http://live cooltv top/bbcwsepg.php。兄弟再请教一下,这个到底怎么使用啊。我看别人的EPG网址都是.xml ...


header('Content-Type: text/json;charset=UTF-8',true,200);
改成
header('Content-type: text/xml',true,200);

点评

修改后会提示error on line 3 at column 11: Extra content at the end of the document  详情 回复 发表于 2022-9-12 23:32
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2022-9-12 22:26 | 显示全部楼层
本帖最后由 coolguy007 于 2022-9-12 22:45 编辑

大神,我又找到一个BBC World Service的节目单网址,这个节目单带节目描述,还有节目logo。可以再麻烦做一个吗?&#128591;
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2022-9-12 23:32 | 显示全部楼层
kof97zip 发表于 2022-9-12 21:56

header('Content-Type: text/json;charset=UTF-8',true,200);
改成

修改后会提示error on line 3 at column 11: Extra content at the end of the document
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2022-10-28 21:40 | 显示全部楼层
云听的 EPG 要实时生成 sign,卡在这一步了
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-4-25 07:54

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

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

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