Web server directories always treated as internet streams
#1
I have my home NAS set up to serve videos via http Web Directory Server, because it is fast, pretty much ubiquitous and I see no need to allow clients (e.g. Kodi) to write to it.

I noticed that thumbs (<video filename>-thumb.jpg) and nfo files (<video filename>.nfo) do not get picked up when using http, but do when using smb. So I did a little digging around in the current git code, et voila:


bool URIUtils::IsInternetStream(const CURL& url, bool bStrictCheck /* = false */)
{
  ...

  if (url.IsProtocol("ftp") || url.IsProtocol("ftps")  ||
      url.IsProtocol("dav") || url.IsProtocol("davs")  ||
      url.IsProtocol("sftp"))
    return bStrictCheck;

  std:Confusedtring protocol = url.GetTranslatedProtocol();
  if (CURL::IsProtocolEqual(protocol, "http")  || CURL::IsProtocolEqual(protocol, "https")  ||
      CURL::IsProtocolEqual(protocol, "tcp")   || CURL::IsProtocolEqual(protocol, "udp")    ||
      CURL::IsProtocolEqual(protocol, "rtp")   || CURL::IsProtocolEqual(protocol, "sdp")    ||
      CURL::IsProtocolEqual(protocol, "mms")   || CURL::IsProtocolEqual(protocol, "mmst")   ||
      CURL::IsProtocolEqual(protocol, "mmsh")  || CURL::IsProtocolEqual(protocol, "rtsp")   ||
      CURL::IsProtocolEqual(protocol, "rtmp")  || CURL::IsProtocolEqual(protocol, "rtmpt")  ||
      CURL::IsProtocolEqual(protocol, "rtmpe") || CURL::IsProtocolEqual(protocol, "rtmpte") ||
      CURL::IsProtocolEqual(protocol, "rtmps"))
    return true;
...

So there seems to be the assumption that if a source is not writable it is an internet stream, and therefore do not look for nfo files or thumbs.

Is this by design? IOW, would a patch so that nfo and thumbs are looked for if a URL has a hostname rather than FQDN be accepted (assuming the code is good Smile)? Or, a patch that just looks for nfo and thumbs anyway (this is 2018 we have bandwidth for this stuff nowadays Smile)?
Reply
#2
Have submitted pull request, two lines Smile

15022 (PR)
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
Web server directories always treated as internet streams00