Code Monkey home page Code Monkey logo

telegram-cli-backup's Introduction

telegram-cli-backup

A simple and dirty lua script to backup Telegram messages into a CSV file or a sqlite database.

How

Change first two lines of the script and set your contact name and message count. Then send the lua script to telegram-cli. If using CSV type, only lua is needed, if writing to a sqlite database, sqlite3 library should be installed (via luarocks for example).

$ telegram-cli -s backup.lua

Requirements

And if writing to a sqlite database:

  • Lua lsqlite3 (can be installed by $ luarocks install lsqlite3)

telegram-cli-backup's People

Contributors

hletrd avatar mycelin avatar psamim avatar shouya avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

telegram-cli-backup's Issues

Module 'lsqlite3' not found - version mismatch

Hi, after installing lua and sqlite3 (using luarocks) I get the output below.
Looks like the script is looking for lsqlite3.so in /usr/local/share/lua/5.2 but it was actually installed in /usr/local/share/lua/5.1. Lua version is 5.2.

How can I make the script look for the right path or version?

*** lua: backup.lua:53: module 'lsqlite3' not found:
no field package.preload['lsqlite3']
no file '/usr/local/share/lua/5.2/lsqlite3.lua'
no file '/usr/local/share/lua/5.2/lsqlite3/init.lua'
no file '/usr/local/lib/lua/5.2/lsqlite3.lua'
no file '/usr/local/lib/lua/5.2/lsqlite3/init.lua'
no file '/usr/share/lua/5.2/lsqlite3.lua'
no file '/usr/share/lua/5.2/lsqlite3/init.lua'
no file './lsqlite3.lua'
no file '/usr/local/lib/lua/5.2/lsqlite3.so'
no file '/usr/lib/x86_64-linux-gnu/lua/5.2/lsqlite3.so'
no file '/usr/lib/lua/5.2/lsqlite3.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './lsqlite3.so'

How do I start the script?

I know that I am kinda a noob but if I try to start the "telegram-cli -s backup.lua" command it gives me the error: telegram-cli: command not found
What do I do wrong?
Can you give me a detailed guide on how to start the script

I have lua installed and telegram-cli

Export history limit

Hi Samim,

If possible, please take a look at the source and see if you can make it work to keep history more than 500+
Right now I only can use 500 which is not adequate.
For 800 configuration, I got the following error after the messages have been exported:
*** lua: telegram-cli-backup/backup.lua:15: bad argument #1 to 'write' (string expected, got nil)

Thanks

contact_list backup support?

Is it possible to modify the script to make a backup of names and phones from the contact list instead of the dialog list?
I was able to disable the message backup feature and just get the names and phones, but they are taken from dialog list, not contact list.
Thanks

Never executed

I've tried properly everything: sqlite3 by using luarocks, the tg client and getted the script.

Then I execute the following:
bin/telegram-cli -s bin/backup.lua

And it executes the telegram-cli but not the script: there's no info in the sqlite nor print the "done". So, I assume that's not doing nothing.

Any idea?

Any way to import?

Can I import this backup to another account in some way?
For example by using Telegram import feature in some way.

Limits?

Hello!

Do you now limits of this?
is it possible to retrieve all text messages from 2014 till 2017?
it is about 100000 of them

partial backup

Hi and thanks for your script.
I want to backup my profile every day; but in this way it takes a lot of times, because I'm member of many groups.
can you add partial backup ability to your script?

Offset

Hi, I want to retrieve all my 35000 messages of one of my contacts.

It is possible to send offset in history method but I don't know how to add this option.

Can you guide me?

No public keys found

Hi,

when running your script (../tg/bin/telegram-cli -s backup.lua), I just get
" *** No public keys found"
after the configuration shown.

Is there something I'm doing wrong?

Do you need more information?

Cheers

I want to save history from a certain group

Hi I would like to save only the newest message ( or like only few ones) so the best idea is cron job which runs the script like every ~10 minutes (cron job). Is there a better way. I also want it only from a certain channel but I'd use another profile, afaik this option is not in telegram-cli

documentation

LuaSQL need to be installed, not LuaSQLite3.

$ luarocks install luasql-sqlite3

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.