From 2fcef654a61d4b353b4f622eeb1d95a8654a3fa9 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 15 Aug 2024 23:27:20 +0100 Subject: [PATCH] Extra check for gemini sites --- donate.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/donate.py b/donate.py index ccbf421e2..5221bbded 100644 --- a/donate.py +++ b/donate.py @@ -141,6 +141,20 @@ def get_gemini_link(actor_json: {}) -> str: continue url = remove_html(property_value[prop_value_name]) return remove_link_tracking(url) + + for property_value in actor_json['attachment']: + if not property_value.get('type'): + continue + prop_value_name, _ = \ + get_attachment_property_value(property_value) + if not prop_value_name: + continue + if not property_value['type'].endswith('PropertyValue'): + continue + url = remove_html(property_value[prop_value_name]) + if 'gemini://' not in url: + continue + return remove_link_tracking(url) return ''