+82
-72
bluesky/atproto2.py
+82
-72
bluesky/atproto2.py
············-embed=models.AppBskyEmbedVideo.Main(video=upload.blob, alt=video_alt, aspect_ratio=video_aspect_ratio),·········-def create_gates(self, thread_gate_opts: list[str], quote_gate: bool, post_uri: str, time_iso: str | None = None):
+90
-71
bluesky/common.py
+90
-71
bluesky/common.py
······-def __init__(self, record: dict, tokens: list[cross.Token], attachments: list[MediaInfo]) -> None:······
+105
-79
bluesky/input.py
+105
-79
bluesky/input.py
············-success = database.try_insert_repost(self.db, post_uri, reposted_uri, self.user_id, self.service)-async def listen(self, outputs: list[cross.Output], submit: Callable[[Callable[[], Any]], Any]):
+238
-209
bluesky/output.py
+238
-209
bluesky/output.py
···-from util.media import MediaInfo, get_filename_from_url, get_media_meta, compress_image, convert_to_mp4-raise ValueError(f"'thread_gate' only accepts {', '.join(ALLOWED_GATES)} or [], got: {thread_gate}")·········-labels = models.ComAtprotoLabelDefs.SelfLabels(values=[models.ComAtprotoLabelDefs.SelfLabel(val=label) for label in unique_labels])-LOGGER.error("Skipping post_id '%s', failed to download attachment! File too large.", post.get_id())-LOGGER.error("Skipping post_id '%s', failed to download attachment! File too large?", post.get_id())-def __delete_repost(self, repost_id: str) -> tuple[models.AppBskyActorDefs.ProfileViewDetailed | None, dict | None]:
+79
-61
cross.py
+79
-61
cross.py
······-def split_tokens(tokens: list[Token], max_chars: int, max_link_len: int = 35) -> list[list[Token]]:······
+59
-54
main.py
+59
-54
main.py
···············
+26
-20
mastodon/common.py
+26
-20
mastodon/common.py
···-def __init__(self, status: dict, tokens: list[cross.Token], media_attachments: list[MediaInfo]) -> None:
+124
-96
mastodon/input.py
+124
-96
mastodon/input.py
···-raise ValueError(f"'allowed_visibility' only accepts {', '.join(ALLOWED_VISIBILITY)}, got: {allowed_visibility}")+f"'allowed_visibility' only accepts {', '.join(ALLOWED_VISIBILITY)}, got: {allowed_visibility}"-self.token = as_envvar(settings.get('token')) or (_ for _ in ()).throw(ValueError("'token' is required"))-instance: str = as_envvar(settings.get('instance')) or (_ for _ in ()).throw(ValueError("'instance' is required"))···-success = database.try_insert_repost(self.db, status['id'], reblog['id'], self.user_id, self.service)-success = database.try_insert_post(self.db, status['id'], in_reply, self.user_id, self.service)-async def listen(self, outputs: list[cross.Output], submit: Callable[[Callable[[], Any]], Any]):
+252
-214
mastodon/output.py
+252
-214
mastodon/output.py
···-raise ValueError(f"'visibility' only accepts {', '.join(ALLOWED_POSTING_VISIBILITY)}, got: {visibility}")-self.token = as_envvar(settings.get('token')) or (_ for _ in ()).throw(ValueError("'token' is required"))-instance: str = as_envvar(settings.get('instance')) or (_ for _ in ()).throw(ValueError("'instance' is required"))···-self.supported_mime_types: list[str] = media_config.get('supported_mime_types', POSSIBLE_MIMES)-split_tokens = cross.split_tokens(tokens, self.max_characters, self.characters_reserved_per_url)·········-LOGGER.error("Failed to boost status! status_code: %s, msg: %s", rsp.status_code, rsp.content)-reposted_mappings = database.find_mappings(self.db, repost['reposted_id'], self.service, self.user_id)
+26
-17
misskey/common.py
+26
-17
misskey/common.py
···-def __init__(self, instance_url: str, note: dict, tokens: list[cross.Token], files: list[MediaInfo]) -> None:
+115
-92
misskey/input.py
+115
-92
misskey/input.py
···-raise ValueError(f"'allowed_visibility' only accepts {', '.join(ALLOWED_VISIBILITY)}, got: {allowed_visibility}")+f"'allowed_visibility' only accepts {', '.join(ALLOWED_VISIBILITY)}, got: {allowed_visibility}"-self.token = as_envvar(settings.get('token')) or (_ for _ in ()).throw(ValueError("'token' is required"))-instance: str = as_envvar(settings.get('instance')) or (_ for _ in ()).throw(ValueError("'instance' is required"))-success = database.try_insert_repost(self.db, note['id'], renote['id'], self.user_id, self.service)···-async def listen(self, outputs: list[cross.Output], submit: Callable[[Callable[[], Any]], Any]):
+8
-5
misskey/mfm_util.py
+8
-5
misskey/mfm_util.py
······
+118
-67
util/database.py
+118
-67
util/database.py
·········-def insert_repost(db: DataBaseWorker, identifier: str, reposted_id: int, user_id: str, serivce: str) -> int:-def insert_reply(db: DataBaseWorker, identifier: str, user_id: str, serivce: str, parent: int, root: int) -> int:······-def store_data(db: DataBaseWorker, identifier: str, user_id: str, service: str, extra_data: dict) -> None:···-def find_mappings(db: DataBaseWorker, original_post: int, service: str, user_id: str) -> list[str]:···-def find_post(db: DataBaseWorker, identifier: str, user_id: str, service: str) -> dict | None:···-reply_mappings: list[str] | None = find_mappings(db, reply_data['id'], output_service, output_user)
+82
-79
util/html_util.py
+82
-79
util/html_util.py
······
+44
-33
util/md_util.py
+44
-33
util/md_util.py
···-MD_INLINE_LINK = re.compile(r"\[([^\]]+)\]\(\s*((?:(?:[A-Za-z][A-Za-z0-9+.\-]*://)|mailto:)[^\s\)]+)\s*\)", re.IGNORECASE)-MD_AUTOLINK = re.compile(r"<((?:(?:[A-Za-z][A-Za-z0-9+.\-]*://)|mailto:)[^\s>]+)>", re.IGNORECASE)-def tokenize_markdown(text: str, tags: list[str], handles: list[tuple[str, str]]) -> list[cross.Token]:···-def __tokenize_md(text: str, tags: list[str], handles: list[tuple[str, str]]) -> list[cross.Token]:············
+73
-56
util/media.py
+73
-56
util/media.py
············-proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)-proc = subprocess.Popen(cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+20
-13
util/util.py
+20
-13
util/util.py
···