Closed zydjohnHotmail closed 2 years ago
tg-archive does not require the Telegram desktop client to be installed. Once you set it up (as described in the README), you can automatically export a channel by simply running tg-archive --sync
. If you have multiple groups, you might have to create multiple configuration files, a one time exercise, that is all.
I am unsure what the parameters you're referring to are. Please refer to the README and try out the program to understand how it works.
Hello: I mean the following, if you used Telegram desktop to export public channel, you will know this: From Telegram desktop, when I want to export channel chats, I have to set the following parameters:
Type of messages: I want to include: Photos, Videos, Video messages, Files. Size limit: default is 8MB, which is too small, I want to increase it to 100MB. Format: default is HTML, but I want to change it to Json Path: default is C:\Downloads\Telegram Desktop …, I want to change it to something like: D:\Telegram\Export\Channel. From time, the default is the oldest message, I want to change it to from yesterday's message. To time, it is OK to set it to present. Therefore, I have to provide 6 parameters (the type of messages, there are 3 more items to set) before I can run export one channel chats. Please give me an example how to use your repo to export one public channel chats using the above 6 parameters. Thank you very much,
tg-archive will export everything in a group. Audio, video, all files, irrespective of size. Paths etc. can be configured in config.yml. tg-archive offers a variety of configuration options.
Please give me an example how to use your repo to export one public channel chats using the above 6 parameters.
Please refer to the README and try out the program with one channel understand how it works.
Hello: I study the README and I know something now, but I want to know if I can export public channel chats and save all the files in my local hard drive, as I don't own any web sites or pages. From the config.xml file, I see the following:
site_url: "https://mysite.com" site_name: "@{group} - Telegram group archive" site_description: "Public archive of Telegram messages." meta_description: "@{group} {date} - Telegram message archive." page_title: "Page {page} - {date} @{group} Telegram message archive."
Since I don't have my own web site now, can I export the channel chats and save all the files in my local hard driver? Please advise, Thanks,
Yes. You can set the site URL param to a single dot, eg site_url: "."
. When you run tg-archive --build
, the HTML site will be generated in a directory called site
on your machine, which you can then view in a browser. There is no need to host a website.
Hello: Thanks for your reply. Now, I have 2 issues: 1) The command tg-archive, I can't find it. It is a python script? I can see setup.py, but can't see tg-archive in python. 2) From the requirement.txt file, I didn't see there is any requirement for sqlite3, but it seems there is a need for sqlite3 to create small database, do I have to install sqlite3 in order to use the repo?
Please follow the README! The installation instructions are here: https://github.com/knadh/tg-archive#install
Hello: Thanks for your reply. Now I can export a small public channel chats. It has nearly 3000 small files. However, I want to export 2 big public channel chats. Each of them has more than 200K channel members, and has millions of files (quite a number of them are video files, like .mp4 files). Is there any way that I can find some starting points, not from the very beginning of the public channel. For example, how I can find a strart point where I begin export all the channel chats for less than 24 hours? Thanks,
Yes. The first time you run the sync, you can pass the --from-id
parameter. Eg: tg-archive --from-id=12345
, where you provide the ID of the message from where you wish to start the sync. Everything older than this is ignored and only messages from this ID and beyond are synced. You only need to pass --from-id
this on the first run.
Every message in Telegram has a sequential, numerical ID. You can look at a tutorial like this to find the id of a message.
Hello: I have joined about 30 public channels, I want to export 2 of them, the channel chats every day. I am using Windows 10, and Telegram desktop version 4.0.1, I can export channel chats by hand from Telegram desktop by setting 6 different parameters. However, this type of job is tedious, I want to know if I can use this repo to make channel chats exporting job as a Python script, so I can call the Python script later on, I don't have to do the job by hand every day. Please advise: how to provide 6 parameters, so I can use the repo to export one public channel chats. Thanks,