Check a torrent's exact size before mkbrr hashes it

3 hours ago

mkbrr 1.27 can tell you a torrent's exact size before it hashes anything. This release also makes presets behave the same in the command line, the desktop app and batch files. And a batch job without a private key now comes out private, with a new info hash, so batch users should stay for the end.

Ask about this presentation

Chapters

  1. 0:00mkbrr 1.27.0
  2. 0:20create --plan
  3. 0:42Presets everywhere
  4. 1:00modify
  5. 1:22Failures you can see
  6. 1:47Breaking: batch is private by default
  7. 2:05Breaking: --batch rejects create flags
  8. 2:24Breaking: piece length and Go API
  9. 2:47Upgrade
Show transcript
  1. mkbrr 1.27 can tell you a torrent's exact size before it hashes anything. This release also makes presets behave the same in the command line, the desktop app and batch files. And a batch job without a private key now comes out private, with a new info hash, so batch users should stay for the end.

    Slide text
    $ mkbrr version v1.27.0
    mkbrr

    Check a torrent's exact size before mkbrr hashes it

    Presets now resolve the same way in the CLI, the GUI and batch files, and batch jobs are private by default.

    autobrr/mkbrr v1.26.0 → v1.27.0
  2. The new plan flag on create walks and filters your files exactly like a real create and picks the final piece length. Then it prints one JSON object and stops. The predicted torrent size is exact, so you can check it against a tracker's size limit first. It doesn't hash your content or write a torrent, and it doesn't work together with batch mode.

    Slide text
    $ mkbrr create … --plan

    Plan mode prints the piece length and the .torrent size, then stops

    content_size selected content, in bytes
    piece_length_exponent chosen piece length, as 2^n
    piece_length_bytes chosen piece length, in bytes
    predicted_torrent_size exact .torrent size, in bytes
    tracker_size_limit the tracker's cap in bytes, 0 when none applies
    notices piece-size notices from the create pipeline
    Nothing is hashed and no .torrent is written. Not available with --batch.
  3. The command line, the desktop app and batch mode now resolve their settings in one order. In the desktop app, the private setting works when a preset is selected, and preset values such as target piece count now apply. Batch jobs also gain two keys, max piece length and no creator.

    Slide text
    $ mkbrr create … -P <preset>

    Presets now resolve the same way in the CLI, the GUI and batch

    GUI
    The Private setting works with a preset, and values like target_piece_count apply
    Batch
    Jobs accept max_piece_length and no_creator
    mkbrr GUI Create Torrent page with a Preset menu and a Private switch
  4. Modify now touches only the fields you name. A new no entropy flag removes the entropy key, which changes the info hash. Any setting you leave out keeps the torrent's existing value, and when nothing changes, modify doesn't write a file at all. It also reads skip prefix from a preset, and giving it a single tracker now removes the old announce list.

    Slide text
    $ mkbrr modify …

    modify now changes only what you ask

    --no-entropy
    Removes the entropy key and so changes the info hash
    settings you skip
    Keep the torrent's value and no file is written when nothing changes
    -P and -t
    Reads skip_prefix from the preset and one tracker removes the old announce-list
  5. Batch failures are now visible to scripts. When any job fails, create exits with a non-zero status and says how many of the jobs failed, even in quiet mode, where each failure also goes to standard error. Two other problems now stop the run. With fail on season warning set, an incomplete season pack stops create before it hashes anything, and create stops with an error when it can't generate entropy.

    Slide text
    $ mkbrr create -b batch.yaml --quiet

    A failed batch job now fails the whole command

    $ mkbrr create -b batch.yaml --quiet
    Wrote: <output>
    Failed: <output>: <error>
    N of M batch jobs failed
    exit status: non-zero, also with --quiet
    --fail-on-season-warning stops before hashing
    create stops with an error when it cannot make entropy
  6. Batch jobs now match the command line. Before, a job without a private key made a public torrent. Now it makes a private torrent and picks up the tracker's default source, so its info hash changes. To keep your old torrents, add private false to the job, or set source to an empty string.

    Slide text
    $ mkbrr create -b batch.yaml breaking

    Batch jobs are now private by default, like the CLI

    jobs:
      - output: /torrents/movie1.torrent
        path: /media/movies/movie1.mkv
        trackers:
          - https://tracker-one.com/announce/abc
        private: false
    v1.26.0, no private keya public torrent
    v1.27.0, no private keya private torrent with the tracker's default source, so the info hash changes
    To keep the old torrents, add private: false or source: ""
  7. Batch mode used to quietly ignore any other create flags you passed. Now it refuses to run and names each flag it won't take. Only verbose, quiet and info only still work alongside batch. Anything that shapes the torrent, like a tracker or an exclude pattern, belongs in the batch file itself.

    Slide text
    $ mkbrr create -b batch.yaml breaking

    create --batch now rejects other create flags

    v1.26.0: the flag was ignored
    $ mkbrr create -b batch.yaml --exclude "*.nfo"
    v1.27.0: an error that names the flag
    $ mkbrr create -b batch.yaml --exclude "*.nfo"
    --batch takes its settings from the batch file; remove --exclude
    Only -v, -q and -i work with --batch. Move --tracker or --exclude into the batch file.
  8. A max piece length of 14 or 15 used to produce 64 KiB pieces anyway. Now it's an error, except for a tracker with its own piece size table and no target piece count. Set it to 16 or higher and your hash stays the same. If you use mkbrr as a Go library, the batch job and modify options types now embed shared settings structs.

    Slide text
    $ mkbrr create … -m 15 breaking

    A max piece length of 14 or 15 now fails where it can't apply

    --max-piece-length 14 or 15
    Used to make 64 KiB pieces anyway. It still works for a tracker with its own piece size table, without --target-piece-count.
    Set 16 or higher. The hash stays the same.
    Go API
    BatchJob now embeds torrent.CreateSettings with pointer fields. ModifyOptions now embeds torrent.ModifySettings.
    Only matters if you import mkbrr as a Go library.
  9. The built in update command fetches the new release. If you run batch files, check them first. Add private false to any job whose hash has to stay the same, move create flags into the file, and raise a max piece length of 14 or 15 to at least 16. Then try the plan flag, and check a torrent's exact size before mkbrr hashes it.

    Slide text
    $ mkbrr update

    Upgrade to 1.27.0, after a look at your batch files

    $ mkbrr update
    mkbrr.com
    github.com/autobrr/mkbrr
    Add private: false to batch jobs that must keep their hash
    Move create flags into the batch file
    Raise --max-piece-length 14 or 15 to 16 or higher
    v1.27.0mkbrr

What happened in AI today, in your inbox

One short email each evening. Read it and you’re caught up.

Built in New York with ❤️