Tool for inspecting, creating and editing BitTorrent metafiles.

Overview

build Copr build status GitHub release (latest SemVer) C++ standard Codacy Badge License: MIT

A commandline tool for creating, inspecting and modifying bittorrent metafiles.

Features | Documentation | Packages | Building | License

Features

  • Creating bittorrent metafiles.
  • Inspecting bittorrent metafiles.
  • Verifying bittorrent metafiles against local data.
  • Editing existing bittorrent metafiles.
  • Support for the new v2 and hybrid protocols .
  • Support for tracker abbreviations.
  • Support for announce substitution parameters.
  • Fast multi-buffer hashing with Intel ISA-L.

Status

This project is under development. The commandline interface can change at any release prior to 1.0.0.

Performance

Following test were performed on a in in-memory filesystem with 1 MiB piece size and as target a folder with a few linux iso's totaling 19.0 GiB:

  • 9.0G | CentOS-Stream-8-x86_64-20201211-dvd1.iso
  • 2.0G | Fedora-Workstation-Live-x86_64-33-1.2.iso
  • 4.0G | openSUSE-Leap-15.2-DVD-x86_64.iso
  • 2.6G | ubuntu-20.04.1-desktop-amd64.iso
  • 998M | ubuntu-20.10-live-server-amd64.iso

The CPU is an Intel i7-7700HQ in a Dell XPS 15-9560 machine.

Benchmark

Documentation

Documentation is hosted on Github Pages.

Packages

Binary and source packages for Fedora 32, Fedora 33, Fedora 34, Fedora Rawhide and Centos stream are available in a COPR repo.

sudo dnf copr enable fbdtemme/torrenttools
sudo dnf install torrenttools

Binary and source packages for Ubuntu 20.04, Ubuntu 20.10, Ubuntu 21.04 are available in a launchpad repo.

sudo add-apt-repository ppa:fbdtemme/torrenttools
sudo apt-get update
sudo apt install torrenttools

A windows installer is available as an asset on the release page.

Building

This library depends on following projects:

Almost all dependencies can be fetched from github during configure time or can be installed manually. OpenSSL has to be installed on the system in advance.

Installing build dependencies

Ubuntu 20.04

sudo apt install build-essential git cmake g++-10 libtbb2 libtbb-dev libssl-dev 

Fedora 33

sudo dnf install cmake make g++ git openssl-devel libtbb-devel

Configuration

Option Type Description
TORRENTTOOLS_BUILD_TESTS Bool Build tests.
TORRENTTOOLS_BUILD_DOCS Bool Build documentation.
TORRENTTOOLS_INSTALL Bool Generate an install target.
DOTTORRENT_CRYPTO_MULTIBUFFER Bool Enable fast multi buffer hashing.

Building

This project requires C++20. Currently only GCC 10 is supported.

This project can be build as every other project which makes use of the CMake build system.

mkdir build
cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
cmake --build . --target torrenttools

Installation

Installing the project:

sudo cmake --install . --component torrentttools

License

Distributed under the MIT license. See LICENSE for more information.

Issues
  • Infinite loop parsing LS_COLORS with 256 colors

    Infinite loop parsing LS_COLORS with 256 colors

    Hi, I 'm using torrenttools-0.3.2 and it works fine on my centos 7 server. But when i upgrade it to torrenttools-0.5.1 it is not working any more. It stuck on this

    Scanning target directory: 0 files processed
    Sorting file list... Done.
    Adding files to metafile... Done.
    
    

    ldd /usr/bin/torrenttools

    linux-vdso.so.1 =>  (0x00007ffeb21f0000)
    libtbb.so.2 => /lib64/libtbb.so.2 (0x00007f596e813000)
    libcrypto.so.1.1 => /usr/local/openssl/lib/libcrypto.so.1.1 (0x00007f596e34d000)
    libstdc++.so.6 => /usr/local/gcc8/lib64/libstdc++.so.6 (0x00007f596dfc9000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f596dcc7000)
    libgcc_s.so.1 => /usr/local/gcc8/lib64/libgcc_s.so.1 (0x00007f596daaf000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f596d893000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f596d4c5000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f596d2c1000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f596d0b9000)
    libz.so.1 => /lib64/libz.so.1 (0x00007f596cea3000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f596ea55000)
    

    I attached strace.log please take a look. Please any advise, thank you. strace.log

    bug 
    opened by vuduyhoang 9
  • macOS build fails with  dyld: lazy symbol binding failed: Symbol not found

    macOS build fails with dyld: lazy symbol binding failed: Symbol not found

    macOS fails with the following error

    [email protected] ~/Downloads> /usr/local/bin/torrenttools
    dyld: lazy symbol binding failed: Symbol not found: ___stack_logging_early_finished
      Referenced from: /Library/torrenttools/bin/../lib/libSystem.B.dylib
      Expected in: /Library/torrenttools/bin/../lib/libSystem.B.dylib
    
    dyld: Symbol not found: ___stack_logging_early_finished
      Referenced from: /Library/torrenttools/bin/../lib/libSystem.B.dylib
      Expected in: /Library/torrenttools/bin/../lib/libSystem.B.dylib
    
    fish: Job 1, '/usr/local/bin/torrenttools' terminated by signal SIGABRT (Abort)
    

    This is on an M1 mac with Rosetta installed

    opened by newadventure079 9
  • Reached max memory?

    Reached max memory?

    I use the include filter to select 1700 files from a folder with many more. A 700 file filter is no problem. I get the error Error: re2 compiler out of memory. I have 5GB available so I think I have enough for the regexp, but perhaps there's a configured cap somewhere?

    What about giving an option of increasing the max memory usage for re2?

    cat /proc/meminfo
    MemTotal:        8040328 kB
    MemFree:          134448 kB
    MemAvailable:    5704240 kB
    
    opened by mbalax11 5
  • Error: std::bad_alloc

    Error: std::bad_alloc

    Hey! The project looked extremely promising so I had to give it a go. Unfortunately I have run into an error on my first torrent creator.

    torrenttools create "E:\Docker\Deluge\Data\linux.iso" --piece-size 4M --announce "XXX" -p on -o "E:\Docker\Deluge\Data\linux.torrent"

    16.00 EiB in 0 directories, 1 files

    Error: std::bad_alloc

    bug windows 
    opened by RemuxKid 5
  • Build fails because of fmt

    Build fails because of fmt

    Hi, I tried building following the instructions but it fails: torrenttools/src/tracker_database.cpp:7:10: fatal error: fmt/args.h: No such file or directory

    I am on Arch Linux, and fmt is installed: fmt 7.1.3-1

    build 
    opened by quietvoid 5
  • config.yml mentions Windows and Linux but not macOS

    config.yml mentions Windows and Linux but not macOS

    macOS is left out of the following

    # This is an example configuration file.
    # It should be copied to the suitable directory for your OS and modified there.
    # Linux : $HOME/.config/torrenttools/config.yml
    # Windows : %AppData%/torrenttools/config.yml
    
    documentation 
    opened by newadventure079 4
  • Single Announce URL not getting added

    Single Announce URL not getting added

    Using: torrenttools create -a "https://blah1.com" -p -l 21 -v '1' -o ~/somewhere/ ~/somewhere/something

    Results in no announce URL being added to the metafile

    Announces:


    Using: torrenttools create -a "https://blah1.com" "https://blah2.com" -p -l 21 -v '1' -o ~/somewhere/ ~/somewhere/something

    Results in both URLs being added to the metafile

    Announces: tier 1 - https://blah1.com tier 2 - https://blah2.com

    bug 
    opened by SpookyStuff 3
  • torrenttools edit (--announce) crashing on Windows

    torrenttools edit (--announce) crashing on Windows

    On the Windows version, I am using the command torrenttools edit -a "http://newtracker.url/announce.php" "A.Release.by.a-GROUP.torrent", which crashes, producing no output. Afterwards, using torrenttools info "A.Release.by.a-GROUP.torrent" shows that the announce URL has not been edited. I have also tried using the -o option, as well as using a named tracker (which doesn't update any of the relevant parts of the torrent).

    On Linux, this command works as intended.

    Event Viewer log:

    Faulting application name: torrenttools.exe, version: 0.0.0.0, time stamp: 0x610e32a1
    Faulting module name: unknown, version: 0.0.0.0, time stamp: 0x00000000
    Exception code: 0xc0000005
    Fault offset: 0x00007ff7ab3c0000
    Faulting process ID: 0x3680
    Faulting application start time: 0x01d797908bc46f20
    Faulting application path: C:\Program Files\torrenttools\torrenttools.exe
    Faulting module path: unknown
    Report ID: 541fa805-e161-4d41-8cea-92aeb9bce5e1
    Faulting package full name: 
    Faulting package-relative application ID: 
    
    opened by RibShark 2
  • Unknown parsing error on Win10

    Unknown parsing error on Win10

    Hi,

    Regardless of whether I use the default config.yml, or some configured one, I am getting this error.

    Error: [json.exception.parse_error.101] parse error at line 10, column 15: syntax error while parsing object - unexpected string literal; expected '}'

    If I edit line 10 of the config.yml to enclose the {pid}, like so pid: {example_pid}

    Then I receive this error. Error: yaml-cpp: error at line 10, column 10: bad conversion

    opened by Audionut 2
  • Publishing an official Docker image?

    Publishing an official Docker image?

    Thanks for what looks to be a fantastic tool.

    There are some cases where having a Docker image to easily run torrenttools might be more convenient / desirable than the existing COPR / launchpad repos.

    Would you be willing to consider publishing an official Docker image that is updated as part of releases?

    enhancement 
    opened by past-due 2
  • Announce URL Hijacking

    Announce URL Hijacking

    When you want to specify a custom announce URL but some part of the URL can be matched to an existing entry in trackers.json, then trackers.json will take precedence.

    Using: torrenttools create -a 'http://please.passthepopcorn.me:2710/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/announce' -p -l 21 -v '1' -o ~/somewhere/ ~/somewhere/something.iso

    Result: Announces: tier 1 - http://please.passthepopcorn.me:2710/01qwqwdlc922_sample_pid_d93fqd6fji9/announce

    The reason for this is that the "passthepopcorn" portion of the URL matches with the name of an entry in trackers.json. This shouldn't happen.

    Changing the URL to "please.passthepopcornxxx.me" ... Result: Announces: tier 1 - http://please.passthepopcornxxx.me:2710/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/announce

    Of course, I can remove the entry from trackers.json (since I won't be using it), but it would nice if they can co-exist

    I would think that, checking if the announce value starts with http, and if yes, then do not check in trackers.json

    bug 
    opened by SpookyStuff 2
  • Docker always restarting

    Docker always restarting

    I set up a docker container with docker-compose but the docker shuts down immediately since he is not receiving a command. I would like him to idle.

    when I solely run docker run -it --rm fbdtemme/torrenttools this appears and the container exits:

    A subcommand is required
    torrenttools v0.5.0
    Tools for inspecting, creating and modifying bittorrent metafiles.
    
    Usage: torrenttools [OPTIONS] SUBCOMMAND
    
    Options:
      -h,--help                        Print this help message and exit
      --checksum-algorithms            List the supported hash functions for per file checksums.
      -V,--version                     Show program version and exit.
      --config <path>                  Path to custom location for the config.yml file.
      --trackers-config <path>         Path to custom location for the trackers.json file.
    
    Subcommands:
      info                             General information about BitTorrent metafiles.
      create                           Create BitTorrent metafiles.
      verify                           Verify local data against BitTorrent metafiles.
      show                             Show specific fields of BitTorrent metafiles.
      edit                             Edit BitTorrent metafiles.
      magnet                           Generate a magnet URI for BitTorrent metafiles.
      pad                              Generate padding files for a BitTorrent metafile.
    

    But I have not even entered the container.

    Here my docker-compose.yml:

    version: "3.8"
    services:
      torrenttools:
        image: fbdtemme/torrenttools
        container_name: torrenttools
        stdin_open: true
        tty: true 
        volumes:
          - "REDACTED:REDACTED"
        restart: unless-stopped
    

    Same if I want to start the container with docker-compose file.

    Seesm to me like the container expects an immediate command, but nothing is written in the documentary. The docker setup is not even mentioned there, nor anything additional on DockerHub.

    Please make the docker container persistent, to I can launch him. And then exec into him with:

    docker exec -it torrenttools /bin/bash

    Or something like that, and then I can do my thing there.

    opened by MartinHotmann 1
  • DEB files download ?

    DEB files download ?

    Hello,

    @fbdtemme mentioned DEB packages in #11.

    Since the PPA cannot be used in Ubuntu 21.10, where can I find those DEB files ?

    I looked at launchpad.net/torrenttools but :

    torrenttools does not have any download files registered with Launchpad.

    Thanks

    opened by KaKi87 0
  • Option for custom source tag in trackers.json

    Option for custom source tag in trackers.json

    Some trackers (such as HDB) use the full name there, while others (such as PTP) use the abbreviation. It would be useful to be able to match it exactly without specifying -s each time, this way there's no need to redownload the torrent to start seeding.

    opened by nyuszika7h 0
  • Consider using a random value for cross-seeding rather than a hash of the announce URL

    Consider using a random value for cross-seeding rather than a hash of the announce URL

    Using the hash of the announce URL as entropy for cross-seeding can lead to a potential privacy violation. Consider an anonymous uploader on a private tracker. If they use torrenttools's cross-seed feature, it becomes possible to tell if two anonymous uploads came from the same person, unless the uploader regularly rotates their passkey (which is usually a painful process). Please consider just using a random value for this like pyrocore does.

    opened by nyuszika7h 0
Releases(v0.6.2)
Transmission is a fast, easy, and free BitTorrent client

About Transmission is a fast, easy, and free BitTorrent client. It comes in several flavors: A native Mac OS X GUI application GTK+ and Qt GUI applica

Bread 69 Jun 12, 2022
BitTorrent DHT library

The files dht.c and dht.h implement the variant of the Kademlia Distributed Hash Table (DHT) used in the Bittorrent network (``mainline'' variant). T

Juliusz Chroboczek 636 Jun 15, 2022
an efficient feature complete C++ bittorrent implementation

libtorrent is an open source C++ library implementing the BitTorrent protocol, along with most popular extensions, making it suitable for real world d

Arvid Norberg 4k Jun 24, 2022
libTorrent BitTorrent library

LibTorrent Copyright (C) 2005-2014, Jari Sundell LICENSE GNU GPL, see COPYING. "libtorrent/src/utils/sha_fast.{cc,h}" is originally from the Mozil

Jari Sundell 837 Jun 28, 2022
qBittorrent - A BitTorrent client in Qt

qBittorrent - A BitTorrent client in Qt Description: qBittorrent is a bittorrent client programmed in C++ / Qt that uses libtorrent (sometimes called

qBittorrent project 16.1k Jun 27, 2022
CatFrida is a macOS tool for inspecting a running iOS app.

CatFrida CatFrida is a macOS tool for inspecting a running iOS app. Building with frida-swift, CatFrida provide an awesome easy way to dive into an ap

neilwu 94 May 12, 2022
This is a collection of tools for creating and manipulating BitTorrent v2 torrent files

torrent tools This is a collection of tools for creating and manipulating BitTorrent v2 torrent files. torrent-new can create hybrid torrents, but the

Arvid Norberg 8 Jun 1, 2022
Tiny and cheap robot car for inspecting sewer pipes >= 125 mm. With pan servo for the ESP32-Cam module

ESP32-Cam Sewer inspection car Version 1.0.0 - work in progress Based on esp32-cam-webserver by Owen Carter. Additional Features Pan servo for the ESP

Armin 3 Feb 17, 2022
Transmission is a fast, easy, and free BitTorrent client.

Official Transmission BitTorrent client repository

Transmission 7k Jun 29, 2022
Transmission is a fast, easy, and free BitTorrent client

About Transmission is a fast, easy, and free BitTorrent client. It comes in several flavors: A native Mac OS X GUI application GTK+ and Qt GUI applica

Bread 69 Jun 12, 2022
OpenShot Video Library (libopenshot) is a free, open-source C++ library dedicated to delivering high quality video editing, animation, and playback solutions to the world

OpenShot Video Library (libopenshot) is a free, open-source C++ library dedicated to delivering high quality video editing, animation, and playback solutions to the world

OpenShot Studios, LLC 851 Jun 30, 2022
Immediate mode 3D gizmo for scene editing and other controls based on Dear Imgui

ImGuizmo Latest stable tagged version is 1.83. Current master version is 1.84 WIP. What started with the gizmo is now a collection of dear imgui widge

Cedric Guillemet 2k Jun 27, 2022
BitTorrent DHT library

The files dht.c and dht.h implement the variant of the Kademlia Distributed Hash Table (DHT) used in the Bittorrent network (``mainline'' variant). T

Juliusz Chroboczek 636 Jun 15, 2022
an efficient feature complete C++ bittorrent implementation

libtorrent is an open source C++ library implementing the BitTorrent protocol, along with most popular extensions, making it suitable for real world d

Arvid Norberg 4k Jun 24, 2022
libTorrent BitTorrent library

LibTorrent Copyright (C) 2005-2014, Jari Sundell LICENSE GNU GPL, see COPYING. "libtorrent/src/utils/sha_fast.{cc,h}" is originally from the Mozil

Jari Sundell 837 Jun 28, 2022
A bittorrent plugin for VLC.

vlc-bittorrent (Bittorrent plugin for VLC) What is this? With vlc-bittorrent, you can open a .torrent file or magnet link with VLC and stream any medi

Johan Gunnarsson 315 Jun 24, 2022
This project aims to simplify creation of basic Arduino programs by just editing a UI on Android.

ArdUI A video explanation If you are more a fun of video explanation go to this youtube video Project aim This project aims to simplify creation of ba

Targist 21 Feb 23, 2022
qBittorrent - A BitTorrent client in Qt

qBittorrent - A BitTorrent client in Qt Description: qBittorrent is a bittorrent client programmed in C++ / Qt that uses libtorrent (sometimes called

qBittorrent project 16.1k Jun 27, 2022
Scintilla is a free source code editing component

Scintilla is a free source code editing component

The Lua Language distribution [Archived] 33 Jan 30, 2022
A Visual Studio extension that provides enhanced support for editing High Level Shading Language (HLSL) files

HLSL Tools for Visual Studio This extension is for Visual Studio 2017 / 2019. Go here for the Visual Studio Code extension. HLSL Tools is a Visual Stu

Tim Jones 398 Jun 22, 2022
A lightweight, self-contained library for gizmo editing commonly found in many game engines

This project is a lightweight, self-contained library for gizmo editing commonly found in many game engines. It includes mechanisms for manipulating 3d position, rotation, and scale. Implemented in C++11, the library does not perform rendering directly and instead provides a per-frame buffer of world-space triangles.

Dimitri Diakopoulos 372 Jun 17, 2022
YYToolkit is a tool for creating mods and altering GameMaker games.

YYToolkit is a tool for creating mods and altering GameMaker games.

Archie 29 Jun 10, 2022
The open-source tool for creating of 3D models

The open-source tool for creating of 3D models

3D geoinformation research group at TU Delft 396 Jun 25, 2022
Creating sepia, reflection, grayscale, and blur filters from scratch and returns a modified image

image-filter Created sepia, reflection, grayscale, and blur filters from scratch and returning a modified image Directories: images: contains sample i

Martin Guevara 1 Oct 14, 2021
A terse, flexible language and runtime for creating and executing visual novels.

Fabulist A terse, flexible language and runtime for creating and executing visual novels. Contributing We're open to contributions from anyone and eve

NovelRT 4 Feb 27, 2022
C++ library for creating an embedded Rest HTTP server (and more)

The libhttpserver reference manual Tl;dr libhttpserver is a C++ library for building high performance RESTful web servers. libhttpserver is built upon

Sebastiano Merlino 664 Jul 2, 2022