@@ -21,8 +21,10 @@ mkbrr is a command-line tool to create and inspect torrent files. Fast, single b
21
21
- [ Create a Torrent] ( #create-a-torrent )
22
22
- [ Single Mode] ( #single-mode )
23
23
- [ Batch Mode] ( #batch-mode )
24
+ - [ Preset Mode] ( #preset-mode )
24
25
- [ Create Flags] ( #create-flags )
25
26
- [ Batch Configuration Format] ( #batch-configuration-format )
27
+ - [ Preset Configuration Format] ( #preset-configuration-format )
26
28
- [ Inspect a Torrent] ( #inspect-a-torrent )
27
29
- [ Version Information] ( #version-information )
28
30
- [ Performance] ( #performance )
@@ -102,6 +104,8 @@ jobs:
102
104
- https://releases.ubuntu.com/22.04/ubuntu-22.04.3-desktop-amd64.iso
103
105
comment : " Ubuntu 22.04.3 LTS Desktop AMD64"
104
106
private : false
107
+ # piece_length is automatically optimized based on file size:
108
+ # piece_length: 22 # manual override if needed (2^n: 14-24)
105
109
106
110
- output : release.torrent
107
111
path : /path/to/release
@@ -115,25 +119,80 @@ jobs:
115
119
116
120
Batch mode will process all jobs in parallel (up to 4 concurrent jobs) and provide a summary of results.
117
121
122
+ #### Preset Mode
123
+
124
+ Create torrents using predefined settings from a preset configuration:
125
+
126
+ ` ` ` bash
127
+ # Use a preset from a config file
128
+ mkbrr create -P private path/to/file
129
+
130
+ # Use a preset from a custom config file
131
+ mkbrr create -P emp --preset-file custom-presets.yaml path/to/file
132
+
133
+ # Override preset settings with command line flags
134
+ mkbrr create -P private --source "CUSTOM" path/to/file
135
+ ```
136
+
137
+ > [ !TIP]
138
+ > The preset file is searched for in the following locations (in order):
139
+ > 1 . File specified by ` --preset-file ` flag
140
+ > 2 . ` presets.yaml ` in the current directory
141
+ > 3 . ` ~/.config/mkbrr/presets.yaml ` in the user's home directory
142
+ > 4 . ` ~/.mkbrr/presets.yaml ` in the user's home directory
143
+
144
+ Example presets.yaml:
145
+
146
+ ``` yaml
147
+ version : 1
148
+
149
+ # Defaults that always apply
150
+ default :
151
+ private : true
152
+ no_date : true
153
+
154
+ presets :
155
+ # Empornium preset
156
+ emp :
157
+ source : " EMP"
158
+ trackers :
159
+ - " https://tracker.opentrackr.org/announce"
160
+ # piece_length is automatically optimized based on file size
161
+ # piece_length: 20 # manual override if needed (2^n: 14-24)
162
+
163
+ # Public tracker preset
164
+ public :
165
+ private : false # overrides default preset
166
+ trackers :
167
+ - " udp://tracker.opentrackr.org:1337/announce"
168
+ - " udp://open.tracker.cl:1337/announce"
169
+ - " udp://9.rarbg.com:2810/announce"
170
+ # piece_length is automatically optimized based on file size
171
+ # piece_length: 22 # manual override if needed (2^n: 14-24)
172
+ ```
173
+
118
174
#### Create Flags
119
175
120
176
General flags:
121
177
122
178
- ` -b, --batch <file> ` : Use batch configuration file (YAML)
179
+ - ` -P, --preset <name> ` : Use preset from config
180
+ - ` --preset-file <file> ` : Preset config file (default: ~ /.config/mkbrr/presets.yaml)
123
181
- ` -v, --verbose ` : Be verbose
124
182
125
183
Single mode flags:
126
184
127
185
- ` -t, --tracker <url> ` : Tracker URL
128
186
- ` -w, --web-seed <url> ` : Add web seed URLs (can be specified multiple times)
129
- - `-p, --private` : Make torrent private
187
+ - ` -p, --private ` : Make torrent private (default: true)
130
188
- ` -c, --comment <text> ` : Add comment
131
189
- ` -l, --piece-length <n> ` : Set piece length to 2^n bytes (14-24, automatic if not specified)
132
190
- ` -o, --output <path> ` : Set output path (default: <name >.torrent)
133
191
- ` -s, --source <text> ` : Add source string
134
192
- ` -d, --no-date ` : Don't write creation date
135
193
136
194
Note: When using batch mode (-b), torrent settings are specified in the YAML configuration file instead of command line flags.
195
+ When using preset mode (-P), command line flags will override the preset settings.
137
196
138
197
#### Batch Configuration Format
139
198
@@ -149,13 +208,74 @@ jobs: # List of torrent creation jobs
149
208
- string
150
209
webseeds : # Optional: List of webseed URLs
151
210
- string
152
- private: bool # Optional: Make torrent private (default: false )
211
+ private : bool # Optional: Make torrent private (default: true )
153
212
piece_length : int # Optional: Piece length exponent (14-24)
154
213
comment : string # Optional: Torrent comment
155
214
source : string # Optional: Source tag
156
215
no_date : bool # Optional: Don't write creation date (default: false)
157
216
` ` `
158
217
218
+ #### Preset Configuration Format
219
+
220
+ The preset configuration file uses YAML format with the following structure:
221
+
222
+ ` ` ` yaml
223
+ # yaml-language-server: $schema=https://raw.githubusercontent.com/autobrr/mkbrr/main/schema/presets.json
224
+ version : 1 # Required, must be 1
225
+
226
+ # Optional: Default settings that apply to all presets unless overridden
227
+ default :
228
+ private : true
229
+ no_date : true
230
+ trackers :
231
+ - string
232
+ # ... other settings as needed
233
+
234
+ presets : # Map of preset names to their configurations
235
+ preset-name :
236
+ trackers : # Optional: List of tracker URLs (overrides default)
237
+ - string
238
+ webseeds : # Optional: List of webseed URLs (overrides default)
239
+ - string
240
+ private : bool # Optional: Make torrent private (overrides default)
241
+ piece_length : int # Optional: Piece length exponent (14-24)
242
+ comment : string # Optional: Torrent comment (overrides default)
243
+ source : string # Optional: Source tag (overrides default)
244
+ no_date : bool # Optional: Don't write creation date (overrides default)
245
+ ` ` `
246
+
247
+ Any settings specified in a preset will override the corresponding default settings. This allows you to set common values in the ` default` section and only specify differences in individual presets.
248
+
249
+ Example presets.yaml :
250
+
251
+ ` ` ` yaml
252
+ version: 1
253
+
254
+ # Defaults that always apply
255
+ default:
256
+ private: true
257
+ no_date: true
258
+
259
+ presets:
260
+ # Empornium preset
261
+ emp:
262
+ source: "EMP"
263
+ trackers:
264
+ - "https://tracker.opentrackr.org/announce"
265
+ # piece_length is automatically optimized based on file size
266
+ # piece_length: 20 # manual override if needed (2^n: 14-24)
267
+
268
+ # Public tracker preset
269
+ public:
270
+ private: false # overrides default preset
271
+ trackers:
272
+ - "udp://tracker.opentrackr.org:1337/announce"
273
+ - "udp://open.tracker.cl:1337/announce"
274
+ - "udp://9.rarbg.com:2810/announce"
275
+ # piece_length is automatically optimized based on file size
276
+ # piece_length: 22 # manual override if needed (2^n: 14-24)
277
+ ` ` `
278
+
159
279
# ## Inspect a Torrent
160
280
161
281
` ` ` bash
0 commit comments