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

add chuckya mime types

zenfyr.dev 3014455c b93de3de

verified
+17 -5
+17 -5
mastodon/output.py
··· 17 17 'video/webm' 18 18 ] 19 19 20 + TEXT_MIMES = [ 21 + 'text/x.misskeymarkdown', 22 + 'text/markdown', 23 + 'text/plain' 24 + ] 25 + 20 26 ALLOWED_POSTING_VISIBILITY = ['public', 'unlisted', 'private'] 21 27 22 28 class MastodonOutputOptions(): ··· 81 87 self.image_size_limit: int = upload_limit 82 88 self.video_size_limit: int = upload_limit 83 89 90 + # chuckya: supported text types 91 + chuckya_text_mimes: list[str] = statuses_config.get('supported_mime_types', []) 92 + self.text_format = next( 93 + (mime for mime in TEXT_MIMES if mime in (chuckya_text_mimes)), 94 + 'text/plain' 95 + ) 96 + 84 97 # *oma ext: supported text types 85 - self.text_format = 'text/plain' 86 98 pleroma = instance_info.get('pleroma') 87 99 if pleroma: 88 100 post_formats: list[str] = pleroma.get('metadata', {}).get('post_formats', []) 89 - if 'text/x.misskeymarkdown' in post_formats: 90 - self.text_format = 'text/x.misskeymarkdown' 91 - elif 'text/markdown' in post_formats: 92 - self.text_format = 'text/markdown' 101 + self.text_format = next( 102 + (mime for mime in TEXT_MIMES if mime in post_formats), 103 + self.text_format 104 + ) 93 105 94 106 def upload_media(self, attachments: list[MediaInfo]) -> list[str] | None: 95 107 for a in attachments: