+52
-18
README.md
+52
-18
README.md
···+listens to the user's home timeline for new posts, crossposts only the public/unlisted ones by the user.any instance implementing `/api/v1/instance`, `/api/v1/accounts/verify_credentials` and `/api/v1/streaming?stream` will work fine.
+286
-15
bluesky.py
+286
-15
bluesky.py
···+assert reply_data, "reply_data requested, but doesn't exist in db (should've been skipped bt firehose)"+reply_mappings = [json.loads(data[0]) for data in database.find_mappings(self.db, reply_data['id'], SERVICE, login.did)]+reply_record = models.AppBskyFeedPost.CreateRecordResponse(uri=str(reply_mappings[-1]['uri']), cid=str(reply_mappings[-1]['cid']))+root_record = models.AppBskyFeedPost.CreateRecordResponse(uri=str(reply_mappings[0]['uri']), cid=str(reply_mappings[0]['cid']))+root_mappings = [json.loads(data[0]) for data in database.find_mappings(self.db, reply_data['root_id'], SERVICE, login.did)]+root_record = models.AppBskyFeedPost.CreateRecordResponse(uri=str(root_mappings[0]['uri']), cid=str(root_mappings[0]['cid']))+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.info("Skipping post_id '%s'. Attachment type mismatch. got: '%s' expected: 'image'", post.get_id(), attachment.get_type())+LOGGER.error("Skipping post_id '%s', failed to download attachment! File too large?", post.get_id())······
+109
cross.py
+109
cross.py
···
+118
-108
database.py
+118
-108
database.py
···+def insert_reply(db: DataBaseWorker, identifier: str, user_id: str, serivce: str, parent: int, root: int) -> int:+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:
+91
-378
main.py
+91
-378
main.py
···-def create_post_records(self, status: dict) -> list[models.AppBskyFeedPost.CreateRecordResponse] | None:-labels = models.ComAtprotoLabelDefs.SelfLabels(values=[models.ComAtprotoLabelDefs.SelfLabel(val=label) for label in label_text])-root_post = models.AppBskyFeedPost.CreateRecordResponse(uri=str(root_data['uri']), cid=str(root_data['cid']))-reply_post = models.AppBskyFeedPost.CreateRecordResponse(uri=str(reply_data['uri']), cid=str(reply_data['cid']))-aspect_ratio = models.AppBskyEmbedDefs.AspectRatio(width=meta['width'], height=meta['height'])-click.echo(f"Skipping post_id '{status['id']}'. Attachment type mismatch. got: '{attachment['type']}' expected: 'image'")-click.echo(f"Skipping post_id '{status['id']}', media attachment still too large after compression!")-image_aspect_ratios.append(models.AppBskyEmbedDefs.AspectRatio(width=meta['width'], height=meta['height']))-# also, since the db only stores post relations, we have to pull all the replies from masto and the pds.-@click.option('--data_dir', default='./data', type=click.Path(exists=True, file_okay=False, dir_okay=True, readable=True, writable=True))···
+235
-23
mastodon.py
+235
-23
mastodon.py
···+async def listen(self, outputs: list[cross.Output], submit: Callable[[Callable[[], Any]], Any]):
+12
-25
media_util.py
+12
-25
media_util.py
···············
+2
-1
pyproject.toml
+2
-1
pyproject.toml
···
+35
-26
util.py
+35
-26
util.py
············while i < length and md[i] != '[' and not (md[i] == '!' and i + 1 < length and md[i + 1] == '['):············
+14
uv.lock
+14
uv.lock
···+sdist = { url = "https://files.pythonhosted.org/packages/c9/aa/4acaf814ff901145da37332e05bb510452ebed97bc9602695059dd46ef39/bs4-0.0.2.tar.gz", hash = "sha256:a48685c58f50fe127722417bae83fe6badf500d54b55f7e39ffe43b798653925", size = 698, upload-time = "2024-01-17T18:15:47.371Z" }+{ url = "https://files.pythonhosted.org/packages/51/bb/bf7aab772a159614954d84aa832c129624ba6c32faa559dfb200a534e50b/bs4-0.0.2-py2.py3-none-any.whl", hash = "sha256:abf8742c0805ef7f662dce4b51cca104cffe52b835238afc169142ab9b3fbccc", size = 1189, upload-time = "2024-01-17T18:15:48.613Z" },······