question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Torrent file 'announce' field is always encoded as list, not as string

See original GitHub issue

If I need to create torrent object:

var trackers = new List<IList<string>>()
{
    new List<string>()
    {
        "TRACKER.URL"
    }
};
var torrent = new Torrent()
{
    CreationDate = DateTime.Now,
    IsPrivate = true,
    Trackers = trackers,
    PieceSize = 524288,
    File = new SingleFileInfo
    {
        FileSize = file.Length,
        FileName = file.Name
    }
};

and then after calculating hashes write it to a file:

torrent.EncodeTo(torrentFile);

then ‘announce’ field of a torrent will be a list and torrent clients won’t recognize tracker URL

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Krusencommented, Aug 25, 2017

Done.

You can also access each build on my myget feed as well.

0reactions
ilyabreevcommented, Aug 25, 2017

It would be great if you update the nuget package.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Bittorrent tracker get request urlencode
I figured it out. You need to write info_hash in ISO-8859-1 and always specify other fields (uploaded, downloaded, left).
Read more >
BitTorrentSpecification
Currently, this applies to the torrent file structure, peer wire protocol, ... This is encoded as a bencoded list of strings such as ......
Read more >
Do hex-changed torrent files (*.torrent) create issues?
All .torrent files are structured data, encoded in the bencode format. ... "http://torrent.ubuntu.com:6969/announce" "announce-list": [ 0: ...
Read more >
Torrent file - Wikipedia
All strings must be UTF-8 encoded, except for pieces, which contains binary data. A torrent is uniquely identified by an infohash, a SHA-1...
Read more >
BitTorrent Internals - Part 2 - Understanding the Torrent File
Torrent files are encoded with a custom encoding called Bencoding. It supports data types such as Strings, Integers, List, and Dictionaries ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found