Computer Science Canada

BitTorrent Metadata from command line?

Author:  DtY [ Mon Jul 20, 2009 11:39 am ]
Post subject:  BitTorrent Metadata from command line?

Does a program exist to do this? I need to extract some metadata from torrent files (specifically file size and torrent name) using a linux command line.
Google brought up nothing useful

Author:  Aziz [ Mon Jul 20, 2009 1:30 pm ]
Post subject:  RE:BitTorrent Metadata from command line?

It's just a text file. Read it like any text file. Read it in and use some regex to parse it. Very Happy

Author:  rdrake [ Mon Jul 20, 2009 2:05 pm ]
Post subject:  RE:BitTorrent Metadata from command line?

Check out transmissioncli that comes with Transmission.

Man page here: Transmission CLI man page.

code:
transmissioncli -i <file>.torrent

Author:  DtY [ Mon Jul 20, 2009 2:47 pm ]
Post subject:  RE:BitTorrent Metadata from command line?

Aziz: It's binary based, I'm pretty sure. I looked at the specification a while ago, and it's something I could easily write a program to unpack, but why bother when someone's probably already done it?

rdrake: Like this Smile Thanks, that's just what I need

Author:  Aziz [ Mon Jul 20, 2009 3:05 pm ]
Post subject:  RE:BitTorrent Metadata from command line?

Of course! I somehow remember opening a .torrent file in notepad, and viewing it, but of course, I have a bad memory. Sorry for leading you down the wrong path! Razz

And thanks rdrake, I LOVE LEARNING.

Author:  DtY [ Mon Jul 20, 2009 6:30 pm ]
Post subject:  Re: RE:BitTorrent Metadata from command line?

Aziz @ Mon Jul 20, 2009 3:05 pm wrote:
Of course! I somehow remember opening a .torrent file in notepad, and viewing it, but of course, I have a bad memory. Sorry for leading you down the wrong path! Razz

And thanks rdrake, I LOVE LEARNING.

If you're interested in learning more about it, BT has a complete specification of the format (somewhere). It's pretty interesting, it's all based around python. (Iirc, the basic types you have in the file are strings, integers, lists, and dictionaries)


: