rakshasa / rtorrent

rTorrent BitTorrent client
https://github.com/rakshasa/rtorrent/wiki
GNU General Public License v2.0
4.05k stars 412 forks source link

New dependency-free CLI util for editing bencoded files #1135

Open rakshasa opened 2 years ago

rakshasa commented 2 years ago

As I was working on rtorrent-docker and was in need of a proper way of changing the announce-list of torrents, looking around I found no really good options that didn't require me to include a kitchen sink.

So, below is a statically compiled go-language based CLI util for editing bencoded files.

https://github.com/rakshasa/rbedit

If you have any request, PRs and other suggestions, then now is probably the time to provide them while I'm still interested in working this project.

The util is still early in development.

Only requires docker and newish bash to compile for linux or darwin.

rakshasa commented 2 years ago

https://github.com/rakshasa/rbedit/releases/tag/v0.1

First release done.

rbedit>export COUNT=10000; time ./scripts/generate-torrents.sh /foo/bar.mp4.torrent ~/tmp/test-torrents/
Generating torrent test files

RBEDIT_PATH: ./build/rbedit
COUNT: 10000
SRC-TORRENT: /foo/bar.mp4.torrent
DEST-DIR: /Users/rakshasa/tmp/test-torrents/
PREFIX-DEPTH: 1

generating....................................................................................................

Finished generating 10000 torrents

real    2m28.786s
user    0m56.130s
sys 1m11.575s

Currently it only handles one file per execution, and requires two passes to change the info section and then calculate the info-hash.

The program is written such that it will support both custom batching of actions and parallel processing of torrents.