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

fix: raise ValueError if instance doesn't declare any of the supported text types.

zenfyr.dev 46d54aea 100ee395

verified
+12
+12
mastodon/info.py
··· 54 54 config["text_format"] = "text/x.misskeymarkdown" 55 55 elif "text/markdown" in text_mimes: 56 56 config["text_format"] = "text/markdown" 57 + elif "text/plain" in text_mimes: 58 + config["text_format"] = "text/plain" 59 + else: 60 + raise ValueError( 61 + f"Unsupported instance 'text_format' type '{text_mimes}'" 62 + ) 57 63 58 64 if "media_attachments" in data: 59 65 media_config: dict[str, Any] = data["media_attachments"] ··· 80 86 config["text_format"] = "text/x.misskeymarkdown" 81 87 elif "text/markdown" in post_formats: 82 88 config["text_format"] = "text/markdown" 89 + elif "text/plain" in post_formats: 90 + config["text_format"] = "text/plain" 91 + else: 92 + raise ValueError( 93 + f"Unsupported instance 'text_format' type '{post_formats}'" 94 + ) 83 95 84 96 return InstanceInfo(**config) 85 97