libtorrent icon indicating copy to clipboard operation
libtorrent copied to clipboard

Custom fields

Open olegsavelos opened this issue 3 years ago • 3 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!

olegsavelos avatar Mar 17 '22 15:03 olegsavelos

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

master255 avatar Mar 18 '22 21:03 master255

@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[].

arvidn avatar May 09 '22 10:05 arvidn

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.

stale[bot] avatar Aug 12 '22 00:08 stale[bot]