From a9a8ca075a01818e56fd07084cf04c06e1a1c5d3 Mon Sep 17 00:00:00 2001 From: Linus2punkt0 Date: Tue, 12 Sep 2023 18:16:21 +0200 Subject: [PATCH] restoreURL-function will now restore urls even if they are not shortened, as mastodon could not parse some urls. --- crosspost.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crosspost.py b/crosspost.py index b87934b..eab660e 100644 --- a/crosspost.py +++ b/crosspost.py @@ -46,8 +46,9 @@ def getPosts(): cid = feed_view.post.cid text = feed_view.post.record.text # Sometimes bluesky shortens URLs and in that case we need to restore them before crossposting - if feed_view.post.record.facets and "..." in feed_view.post.record.text: + if feed_view.post.record.facets: text = restoreUrls(feed_view.post.record) + langs = feed_view.post.record.langs timestamp = datetime.strptime(feed_view.post.indexed_at.split(".")[0], date_in_format) + timedelta(hours = 2) # Setting replyToUser to the same as user handle and only changing it if the tweet is an actual reply.