dsy19890123 2019-03-27 08:28
浏览 64

使用PHP在WordPress中显示icecast元数据(标题)

I want to display the song's title, from an icecast 2.4.0 stream, in my WordPress page using php (with php_everywhere)

The title is avaiable in /admin/stats.xml, but it's protected by basic auth and I can't modify the status-json.xsl for some reasons ( I'm not the admin of the icecast server ), so I have to take metadata from the /admin/stats.xml for which I have the username and password.

I tried to make a basic auth using curl, or with the syntax http://user:pass@host:port/...., but it doesn't work, the server doesn't respond to my request with the xml page.

I tried some libraries, that I found on the web, that provide an IceCast class in php, but my wordpress page makes an 403 error in this case. For example: PHP - Icecast info being updated on page

  • 写回答

1条回答 默认 最新

  • dongzecai0684 2019-03-27 10:22
    关注

    Please upgrade to the latest Icecast version (2.4.4 at this time), as it has important security and stability fixes. If your Linux distribution doesn't have it, you can install official Xiph.org packages: https://wiki.xiph.org/Icecast_Server/Installing_latest_version_(official_Xiph_repositories)

    Importantly it also offers a JSON API endpoint to access metadata at /status-json.xsl (importantly this is broken in 2.4.0). This does not require authentication.

    评论

报告相同问题?

悬赏问题

  • ¥15 关于用pyqt6的项目开发该怎么把前段后端和业务层分离
  • ¥30 线性代数的问题,我真的忘了线代的知识了
  • ¥15 有谁能够把华为matebook e 高通骁龙850刷成安卓系统,或者安装安卓系统
  • ¥188 需要修改一个工具,懂得汇编的人来。
  • ¥15 livecharts wpf piechart 属性
  • ¥20 数学建模,尽量用matlab回答,论文格式
  • ¥15 昨天挂载了一下u盘,然后拔了
  • ¥30 win from 窗口最大最小化,控件放大缩小,闪烁问题
  • ¥20 易康econgnition精度验证
  • ¥15 msix packaging tool打包问题