From d7045b2bef9b82f840310e1522e778c4ea9d2f5b Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Mon, 7 Oct 2024 05:37:51 +0100 Subject: [PATCH 1/3] Fix XML file format check --- src/iptvsimple/Epg.cpp | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/iptvsimple/Epg.cpp b/src/iptvsimple/Epg.cpp index 9ac6286be..e6c84c328 100644 --- a/src/iptvsimple/Epg.cpp +++ b/src/iptvsimple/Epg.cpp @@ -226,19 +226,21 @@ const XmltvFileFormat Epg::GetXMLTVFileFormat(const char* buffer) if (!buffer) return XmltvFileFormat::INVALID; - // xml should starts with ' + (buffer[0] != '\x3C' && buffer[1] != '\x3F' && buffer[2] != '\x78' && // xml should starts with ' Date: Mon, 7 Oct 2024 20:04:09 +0100 Subject: [PATCH 2/3] Always treat special paths as local --- src/iptvsimple/utilities/WebUtils.cpp | 7 ++++++- src/iptvsimple/utilities/WebUtils.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/iptvsimple/utilities/WebUtils.cpp b/src/iptvsimple/utilities/WebUtils.cpp index 165e139c6..9102bbcbc 100644 --- a/src/iptvsimple/utilities/WebUtils.cpp +++ b/src/iptvsimple/utilities/WebUtils.cpp @@ -121,6 +121,11 @@ bool WebUtils::IsNfsUrl(const std::string& url) return StringUtils::StartsWith(url, NFS_PREFIX); } +bool WebUtils::IsSpecialUrl(const std::string& url) +{ + return StringUtils::StartsWith(url, SPECIAL_PREFIX); +} + std::string WebUtils::RedactUrl(const std::string& url) { std::string redactedUrl = url; @@ -139,7 +144,7 @@ std::string WebUtils::RedactUrl(const std::string& url) bool WebUtils::Check(const std::string& strURL, int connectionTimeoutSecs, bool isLocalPath) { // For local paths we only need to check existence of the file - if (isLocalPath && FileUtils::FileExists(strURL)) + if ((isLocalPath || IsSpecialUrl(strURL)) && FileUtils::FileExists(strURL)) return true; //Otherwise it's remote diff --git a/src/iptvsimple/utilities/WebUtils.h b/src/iptvsimple/utilities/WebUtils.h index 22ec49a51..3a1180949 100644 --- a/src/iptvsimple/utilities/WebUtils.h +++ b/src/iptvsimple/utilities/WebUtils.h @@ -16,6 +16,7 @@ namespace iptvsimple static const std::string HTTP_PREFIX = "http://"; static const std::string HTTPS_PREFIX = "https://"; static const std::string NFS_PREFIX = "nfs://"; + static const std::string SPECIAL_PREFIX = "special://"; static const std::string UDP_MULTICAST_PREFIX = "udp://@"; static const std::string RTP_MULTICAST_PREFIX = "rtp://@"; @@ -28,6 +29,7 @@ namespace iptvsimple static std::string ReadFileContentsStartOnly(const std::string& url, int* httpCode); static bool IsHttpUrl(const std::string& url); static bool IsNfsUrl(const std::string& url); + static bool IsSpecialUrl(const std::string& url); static std::string RedactUrl(const std::string& url); static bool Check(const std::string& url, int connectionTimeoutSecs, bool isLocalPath = false); }; From 9e7fa685dfb418860c791d9fdca2de174f6acd7a Mon Sep 17 00:00:00 2001 From: phunkyfish Date: Mon, 7 Oct 2024 05:45:49 +0100 Subject: [PATCH 3/3] changelog and version 22.2.1 --- pvr.iptvsimple/addon.xml.in | 2 +- pvr.iptvsimple/changelog.txt | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pvr.iptvsimple/addon.xml.in b/pvr.iptvsimple/addon.xml.in index 712b22b26..6bc5a3b3c 100644 --- a/pvr.iptvsimple/addon.xml.in +++ b/pvr.iptvsimple/addon.xml.in @@ -1,7 +1,7 @@ @ADDON_DEPENDS@ diff --git a/pvr.iptvsimple/changelog.txt b/pvr.iptvsimple/changelog.txt index 5116ada36..bf3c09858 100644 --- a/pvr.iptvsimple/changelog.txt +++ b/pvr.iptvsimple/changelog.txt @@ -1,3 +1,7 @@ +v22.2.1 +- Fix XML file format check +- Always treat special paths as local + v22.2.0 - Correctly set inputstream properties for media entries