#1 2015-06-22 14:09

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Torrent metatags

Recently came across a site where the torrents for lectures are all provided with long numeric codes for the file names. On loading the torrents in my client however the titles are properly specified inside, so I was wondering if it would be possible to have a Torrent_Title metatag.

Additional torrent-related metatags might also perhaps be useful, for example Torrent_Hash.

Offline

#2 2015-06-22 20:41

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Re: Torrent metatags

Sounds good. and it should be relatively easy to implement a parser for torrent files.

A quick search shows plenty of format description and specification results:
* https://en.wikipedia.org/wiki/Torrent_file
* http://fileformats.wikia.com/wiki/Torrent_file
* http://www.bittorrent.org/beps/bep_0003.html
* https://wiki.theory.org/BitTorrentSpecification

However, Torrent_Hash may not be possible. There is no standalone hash available in the specification, there are only hashes for individual pieces.

Offline

#3 2015-06-28 16:12

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: Torrent metatags

den4b wrote:

Sounds good. and it should be relatively easy to implement a parser for torrent files.

Happy to hear that's the case. smile

den4b wrote:

However, Torrent_Hash may not be possible. There is no standalone hash available in the specification, there are only hashes for individual pieces.

I was talking about the Info Hash, which according to the specs is defined as:

The 20 byte sha1 hash of the bencoded form of the info value from the metainfo file. Note that this is a substring of the metainfo file. The info-hash must be the hash of the encoded form as found in the .torrent file, regardless of it being invalid. This value will almost certainly have to be escaped.

Torrent_Info_Hash.png

Some useful links:

Info hashes uniquely identify torrents and thus can be used to search for them on indexing sites, which is why I thought it might be a useful thing to provide a metatag for.

Last edited by Andrew (2015-06-28 17:57)

Offline

#4 2015-07-12 22:00

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Re: Torrent metatags

Implemented in ReNamer 6.2.0.6 Beta:

* Added Torrent file meta tags: Torrent_Name, Torrent_Hash, Torrent_Announce, Torrent_Comment, Torrent_Publisher, Torrent_CreationDateUTC, Torrent_CreationDateLocal, Torrent_CountFiles, Torrent_TotalSizeBytes, Torrent_TotalSizeKB, Torrent_TotalSizeMB, Torrent_TotalSizeGB;

Offline

#5 2015-08-02 04:13

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: Torrent metatags

Works very well indeed, just as expected. smile Did you use a third party library for this?

Offline

#6 2015-08-02 11:09

den4b
Administrator
From: den4b.com
Registered: 2006-04-06
Posts: 3,370

Re: Torrent metatags

Couldn't find any open source libraries for reading Torrent files in Pascal/Delphi, so it is mostly hand written code.

Offline

Board footer

Powered by FluxBB