-
-
Save stek29/8a7ac0e673818917525ec4031d77a713 to your computer and use it in GitHub Desktop.
This has been working great for me for awhile. But recently, I've been getting an exception on this line in the TelegramMediaFile decoder:
self.fileId = (bio.read_int32(), bio.read_int64())
The call to read_int32()
is failing because when it reads the buffer, it's getting b''
. This isn't happening for all Media Files, but it is happening for a lot of them. I'm assuming it's some new feature in Telegram that's causing this, but I thought I would ask here if anyone knows what the change is, before spending time trying to dig into what's causing it.
Thank you very much for your work, it's so helpful!
I was able to get the FORWARDED messages with my partial code:
if msg.get('fwd'):
fwd_info = msg['fwd']
if isinstance(fwd_info, dict):
author_id = fwd_info.get('author')
date = fwd_info.get('date')
signature = fwd_info.get('signature')
fwd_parts = []
if author_id:
fwd_parts.append(f"author: {peer_str(author_id)}")
if date:
fwd_parts.append(f"date: {datetime.datetime.fromtimestamp(date).strftime('%Y-%m-%d %H:%M:%S')}")
if signature:
fwd_parts.append(f"signature: {signature}")
fwd_str = " | ".join(fwd_parts)
full_content = f"[FORWARDED {fwd_str}]{full_content}[/FORWARDED]"
But I am unable to handle REPLY messages.
Ideally I would like to output in this format:
"[REPLY from user name or phone]the original message[/REPLY]additionnal message if exists"
Do you think you can help about this?
I noticed raw mgs data contains some things like:
{'i': 123456789101112, 'p': 654321, '@type': 478003709} from "attributes"
It looks to tells it's a reply message (probably from it's "@type" value), I can say the current message is from the peer_id "654321" but the quoted reply is NOT from peer_id "654321".
I can't get what this "i" with the value "123456789101112" represents and how to get the message referenced by "123456789101112".
I'm maybe in the wrong way with the mgs attributes, don't know.
I tried few things already based on SyncCore_ReplyMessageAttribute.swift for example but I don't know why I can't get the data.
Thanks again for your time!
I assume this needs to be ran on the host machine? I've tried exporting the account postbox directory to another machine and running the jup notebook but doesn't seem to be working. Does the notebook file need to be in the same directory with the db_sqlite? Once I run the jup notebook server and open this ipynb I just get a 0 byte DB and an error saying no such table T7
Just looking for initial setup guidance.
...
Just looking for initial setup guidance.
Hi, You better install Python (v3.10x or later), copy the code parts within a .PY file, edit this line "con = sqlite3.connect('plaintext.db')" to match the path of the db_sqlite file and execute the .PY with Python.
How to get the Sqlite DB file from an Android phone or Windows desktop computer? I searched a lot, but can't find them.
I'm stuck in the fist step of the problem 🤷
@pauloneves this is for iOS/macOS apps only, other apps are completely different
It works! Thank you so much!