> ## Documentation Index
> Fetch the complete documentation index at: https://mkbrr.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Modifying torrents

> Learn how to update metadata in existing .torrent files using the mkbrr modify command

The `mkbrr modify` command allows you to update metadata in existing `.torrent` files without needing access to the original content files. This is useful for mass-updating trackers, source tags, comments, or other metadata.

<CodeGroup>
  <Code title="Command">
    ```bash theme={null}
    mkbrr modify [torrent files...] [flags]
    ```
  </Code>
</CodeGroup>

<CardGroup>
  <Card title="Arguments" icon="list-check" href="#arguments">
    Required command arguments
  </Card>

  <Card title="Flags" icon="flag" href="#flags">
    Available modification options
  </Card>

  <Card title="Examples" icon="code" href="#examples">
    Common usage examples
  </Card>
</CardGroup>

<Info>
  By default, the original torrent files are preserved. New, modified files are created with a prefix based on the tracker domain (e.g., `tracker-domain_original-name.torrent`). You can customize the output filename or directory.
</Info>

<Info>
  The `modify` command preserves existing metadata, including custom info-dict keys. Only the fields you explicitly change (name, tracker, source, comment, private flag, entropy) are updated.
</Info>

## Arguments

<ParamField path="torrent files..." type="string[]" required>
  One or more paths to the `.torrent` files you want to modify. Glob patterns (like `*.torrent`) can be used if your shell supports them.
</ParamField>

## Flags

### Input & Output

<ParamField query="--tracker, -t" type="string[]">
  Tracker URLs (can be specified multiple times).
</ParamField>

<ParamField query="--name" type="string">
  Set the torrent's internal name.
</ParamField>

<ParamField query="--output-dir" type="string">
  Output directory for modified files.
</ParamField>

<ParamField query="--output, -o" type="string">
  Custom output filename (without extension).
</ParamField>

<Warning>
  When modifying multiple torrents, using `--output` with a fixed filename will cause subsequent files to overwrite the previous ones. Use `--output-dir` instead for batch modifications to preserve all modified files with unique names.
</Warning>

### Advanced Input (Presets)

<ParamField query="--preset, -P" type="string">
  Use preset from config.

  <Info>
    For reusing common settings across torrents. See the [Presets](/features/presets) documentation for details.
  </Info>
</ParamField>

<ParamField query="--preset-file" type="string">
  Preset config file (default `~/.config/mkbrr/presets.yaml`).

  <Info>
    Set custom path to presets.yaml. See the [Presets](/features/presets) documentation for details.
  </Info>
</ParamField>

### Torrent Internals

<ParamField query="--private, -p" type="boolean" default={true}>
  Make torrent private.

  <Note>
    Private flag is enabled by default for tracker compliance. Only disable if you're creating a public torrent.
  </Note>
</ParamField>

<ParamField query="--no-private" type="boolean" default={false}>
  Remove the private flag entirely.
</ParamField>

<ParamField query="--entropy, -e" type="boolean" default={false}>
  Randomize the torrent's info hash by adding or updating a unique, random `entropy` key in the info dictionary before hashing.

  <Info>
    Cross-seeding is the practice of seeding the same content on multiple trackers. Using the entropy flag helps avoid conflicts between trackers.
  </Info>
</ParamField>

### Seeding & Metadata

<ParamField query="--web-seed, -w" type="array">
  Specify web seed URLs. Can be used multiple times.

  <Info>
    Web seeds provide an HTTP fallback source for the torrent content, improving availability.
  </Info>
</ParamField>

<ParamField query="--source, -s" type="string">
  Specify the source string.

  <Info>
    Some trackers require or recommend specific source tags. Check your tracker's rules.
  </Info>
</ParamField>

<ParamField query="--comment, -c" type="string">
  Specify a comment.
</ParamField>

<ParamField query="--no-date, -d" type="boolean" default={false}>
  Omit the creation date from the torrent metadata.
</ParamField>

<Info>If omitted, the creation date is updated to the current time during modification.</Info>

<ParamField query="--no-creator" type="boolean" default={false}>
  Omit the creator string from the torrent metadata.
</ParamField>

### Execution & Output Control

<ParamField query="--verbose, -v" type="boolean" default={false}>
  Be verbose.
</ParamField>

<ParamField query="--quiet, -q" type="boolean" default={false}>
  Enable quiet mode, printing only the final torrent file path upon success. Useful for scripts.
</ParamField>

<ParamField query="--skip-prefix" type="boolean" default={false}>
  Don't add tracker domain prefix to output filename.
</ParamField>

<ParamField query="--dry-run, -n" type="boolean" default={false}>
  Show what would be modified without making changes.
</ParamField>

## Examples

<Tabs>
  <Tab title="Basic Usage">
    Update the tracker for a single torrent:

    ```bash theme={null}
    mkbrr modify original.torrent --tracker https://new-tracker.com/announce
    ```

    <Info>Outputs: `new-tracker_original.torrent`</Info>

    Make multiple torrents public:

    ```bash theme={null}
    mkbrr modify *.torrent --private=false
    ```

    <Info>Outputs: `modified_file1.torrent`, `modified_file2.torrent`, etc.</Info>
  </Tab>

  <Tab title="Advanced Usage">
    Add a source tag and save to a specific directory:

    ```bash theme={null}
    mkbrr modify /downloads/*.torrent --source "MySource" --output-dir /modified-torrents/
    ```

    Apply a preset and then add entropy:

    ```bash theme={null}
    mkbrr modify old-preset.torrent -P newpreset -e
    ```

    Preview changes without saving:

    ```bash theme={null}
    mkbrr modify my.torrent --tracker https://new.co/a --comment "Updated" --dry-run
    ```
  </Tab>
</Tabs>

```bash theme={null}
mkbrr modify [torrent files...] [flags]
```

By default, the original torrent files are preserved. New, modified files are created with a prefix based on the tracker domain (e.g., `tracker-domain_original-name.torrent`). You can customize the output filename or directory.

<Note>
  The `modify` command preserves existing metadata, including custom info-dict keys. Only the fields you explicitly change are updated.
</Note>
