-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.schema.json
More file actions
373 lines (373 loc) · 8.95 KB
/
config.schema.json
File metadata and controls
373 lines (373 loc) · 8.95 KB
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
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "gataku configuration",
"description": "Top-level settings for the gataku archiver.",
"type": "object",
"properties": {
"paths": {
"type": "object",
"title": "Filesystem paths",
"description": "Override download/log/archive/tmp/hash DB locations.",
"properties": {
"download": {
"type": "string",
"description": "Root directory for downloaded media."
},
"logs": {
"type": "string",
"description": "Directory where log files are written."
},
"tmp": {
"type": "string",
"description": "Temporary directory for in-flight downloads."
},
"archive": {
"type": "string",
"description": "Archive directory used when deduplicating files."
},
"hashdb_file": {
"type": "string",
"description": "Path to the on-disk hash database (JSONL)."
},
"removed_log_file": {
"type": "string",
"description": "Path to the removed-media log (JSONL)."
}
},
"additionalProperties": false
},
"download": {
"type": "object",
"title": "Download configuration",
"description": "Controls filename patterns, rate limits, and media filters.",
"properties": {
"filename_pattern": {
"type": "string",
"description": "Template used when writing downloaded files."
},
"progress": {
"type": "string",
"enum": [
"off",
"count",
"filesize"
],
"description": "Progress output mode."
},
"useragent": {
"type": "string",
"description": "HTTP User-Agent sent during media downloads."
},
"includes": {
"type": "object",
"title": "Media filters",
"properties": {
"gifv": {
"type": "boolean",
"description": "Download GIFV attachments."
},
"video": {
"type": "boolean",
"description": "Download video attachments."
},
"audio": {
"type": "boolean",
"description": "Download audio attachments."
},
"thumbnail_only": {
"type": "boolean",
"description": "Allow media entries without remote_url."
},
"self": {
"type": "boolean",
"description": "Include posts from your own account."
},
"nsfw": {
"type": "boolean",
"description": "Allow posts marked as sensitive/NSFW."
},
"try_unknown": {
"type": "boolean",
"description": "Treat unknown media as images when extensions match."
}
},
"additionalProperties": false
},
"retry": {
"type": "object",
"title": "Retry policy",
"properties": {
"max_attempts": {
"type": "integer",
"minimum": 1,
"description": "Number of download attempts before failing."
},
"delay": {
"oneOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"$ref": "#/$defs/duration"
}
],
"description": "Delay between retries when rate_control is disabled."
},
"rate_control": {
"type": "boolean",
"description": "Whether to respect rate.delay between retries."
}
},
"additionalProperties": false
},
"rate": {
"type": "object",
"title": "Rate limiting",
"properties": {
"default_rate": {
"oneOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"$ref": "#/$defs/rate"
}
],
"description": "Default posts-per-minute rate (mutually exclusive with delay)."
},
"delay": {
"oneOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"$ref": "#/$defs/duration"
}
],
"description": "Fixed delay between downloads (mutually exclusive with default_rate)."
},
"burst_allowed": {
"type": "boolean",
"description": "Allow bursts instead of evenly spaced downloads."
}
},
"additionalProperties": false
}
},
"additionalProperties": false
},
"classify": {
"type": "object",
"title": "Classification rules",
"description": "Map media/account hosts to logical group labels.",
"properties": {
"rules": {
"type": "array",
"description": "Rules evaluated in order; first matching glob wins.",
"items": {
"type": "object",
"required": [
"match",
"group"
],
"properties": {
"match": {
"type": "string",
"description": "Glob pattern matched against hostnames (case-insensitive)."
},
"group": {
"type": "string",
"description": "Group label stored in logs/database."
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
"archive": {
"type": "object",
"title": "Archive policy",
"properties": {
"enabled": {
"type": "boolean",
"description": "Enable archive behavior instead of deleting duplicates."
},
"policy": {
"type": "string",
"enum": [
"keep_old",
"latest",
"database"
],
"description": "Behavior when encountering duplicates."
},
"log_duplicates": {
"type": "boolean",
"description": "Log duplicate events when encountered."
}
},
"additionalProperties": false
},
"logging": {
"type": "object",
"title": "Logging",
"properties": {
"frequency": {
"type": "string",
"enum": [
"day",
"daily",
"week",
"weekly",
"month",
"monthly",
"quarter",
"quarterly",
"half",
"semester",
"semiannual",
"year",
"yearly",
"annual"
],
"description": "Controls log rotation frequency (day/week/month...)."
},
"filename_pattern": {
"type": "string",
"description": "Custom template for log file paths."
},
"log_removed": {
"type": "boolean",
"description": "Emit logs when media is skipped or removed."
},
"log_duplicate": {
"type": "boolean",
"description": "Emit logs when duplicates are detected."
}
},
"additionalProperties": false
},
"removed": {
"type": "object",
"title": "Removed media handling",
"properties": {
"skip_media_not_found": {
"oneOf": [
{
"$ref": "#/$defs/duration"
},
{
"type": "number",
"exclusiveMinimum": 0
},
{
"type": "string",
"enum": [
"off"
]
}
],
"description": "Duration to skip retrying media URLs that previously returned 404. Use \"off\" to disable."
}
},
"additionalProperties": false
},
"runtime": {
"type": "object",
"title": "Runtime defaults",
"properties": {
"dry_run": {
"type": "boolean",
"description": "When true, do not write files or modify bookmarks."
},
"limit": {
"type": "integer",
"minimum": 1,
"description": "Limit the number of statuses processed per run."
},
"unbookmark": {
"type": "boolean",
"description": "Whether to remove bookmarks after successful downloads."
}
},
"additionalProperties": false
},
"instances": {
"type": "array",
"title": "Configured instances",
"items": {
"type": "object",
"required": [
"name",
"base_url",
"access_token"
],
"properties": {
"name": {
"type": "string",
"description": "User-friendly label for this instance."
},
"base_url": {
"type": "string",
"minLength": 1,
"description": "Base URL (e.g., https://example.social)."
},
"access_token": {
"type": "string",
"description": "App access token."
},
"account_id": {
"type": [
"string",
"integer"
],
"description": "Numeric account ID for skip-self logic."
},
"account_handle": {
"type": "string",
"description": "Full @username@host handle used for skip-self checks."
},
"account_screen_name": {
"type": "string",
"description": "Legacy alias for account_handle."
},
"rate": {
"oneOf": [
{
"type": "number",
"exclusiveMinimum": 0
},
{
"$ref": "#/$defs/rate"
}
],
"description": "Per-instance rate limit (posts per minute)."
},
"unbookmark": {
"type": "boolean",
"description": "Override the global unbookmark flag for this instance."
}
},
"additionalProperties": false
}
}
},
"additionalProperties": true,
"$defs": {
"duration": {
"type": "string",
"pattern": "^\\s*[0-9]+(?:\\.[0-9]+)?(?:\\s+[A-Za-z][A-Za-z\\-]*)+(?:\\s+[0-9]+(?:\\.[0-9]+)?\\s+[A-Za-z][A-Za-z\\-]*)*\\s*$",
"description": "Human-friendly duration (e.g., '5 minutes', '2 hours 30 minutes')."
},
"rate": {
"type": "string",
"pattern": "^\\s*[0-9]+(?:\\.[0-9]+)?\\s*(?:/|per\\s+).+?$",
"description": "Rate expression such as '5/minute' or '2 per hour'."
}
}
}