From a2645152a43993ff69a953be8b3d9dd067ec9731 Mon Sep 17 00:00:00 2001 From: Gordon Shumway Date: Tue, 17 Oct 2023 01:46:08 -0400 Subject: [PATCH] SpiffyTtitles: Twitter/X add new template variables {{content}} {{name}} {{nick}} {{date}} --- SpiffyTitles/plugin.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/SpiffyTitles/plugin.py b/SpiffyTitles/plugin.py index 1898c0f..468cd98 100644 --- a/SpiffyTitles/plugin.py +++ b/SpiffyTitles/plugin.py @@ -1754,6 +1754,12 @@ class SpiffyTitles(callbacks.Plugin): results = {} soup = BeautifulSoup(response["html"]) results["text"] = soup.get_text(" ").strip() + match = re.match(r"(.*)—(.*) \((.*)\) (.*)", results["text"]) + if match: + results["content"] = match.group(1) + results["name"] = match.group(2) + results["nick"] = match.group(3) + results["date"] = match.group(4) template = Template(self.registryValue("twitter.template", channel)) title = template.render(results).strip() if title: