Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rakshasa/rbedit
Dependency-Free Bencode Editor
https://github.com/rakshasa/rbedit
bencode bencode-parser bencoder bittorrent torrent torrent-files
Last synced: 3 months ago
JSON representation
Dependency-Free Bencode Editor
- Host: GitHub
- URL: https://github.com/rakshasa/rbedit
- Owner: rakshasa
- License: gpl-2.0
- Created: 2021-11-20T01:39:10.000Z (about 3 years ago)
- Default Branch: master
- Last Pushed: 2022-10-20T21:21:28.000Z (about 2 years ago)
- Last Synced: 2024-10-16T12:39:52.514Z (3 months ago)
- Topics: bencode, bencode-parser, bencoder, bittorrent, torrent, torrent-files
- Language: Go
- Homepage:
- Size: 424 KB
- Stars: 35
- Watchers: 8
- Forks: 3
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
rbEdit
======A statically compiled and dependency-free Bencode editor in Go, useful for command line use and scripts.
Quick Start
-----------```bash
# Compile:
./scripts/build.sh# Compile for darwin arch:
TARGET_OS=darwin ./scripts/build.sh# Compile for linux arch:
TARGET_OS=linux ./scripts/build.sh
```The only build requirement is Docker and the binary has no runtime dependencies.
```bash
./build/rbedit announce get --input ./test.torrent
```Print announce url.
```bash
./build/rbedit announce put --input ./test.torrent --inplace http://example.com/announce
```Change announce url.
```bash
./build/rbedit get --input ./test.torrent info length
```Get value of the `length` entry in the `info` map.
```bash
./build/rbedit put --input ./test.torrent --inplace --bencode d3:bari2e3:bazi3e3:fooi1ee foo-info
```Write a custom bencoded object to `foo-info` entry in the torrent root.
Batch Operations
----------------Generate 10,000 torrents with unique info hashes:
```bash
$ RBEDIT_PATH=./build/rbedit-darwin-amd64 COUNT=10000 ./scripts/generate-torrents.sh /tmp/slackware-14.2-install-d1.torrent /tmp/slackware-torrents
Generating torrent test filesRBEDIT_PATH: ./build/rbedit
COUNT: 10000
SRC-TORRENT: /tmp/slackware-14.2-install-d1.torrent
DEST-DIR: /tmp/slackware-torrents
PREFIX-DEPTH: 1generating..................................
Finished generating 10000 torrents
$ find /tmp/slackware-torrents -type f | wc -l
10000# du -h -d0 /tmp/slackware-torrents
273M /Users/rakshasa/tmp/slackware-torrents/
```Check the announce url of all 10,000 torrents:
```bash
$ time ./build/rbedit-darwin-amd64 announce get --input <(find /tmp/torrents -type f) --batch | tail -n3
http://trackers.transamrit.net:8082/announce
http://trackers.transamrit.net:8082/announce
http://trackers.transamrit.net:8082/announcereal 0m0.523s
user 0m0.375s
sys 0m0.374s
```Replace the announce urls and overwrite the source files for all 10,000 torrents:
```bash
$ time ./build/rbedit-darwin-amd64 announce put --input <(find /tmp/torrents -type f) --batch --inplace http://new.example.com/announcereal 0m2.672s
user 0m0.841s
sys 0m1.858s
```Verify the announce urls were changed:
```bash
$ ./build/rbedit-darwin-amd64 announce get --input <(find /tmp/torrents -type f) --batch | tail -n3
http://new.example.com/announce
http://new.example.com/announce
http://new.example.com/announce
```Donate to rTorrent development
------------------------------* [Paypal](https://paypal.me/jarisundelljp)
* [Patreon](https://www.patreon.com/rtorrent)
* [SubscribeStar](https://www.subscribestar.com/rtorrent)
* Bitcoin: 1MpmXm5AHtdBoDaLZstJw8nupJJaeKu8V8
* Etherium: 0x9AB1e3C3d8a875e870f161b3e9287Db0E6DAfF78
* Litecoin: LdyaVR67LBnTf6mAT4QJnjSG2Zk67qxmfQ
* Cardano: addr1qytaslmqmk6dspltw06sp0zf83dh09u79j49ceh5y26zdcccgq4ph7nmx6kgmzeldauj43254ey97f3x4xw49d86aguqwfhlte