-
Notifications
You must be signed in to change notification settings - Fork 84
/
config.yaml
149 lines (112 loc) · 4.34 KB
/
config.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
---
## Backup targets ##
#
# Array of strings for each category
# Strings can be either a (partial) name or a telegram-cli "peer_id" value
# An empty array means "everything in this category"
# An array containing only null means "nothing in this category"
# Array of user dialogs to backup
backup_users: [
]
# Array of group dialogs to backup
backup_groups: [
]
# Array of supergroup dialogs to backup
backup_supergroups: [
null
]
# Array of broadcast channels to backup
# WARNING: using this can cause a crash when a channel has too many messages
# to fit in a single chunk (see https://github.com/vysheng/tg/issues/947)
backup_channels: [
null
]
# Array of (partial) names / peer IDs *not* to backup even if they match
# any of the above target selectors
blacklist: [
]
# By default telegram-cli returns only the first 100 dialogs/channels
# We increase this to 1000. If you have even more, increase this value
maximum_dialogs: 1000
## Output options ##
# Formatters export the JSON output to a different format
# To enable a formatter, uncomment it along with all of its options
# If no formatters are enabled, only JSON files are produced
formatters: {
# plaintext: {
# date_format: '%Y-%m-%d %H:%M:%S'
# },
# bare: {},
# pisg: {},
# html: {
# paginate: 1500, # messages per page
# use_utc_time: false,
# timestamps_every: 50, # messages
# loop_video: true, # loop and autoplay videos
# },
}
# Target directory for the backup files
# If this is a relative path it will be relative to the script's directory
# Absolute path starts with '/' or '~'
backup_dir: './output'
# Data file naming style:
# True for "My_Chat_Name.jsonl", false for "193044.jsonl" (fixed id)
friendly_data_filenames: true
# True to rename data files when their name changes
# For example, "My_Chat_Name.jsonl" is renamed to "WhoChangedTheTitle.jsonl"
update_data_filenames: true
# Maximum number of messages to backup for each target (0 means unlimited)
backlog_limit: 0
# At the time of writing, telegram-cli does not properly detect audio/video
# These will be recognized as documents instead
# Stickers are also considered documents
download_media: {
photo: false,
document: false,
audio: false,
video: false,
}
# False to reference downloaded files in the telegram-cli cache
# True to copy downloaded media to a dedicated directory per dialog
copy_media: false
# True to delete media files from telegram-cli cache right after downloading
# Effectively turns copy_media into move_media
# Beware: this will cause media files to be redownloaded every backup run
delete_media: false
# When a user's real name is formatted, include their last name if possible
display_last_name: true
## Technical options ##
# Use a unix socket to communicate with telegram-cli
# Should match the path passed to telegram-cli with the -S option
#
# NB: Setting tg_sock to some not false value will cause the script
# to ignore the next options about TCP connection
# tg_sock: "/var/run/telegram.sock"
tg_sock: null
# Address of the machine you are running telegram-cli on
# If this is not localhost telegram-cli must be invoked with --accept-any-tcp
tg_host: 'localhost'
# Should match the port passed to telegram-cli with the -P option
tg_port: 9009
# Number of messages to request in one chunk
chunk_size: 100
# Time in seconds to wait between requesting chunks
chunk_delay: 1.0
# Time in seconds to wait before considering a request stuck (0 = infinite)
chunk_timeout: 10
# Number of times to retry getting one chunk
chunk_retry: 3
# Time in seconds to wait before considering a download stuck (0 = infinite)
# After this time the script skips to the next message
media_timeout: 100
## Advanced behavior settings ##
# Enables incremental backups (progress is tracked in <outdir>/progress.json)
# Setting this to false will force a complete re-run of the backup every time
track_progress: true
# Replacement string for the characters in dialog names which are potentially
# problematic in filenames
# You can set this to '' if the dialog names are unique enough
character_substitute: '_'
# Skip messages if their text matches this Ruby regex
# Example: '/forbidden|words/i'
filter_regex: null