Giter Site home page Giter Site logo

Comments (17)

gabeio avatar gabeio commented on July 28, 2024 1

telegram-cli -k --json -P 9009 does not return json over 9009...

I had to run ./telegram-cli -d --json -P 9009 --json for some reason...

from telegram-history-dump.

tvdstaaij avatar tvdstaaij commented on July 28, 2024

You shouldn't terminate telegram-cli but keep it running until the backup is done. So basically you need two terminals / terminal tabs in your situation.

from telegram-history-dump.

saeeds255 avatar saeeds255 commented on July 28, 2024

ok, I used screen on ssh and this issue have solved .
After running the script, I got some telegram chats then the following message

I, [2016-08-23T08:13:25.320190 #12410]  INFO -- : Backing up 0 dialogs: (none)
I, [2016-08-23T08:13:25.320393 #12410]  INFO -- : Formatting messages
W, [2016-08-23T08:13:25.320566 #12410]  WARN -- : Config options "copy_media" or "download_media.document|photo|..." not enabled. HTML dump might be missing images and/or files.
I, [2016-08-23T08:13:25.321965 #12410]  INFO -- : HTML export finished, see: output/formatted/html/index.html
I, [2016-08-23T08:13:25.322168 #12410]  INFO -- : Finished

So the output file is empty. this is my config file with html as output format

backup_users: [
        'my telegram username without @ or something else'
  ]

  # Array of group dialogs to backup
  backup_groups: [
    null
  ]

  # Array of supergroup dialogs to backup
  backup_supergroups: [
    null
  ]

  backup_channels: [
    null
  ]

Is there something wrong ?

from telegram-history-dump.

tvdstaaij avatar tvdstaaij commented on July 28, 2024

backup_users is not meant for putting your own username, but rather the user dialog names you want to backup. You can just leave it empty ([]) to backup dialogs with all of your contacts. If you do the same for backup_groups (remove the null) it will backup all group dialogs as well.

from telegram-history-dump.

saeeds255 avatar saeeds255 commented on July 28, 2024

Thanks ! I entered the user dialog name and it started.
but there is a problem. when it gets to a broken link, it returns error and start from the beginning, there should be a way to pass the broken links.
can you give me a solution how to edit the ruby script for solving this problem now?

from telegram-history-dump.

tvdstaaij avatar tvdstaaij commented on July 28, 2024

I don't understand what you mean by "when it gets to a broken link", can you elaborate? Can you show a log and/or example output?

from telegram-history-dump.

saeeds255 avatar saeeds255 commented on July 28, 2024

I get this error

E, [2016-08-23T22:29:53.485753 #25969] ERROR -- : Failed to download media file: no implicit conversion of nil into String
E, [2016-08-23T22:29:53.487990 #25969] ERROR -- : Failed to download media file: Broken pipe
I, [2016-08-23T22:29:53.550530 #25969]  INFO -- : Dumping "......" (range 73601-74000)
telegram-history-dump.rb:35:in `write': Broken pipe (Errno::EPIPE)
        from telegram-history-dump.rb:35:in `puts'
        from telegram-history-dump.rb:35:in `exec_tg_command'
        from telegram-history-dump.rb:68:in `block in dump_dialog'
        from /usr/lib/ruby/2.3.0/timeout.rb:91:in `block in timeout'
        from /usr/lib/ruby/2.3.0/timeout.rb:33:in `block in catch'
        from /usr/lib/ruby/2.3.0/timeout.rb:33:in `catch'
        from /usr/lib/ruby/2.3.0/timeout.rb:33:in `catch'
        from /usr/lib/ruby/2.3.0/timeout.rb:106:in `timeout'
        from telegram-history-dump.rb:67:in `dump_dialog'
        from telegram-history-dump.rb:323:in `block in <main>'
        from telegram-history-dump.rb:319:in `each'
        from telegram-history-dump.rb:319:in `each_with_index'
        from telegram-history-dump.rb:319:in `<main>'

I don't know exactly what it means but I think it can't download a file because "404 not found" error or something, by the way I'm not sure about this.

from telegram-history-dump.

uyouu avatar uyouu commented on July 28, 2024
I, [2016-08-24T16:05:10.859844 #14821]  INFO -- : Attaching to telegram-cli control socket at localhost:9009
telegram-history-dump.rb:26:in `initialize': Connection refused - connect(2) for                             "localhost" port 9009 (Errno::ECONNREFUSED)
        from telegram-history-dump.rb:26:in `open'
        from telegram-history-dump.rb:26:in `connect_socket'
        from telegram-history-dump.rb:276:in `<main>'

Encountered the same problem. But using screen or multiply terminals doesn't help. Any advice's?

from telegram-history-dump.

tvdstaaij avatar tvdstaaij commented on July 28, 2024

This is not supposed to happen, perhaps something changed in telegram-cli or the Telegram api. I'll take a look at it as soon as I can.

from telegram-history-dump.

tvdstaaij avatar tvdstaaij commented on July 28, 2024

@uyouu how are you running telegram-cli?

from telegram-history-dump.

uyouu avatar uyouu commented on July 28, 2024

At first, im running telegram-cli via screen:
screen bin/telegram-cli -k tg-server.pub --json -P 9009
Then, im hiding the telegram-cli screen (Ctrl+A+D) and try to execute your script:
ruby telegram-history-dump.rb
And after all i get an error message, which i have posted before.

from telegram-history-dump.

saeeds255 avatar saeeds255 commented on July 28, 2024

@tvdstaaij Thanks, I can't check that message because I should scroll up to reach range of 73601-74000 !!
If you know an easier way how to do this, tell me and I will check that messages to see what is it all about I think it's better to know what exactly that message is.
I'll be waiting for your update about this ...

from telegram-history-dump.

saeeds255 avatar saeeds255 commented on July 28, 2024

@uyouu at first type this bin/telegram-cli -k --json -P 9009 and check if telegram is running correctly, you should see messages in json format then detach the screen then run a new screen by typing screen then try ruby ./telegram-history-dump.rb

from telegram-history-dump.

uyouu avatar uyouu commented on July 28, 2024

@saeeds255 that is exactly what i did.

from telegram-history-dump.

saeeds255 avatar saeeds255 commented on July 28, 2024

@uyouu that should work, I had the same problem and had been solved.
I think you did something wrong in these steps

from telegram-history-dump.

tvdstaaij avatar tvdstaaij commented on July 28, 2024

@uyouu That should indeed work. I personally prefer tmux over screen these days, you could try that as an alternative:

  • Install tmux and start a new session by running tmux
  • Start telegram-cli with the right arguments
  • Open a new tab with Ctrl-B C (meaning control+B, release, then press C)
  • Start telegram-history-dump.rb

You can switch between the tabs with Ctrl-B N.

@saeeds255 As for your issue, the problem is that telegram-cli can be rather unstable, especially when media downloading is involved, and simply crashes in some situations. Unfortunately my script can't prevent telegram-cli from crashing. I'm currently playing with some ideas for a v3 of this script that would automatically run telegram-cli in the background. Then if it crashes, it could also be restarted and proceed from the next chunk. For now I recommend disabling media downloads, just the message data does not crash the latest version of telegram-cli as far as I know.

from telegram-history-dump.

scoope3 avatar scoope3 commented on July 28, 2024

Hi, one year later and experiencing the same connection refused issue with the telegram-history-dump command.

I installed tmux thinking that it could be a multiplexer issue and no dice. Is there anything I need to examine in the config.yaml file for further evaluation?

I have set maximum dialogues to 10000; chunk_size is set to 10; chunk_delay is 3.0. Not sure if rate limiting could be an issue-although this throttling is very slow.

`I, [2017-09-26T20:52:04.923064 #22683]  INFO -- : Attaching to telegram-cli control socket at localhost:9009
telegram-history-dump.rb:36:in `initialize': Connection refused - connect(2) for "localhost" port 9009 (Errno::ECONNREFUSED)
    from telegram-history-dump.rb:36:in `open'
    from telegram-history-dump.rb:36:in `connect_socket'
    from telegram-history-dump.rb:320:in `<main>'`

I'm not sure what else to do at this point?

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.