简体   繁体   English

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

[英]Show icecast metadata (title) in WordPress using PHP

I want to display the song's title, from an icecast 2.4.0 stream, in my WordPress page using php (with php_everywhere) 我想在我的WordPress页面中使用php(带有php_everywhere),从icecast 2.4.0流中显示歌曲的标题

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. 标题可以在/admin/stats.xml中使用,但它受基本身份验证保护,我无法修改status-json.xsl,原因有些(我不是icecast服务器的管理员),所以我必须从/admin/stats.xml中获取元数据,其中包含用户名和密码。

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. 我尝试使用curl或使用语法http:// user:pass @ host:port / ....进行基本身份验证,但它不起作用,服务器不响应我的xml请求页。

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. 我尝试了一些我在网上找到的库,这些库在php中提供了一个IceCast类,但是我的wordpress页面在这种情况下会产生403错误。 For example: PHP - Icecast info being updated on page 例如: PHP - 正在更新页面上的Icecast信息

Please upgrade to the latest Icecast version (2.4.4 at this time), as it has important security and stability fixes. 请升级到最新的Icecast版本(此时为2.4.4),因为它具有重要的安全性和稳定性修复。 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) 如果你的Linux发行版没有它,你可以安装官方的Xiph.org软件包: 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). 重要的是,它还提供了一个JSON API端点来访问/status-json.xsl中的元数据(重要的是,这在2.4.0中已经破解)。 This does not require authentication. 这不需要身份验证。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM