From: Markham Date: Tue, 5 Oct 2021 19:48:09 +0000 (+0200) Subject: update lua-feedparser.patch X-Git-Url: https://git.webhop.me/?a=commitdiff_plain;h=7c1830fbabc9e27d67c7dd7345fd847dbd72e2dd;p=bs-cst-neutrino-hd.git update lua-feedparser.patch --- diff --git a/archive-patches/lua-feedparser.patch b/archive-patches/lua-feedparser.patch index 7d22291..b1abeb0 100644 --- a/archive-patches/lua-feedparser.patch +++ b/archive-patches/lua-feedparser.patch @@ -1,18 +1,21 @@ -commit 782e2925d376d4d78382faa4ef477c72de3d8848 -Author: Jacek Jendrzej -Date: Fri Jun 14 08:45:41 2019 +0200 - - - fix missing pictures; fix empty titles - diff --git a/feedparser.lua b/feedparser.lua -index 2d66b8c..b3887ce 100644 +index 2d66b8c..93d1c65 100644 --- a/feedparser.lua +++ b/feedparser.lua +@@ -9,7 +9,7 @@ local pairs, ipairs = pairs, ipairs + -- see http://feedparser.org for details about the Universal Feed Parser + local feedparser= { + _DESCRIPTION = "RSS and Atom feed parser", +- _VERSION = "feedparser 0.71" ++ _VERSION = "feedparser 0.71b patched" + } + + local blanky = XMLElement.new() --useful in a whole bunch of places @@ -73,7 +73,17 @@ local function parse_entries(entries_el, format_str, base) --content - elseif (format_str=='atom' and tag=='content') or - (format_str=='rss' and (tag=='body' or tag=='xhtml:body' or tag == 'fullitem' or tag=='content:encoded')) then -- entry.content=el:getText() + elseif (format_str=='atom' and tag=='content') or + (format_str=='rss' and (tag=='body' or tag=='xhtml:body' or tag == 'fullitem' or tag=='content:encoded')) then +- entry.content=el:getText() + entry.content=el:getText() + if el.lom and el.lom[2] and el.lom[2][2] and el.lom[2][2][2].attr and el.lom[2][2][2].attr.src then + local img = el.lom[2][2][2].attr.src @@ -25,9 +28,43 @@ index 2d66b8c..b3887ce 100644 + end + end --TODO: content_detail - + --published -@@ -317,7 +327,7 @@ local function parse_rss(root, base_uri) +@@ -111,10 +121,30 @@ local function parse_entries(entries_el, format_str, base) + } + local author_url = (el:getChild('url') or blanky):getText() + if author_url and author_url ~= "" then entry.author_detail.href=resolve(author_url, rebase(el:getChild('url'), el_base)) end +- +- elseif tag=='category' or tag=='dc:subject' then ++ elseif format_str =='atom' and tag=='media:group' then ++ local el_thumb = el:getChild('media:thumbnail') ++ if el_thumb then ++ local img = el_thumb:getAttr('url') ++ tinsert(entry.enclosures, { ++ url=img, ++ length=0, ++ type="image/jpeg" ++ }) ++ end ++ if not entry.summary then ++ entry.summary=el:getText() ++ end ++ elseif format_str =='rss' and tag=='websiteUrl' then ++ if el then ++ local txt = el:getText() ++ if txt then ++ tinsert(entry.links, {websiteUrl = txt}) ++ end ++ end ++ elseif tag=='category' then ++ entry.category = (el:getChild('term') or el):getText() ++ elseif tag=='dc:subject' then + --todo +- + elseif tag=='source' then + --todo + end +@@ -317,7 +347,7 @@ local function parse_rss(root, base_uri) --image elseif tag=='image' or tag=='rdf:image' then feed.image={ @@ -36,3 +73,10 @@ index 2d66b8c..b3887ce 100644 link=(el:getChild('link') or blanky):getText(), width=(el:getChild('width') or blanky):getText(), height=(el:getChild('height') or blanky):getText() +@@ -366,4 +396,4 @@ if _VERSION:sub(-3) < "5.3" then + end + + +-return feedparser +\ No newline at end of file ++return feedparser