Giter Site home page Giter Site logo

Comments (9)

blaize9 avatar blaize9 commented on September 1, 2024 3

@LeoDJ @tvdstaaij
I have submitted a pull request to vysheng/tgl/pull#106 which would fix the underlying problem with tgl_do_load_photo which is called load_photo in telegram-cli that causes the client to crash when requesting an Empty Message thus fixing telegram-history-dump.

from telegram-history-dump.

tvdstaaij avatar tvdstaaij commented on September 1, 2024 1

I'm afraid this is a telegram-cli issue. SIGNAL received basically means it crashed unexpectedly, no implicit conversion of nil into String means my script got no response from telegram-cli to its load_photo command but tried to parse it anyway.

You can probably reproduce this issue with just telegram-cli by doing this:

  • Create a JSON dump with telegram-history-dump (you probably have one already) without downloading media
  • Identify one of the problematic images in the JSON files and note the 'id' property of the message object
  • Start telegram-cli normally and enter the command load_photo xxxxxx, using the message id you found

I recommend filing this as a telegram-cli issue so it can hopefully get a proper fix. In the meantime, as a workaround, you could hack the script a bit to ignore images from ImageBot (assuming those are the only images triggering this crash). Specifically, after this check, you could add another one like this:

return if msg['from'] && msg['from']['username'] == 'ImageBot'

from telegram-history-dump.

LeoDJ avatar LeoDJ commented on September 1, 2024 1

Thanks, that fix worked (almost).
It got way further in downloading media. But at some point it crashed again...
I looked into the last file it created and found the first photo entry without a "file" attribute. And who would have thought, the message came from ImageBot... Only that it wasn't sent directly but forwarded πŸ˜’

So, I quickly threw in that piece of code:

return if msg['fwd_from'] && msg['fwd_from']['username'] == 'ImageBot'

and now it works like a charm 😊

Thanks again for the help, now all my data is safe.

tl;dr: For anyone who might come by this issue again, here are the two lines and where I added them:

def process_media(dialog, msg)
  return unless msg.include?('media')
  return if msg['from'] && msg['from']['username'] == 'ImageBot'
  return if msg['fwd_from'] && msg['fwd_from']['username'] == 'ImageBot'

from telegram-history-dump.

tvdstaaij avatar tvdstaaij commented on September 1, 2024 1

@LeoDJ some additional background: I believe the issue you encountered is vysheng/tg#904. I had the same issue recently, probably caused by people sending gifs (which technically aren't actually gifs by the way, Telegram converts them to videos, heh). If you or anyone else runs into this again, try compiling rnhmjoj's fork or applying the workaround patch manually.

from telegram-history-dump.

LeoDJ avatar LeoDJ commented on September 1, 2024

Edit: Also happens when trying to backup a chat with many ImageBot-Images...
Therefore had to disable media downloading, which I really wanted to do :(

from telegram-history-dump.

LeoDJ avatar LeoDJ commented on September 1, 2024

Thanks, I will try that later

Really cool project btw, keep up the good work πŸ‘

from telegram-history-dump.

tvdstaaij avatar tvdstaaij commented on September 1, 2024

Nice hacking. Too bad you didn't get the ImageBot images, I'm sure you had a strong emotional attachment to them πŸ˜‰

from telegram-history-dump.

LeoDJ avatar LeoDJ commented on September 1, 2024

Thank you very much.

from telegram-history-dump.

blaize9 avatar blaize9 commented on September 1, 2024

@LeoDJ I keep on joining a lot of random channels and have yet to re-encounter this issue.
How does the fix work for you?

from telegram-history-dump.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.