social media crossposting tool. 3rd time's the charm
mastodon misskey crossposting bluesky

add chuckya mime types

zenfyr.dev 3014455c b93de3de

verified
Changed files
+17 -5
mastodon
+17 -5
mastodon/output.py
···
'video/webm'
]
+
TEXT_MIMES = [
+
'text/x.misskeymarkdown',
+
'text/markdown',
+
'text/plain'
+
]
+
ALLOWED_POSTING_VISIBILITY = ['public', 'unlisted', 'private']
class MastodonOutputOptions():
···
self.image_size_limit: int = upload_limit
self.video_size_limit: int = upload_limit
+
# chuckya: supported text types
+
chuckya_text_mimes: list[str] = statuses_config.get('supported_mime_types', [])
+
self.text_format = next(
+
(mime for mime in TEXT_MIMES if mime in (chuckya_text_mimes)),
+
'text/plain'
+
)
+
# *oma ext: supported text types
-
self.text_format = 'text/plain'
pleroma = instance_info.get('pleroma')
if pleroma:
post_formats: list[str] = pleroma.get('metadata', {}).get('post_formats', [])
-
if 'text/x.misskeymarkdown' in post_formats:
-
self.text_format = 'text/x.misskeymarkdown'
-
elif 'text/markdown' in post_formats:
-
self.text_format = 'text/markdown'
+
self.text_format = next(
+
(mime for mime in TEXT_MIMES if mime in post_formats),
+
self.text_format
+
)
def upload_media(self, attachments: list[MediaInfo]) -> list[str] | None:
for a in attachments: