Webserver: Local/Streaming Playback - HTTP VFS 401 Fix

  • System Information:

    • Raspberry PI 3
    • LibreELEC (Krypton) v7.90.010 ALPHA
    • Media on USB


    Description:
    There is a niffy feature in the included Chorus2 web interface, to allow "Local" [Streaming] playback of files within the web interface. Unfortunately, as it's configured now: the feature is broken by security improvements made in XBMC v12 Frodo [Ref: Webserver - Official Kodi Wiki ]

    The problem occurs because the path "/media" is automatically added to the sources.xml on RPi systems [Ref: Issues with streaming to other devices - Sources? ] which is scanned by the library scanner to populate it's database. The paths in /media ultimately resolve to /var/media; which is perfectly fine for the local Kodi instance. But the HTTP VFS service [used by remote systems] will deny access to them because there is no entry for /var/media permitting access.

    To fix, simply update the sources.xml with an entry for /var/media, like so:

    /storage/.kodi/userdata/sources.xml

    Code
    <sources>
      ...
      <music>
      ...
        <source>
          <name>EXT</name>
          <path pathversion="1">/var/media</path>
          <allowsharing>true</allowsharing>
        </source>
        ...

    Notes:

    • Putting the /var/media entry under the <files> sub-item does not work! Streaming only started working for me once I moved it to <music>.
    • You can probably create the entry via the GUI interface by first going to the "Root filesystem" option.


    Likely related:
    Bug #42: Not playing locally - Yatse, the Kodi remote - Yatse: Kodi remote
    Bountysource

  • Just wanted to say thx for this fix - still working well ;)

    Took a long time to find this workaround - so just adding my thanks, and letting y'all know it's alive and kicking.

    I have a brand new install of OpenELEC on Pi2 with an external USB HDD and Chorus2 (as part of the orig. install from OpenELEC-RPi2.arm-8.0.4)

    HTH
    j