Provide a way to create metainfo file ".torrent" file
Opened this issue · 2 comments
Using this library how can I create the torrent (and seed, as the creator will be first seeder) from a file in my system, and download that file in another system. Upon googling I found out that I need to make a SHA1 hash out of info dictionary of the torrent, and when I looked into the code of dtorrent_task, I found out it expects parameters like 'name', 'path', 'file' to properly make the dictionary (under the function parseTorrentFileContent).
Am I on the right track? Is it possible to create a torrent using this library? If not, then how could I do it in dart?
Technically you can use parseTorrentFileContent
to create a torrent model from a map that contains all the required info and then use _torrentModel2Bytebuffer
(which unfortunately is private currently)to convert the model to a bytebuffer to be saved
note this is not tested, the parseTorrentFileContent
is not intended for this use, we need a type safe wrapper around it for creating torrents, which is easy to implement if someone has the time
Ok got it, but a major issue i'm facing is that I'm unable to SHA1 hash the file I want to share through torrent