arvidn / libtorrent

an efficient feature complete C++ bittorrent implementation

Home Page:http://libtorrent.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Custom fields

olegsavelos opened this issue · comments

libtorrent version (or branch): RC_2_0

platform/architecture: Windows 7 sp1 x64/x32

compiler and compiler version: msvc2017

I am researching a potential of adding my own custom data to the generated file, for example configuration related to the torrent deployment such as an default directory to deploy to and so. As I understand it should be possible to have custom key/value either in the info or the torrent root but I cant find a way to do this with libtorrent, is such functionality supported ?
Thanks!

commented

@olegsavelos It's very simple. It is enough to open the source code and see.

@olegsavelos when you create the torrent, the generate() call returns the full (mutable) bencode tree. you can add new fields to the root or to the "info" dictionary, by using operator[].

commented

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.