karlheyes / icecast-kh

KH branch of icecast
GNU General Public License v2.0
297 stars 105 forks source link

Currently playing on dir.xiph.org (YP) URL-escaped #418

Closed Moonbase59 closed 1 year ago

Moonbase59 commented 1 year ago

@karlheyes I originally opened this issue with Azuracast at https://github.com/AzuraCast/AzuraCast/issues/6240 but @BusterNeece tells me this should be an upstream issue:

When adding your station to the Xiph.org Yellow Pages (dir.xiph.org), the yellow pages show an URL-escaped string for the title currently playing:

On Air: Inkubus%20Sukkubus%20%2d%20The%20Rape%20of%20Maude%20Bowen

This is the same for @LordHelmchen666’s Eisradio, btw, but almost all other stations are shown correctly. I’m currently on Icecast 2.4.0-kh21, build 12-gb28cc11 (within AzuraCast).

My current icecast.xml (passwords/names changed):

<icecast>
    <location>AzuraCast</location>
    <admin>icemaster@localhost</admin>
    <hostname>radio.testradio.net</hostname>
    <limits>
        <clients>499</clients>
        <sources>2</sources>
        <queue-size>524288</queue-size>
        <client-timeout>30</client-timeout>
        <header-timeout>15</header-timeout>
        <source-timeout>10</source-timeout>
        <burst-size>65535</burst-size>
    </limits>
    <authentication>
        <source-password>(PASSWORD)</source-password>
        <relay-password>(PASSWORD)</relay-password>
        <admin-user>admin</admin-user>
        <admin-password>(PASSWORD)</admin-password>
    </authentication>
    <listen-socket>
        <port>8000</port>
    </listen-socket>
    <mount type="normal">
        <mount-name>/radio.mp3</mount-name>
        <charset>UTF8</charset>
        <stream-name>Test Radio</stream-name>
        <stream-description>Non-public test &amp; evaluation server only</stream-description>
        <stream-url>https://radio.testradio.net/public/testradio</stream-url>
        <genre>Various</genre>
        <intro>../../../../../var/azuracast/stations/testradio/config/mount_1_intro.mp3</intro>
        <fallback-mount>/fallback-[128].mp3</fallback-mount>
        <fallback-override>1</fallback-override>
        <http-headers>
            <header name="icy-index-metadata" value="1"/>
            <header name="icy-version" value="2"/>
            <header name="icy-logo" value="https://radio.testradio.net/static/uploads/browser_icon/192.1678626043.png"/>
            <header name="icy-country-code" value="DE"/>
            <header name="icy-country-subdivision-code" value="DE-BY"/>
            <header name="icy-language-codes" value="deu,eng"/>
            <header name="icy-do-not-index" value="0"/>
        </http-headers>
    </mount>
    <mount type="normal">
        <mount-name>/radio.aac</mount-name>
        <charset>UTF8</charset>
        <stream-name>Test Radio</stream-name>
        <stream-description>Non-public test &amp; evaluation server only</stream-description>
        <stream-url>https://radio.testradio.net/public/testradio</stream-url>
        <genre>Various</genre>
        <intro>../../../../../var/azuracast/stations/testradio/config/mount_3_intro.aac</intro>
        <fallback-mount>/fallback-[128].aac</fallback-mount>
        <fallback-override>1</fallback-override>
        <http-headers>
            <header name="icy-index-metadata" value="1"/>
            <header name="icy-version" value="2"/>
            <header name="icy-logo" value="https://radio.testradio.net/static/uploads/browser_icon/192.1678626043.png"/>
            <header name="icy-country-code" value="DE"/>
            <header name="icy-country-subdivision-code" value="DE-BY"/>
            <header name="icy-language-codes" value="deu,eng"/>
            <header name="icy-do-not-index" value="1"/>
        </http-headers>
    </mount>
    <fileserve>1</fileserve>
    <paths>
        <basedir>/usr/local/share/icecast</basedir>
        <logdir>/var/azuracast/stations/testradio/config</logdir>
        <webroot>/usr/local/share/icecast/web</webroot>
        <adminroot>/usr/local/share/icecast/admin</adminroot>
        <pidfile>/var/azuracast/stations/testradio/config/icecast.pid</pidfile>
        <alias source="/" dest="/status.xsl"/>
        <ssl-private-key>/var/azuracast/acme/ssl.key</ssl-private-key>
        <ssl-certificate>/var/azuracast/acme/ssl.crt</ssl-certificate>
        <ssl-allowed-ciphers>ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS</ssl-allowed-ciphers>
        <deny-ip>/var/azuracast/stations/testradio/config/ip_bans.txt</deny-ip>
        <deny-agents>/var/azuracast/stations/testradio/config/user_agent_bans.txt</deny-agents>
        <x-forwarded-for>127.0.0.1</x-forwarded-for>
    </paths>
    <logging>
        <accesslog>icecast_access.log</accesslog>
        <errorlog>/dev/stderr</errorlog>
        <loglevel>2</loglevel>
        <logsize>10000</logsize>
    </logging>
    <security>
        <chroot>0</chroot>
    </security>
    <directory>
        <yp-url-timeout>15</yp-url-timeout>
        <yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
    </directory>
</icecast>
TenGbps commented 1 year ago

Same issue here

karlheyes commented 1 year ago

ok, lets get to this one. I'm assuming that if you are getting this here then the source is sending a doubly encoded metadata. Obviously I have to encode for sending to the YP and the source client has to encoded for sending in the GET, but if the source is reading from something that is already encoded then it will be doubly encoded in such cases.

I might be able to do a verification check to skip a step if it is ok to do so.

karl.

karlheyes commented 1 year ago

can you verify the master tree works as expected. looks to be a bug from the params work clashing with the older code.

karl

Moonbase59 commented 1 year ago

Thanks for investigating. I fear we might need @BusterNeece for that, or a version I could easily install (not build) within the AzuraCast docker container… Would that be possible?

karlheyes commented 1 year ago

I do not know what would be required for that. pulling the master tree vs a [pre-]release is not that much different but how that wraps up in a binary distribution is a different issue. I can cut a pre-release if that helps.

karl

BusterNeece commented 1 year ago

@karlheyes We can pull specific commits in our build process, no need to tag a release. I'll update our Rolling Release and let you know how things look. Thanks for your help!

BusterNeece commented 1 year ago

@Moonbase59 Latest Rolling Release has the latest commit from icecast-kh master. Try it out!

Moonbase59 commented 1 year ago

@karlheyes @BusterNeece Thanks for your help!

Confirmed working with Icecast 2.4.0-kh21.3, build 2-g5f5564d. (At least with dir.xiph.org, I’ll try some others later.)

Moonbase59 commented 1 year ago

Confirmed working with internet-radio.com, too.

Directory config used:

<directory>
    <yp-url-timeout>15</yp-url-timeout>
    <yp-url>http://dir.xiph.org/cgi-bin/yp-cgi</yp-url>
</directory>
<directory>
    <yp-url-timeout>15</yp-url-timeout>
    <yp-url>http://icecast-yp.internet-radio.com</yp-url>
</directory>
Moonbase59 commented 1 year ago

@karlheyes Should we close this for now? (Since you were thinking of maybe changing the code later.)

karlheyes commented 1 year ago

well that's fixed, and committed to master, will be rolled into next update. The change I was thinking of is just a question of when the encoding was done, a bunch of it was pruned out but not all. So not currently on the agenda. I'll close for now and thanks to everyone for flushing out the issue.

karl.