-
-
Save stek29/8a7ac0e673818917525ec4031d77a713 to your computer and use it in GitHub Desktop.
message "ValueError: 33 is not a valid TelegramMediaAction.Type". It fails on some enum. How can I fix that?
Newer action types can be found in sources here: https://github.com/TelegramMessenger/Telegram-iOS/blob/45fa1b5ddb3a9a794bf407cb8d9bf2d0e4643b1f/submodules/TelegramCore/Sources/SyncCore/SyncCore_TelegramMediaAction.swift#L136-L262
Other enums:
- MessageTags: https://github.com/TelegramMessenger/Telegram-iOS/blob/45fa1b5ddb3a9a794bf407cb8d9bf2d0e4643b1f/submodules/TelegramCore/Sources/SyncCore/SyncCore_Namespaces.swift#L156-L171
- MessageFlags https://github.com/TelegramMessenger/Telegram-iOS/blob/45fa1b5ddb3a9a794bf407cb8d9bf2d0e4643b1f/submodules/Postbox/Sources/Message.swift#L858-L870
IOS not have
.tempkeyEncryptedfile, is.tempkey, and is 48 bytes not 64 bytes, code maybe not work. : (
@badguy123 then it should just be the key and salt in unencrypted form, try that
dbKey = data[0:32]
dbSalt = data[32:48]@lindsaymorgan I think @ekzotech wrote about it, try this
Also there's an error with calling murmur because of mmh3 update 5.0.0 - it fails with negative seed. As workaround you can install mmh3==4.1.0 worked for me.
@lindsaymorgan or see hajimes/mmh3#119
@lindsaymorgan I’ve updated the gist code, hope I didn’t mess it up
@lindsaymorgan I think @ekzotech wrote about it, try this@lindsaymorgan我认为@ekzotech写过它,试试这个
Also there's an error with calling murmur because of mmh3 update 5.0.0 - it fails with negative seed. As workaround you can install mmh3==4.1.0 worked for me.此外,由于 mmh3 更新 5.0.0 而调用 murmur 时出错 - 它失败并出现负种子。作为解决方法,您可以安装 mmh3==4.1.0 对我有用。
It works! Thank you so much!
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.
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.
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
Hey, thanks so much for this. I'm trying to extract the key to decrypt db - I don't have a local passcode, only the cloud one, and I'm getting raise Exception(f'hash mismatch: {dbHash} != {calcHash}'). Any ideas on what else I could try?
Hey, thanks so much for this. I'm trying to extract the key to decrypt db - I don't have a local passcode, only the cloud one, and I'm getting
raise Exception(f'hash mismatch: {dbHash} != {calcHash}'). Any ideas on what else I could try?
The same issue for me. No password, but still hash mismatch.
@ianwongkj @aromanyuk works fine for me on 11.13.273693 Stable. Maybe you're trying to pass cloud password instead of default no-matter-key?
Big thanks for the working script! was able to retrieve all the messages on Mac. Please direct me how do I acquire the dump from IOS? only found belkasoft which looks difficult to get
It did the job for me to recover some accidentally deleted messages. Thank you!
Hey @stek29,
Thank you for the original research and examples — it saved me a headache today. A family member accidentally removed a chat, but we managed to keep a Mac offline long enough to recover the local cache. Your work made it possible to build a clean, user‑friendly tool that exports Telegram (macOS) chats to HTML, Markdown, or CSV.
I’ve published it here to help others in the same situation:
https://github.com/soakes/telegram-message-exporter
You’re credited in the README. If you see anything worth improving, feel free to open an issue or PR.
Thanks again — this was hugely helpful.
Hey @soakes, that's amazing, thank you for sharing!
Just in case I'd like to clarify that I absolutely do not mind since this gist didn't state any license.
A minor suggestion is not to call the app "Telegram Desktop" since Telegram Desktop is the name of the cross-platform Qt app (named Telegram Lite in App Store for some reason) to avoid confusion — the native Telegram macOS app is different from Telegram Desktop.
Hey @soakes, that's amazing, thank you for sharing!
Just in case I'd like to clarify that I absolutely do not mind since this gist didn't state any license.
A minor suggestion is not to call the app "Telegram Desktop" since Telegram Desktop is the name of the cross-platform Qt app (named Telegram Lite in App Store for some reason) to avoid confusion — the native Telegram macOS app is different from Telegram Desktop.
Hi @stek29
Great catch!
Will rename it later today.
Any ideas what we shell call it?
In brew its just called telegram, in the app its just called the same.
Open to suggestions for app name and repo name.
I will also adjust the documentation to make sure its clear which version its for.
Update
I have just made some adjustments, see what you think.
https://github.com/soakes/telegram-message-exporter/pull/4/changes

IOS not have
.tempkeyEncryptedfile, is.tempkey, and is 48 bytes not 64 bytes, code maybe not work. : (