Forums | Admin

Discussion Forums: open-discussion

Start New Thread Start New Thread

 

By: Tom Copeland
RE: Working on the metainfofile creator now.. [ reply ]  
2004-09-03 14:21
Hi Ikkei -

It's a very good idea - to make MetaInfo a Hash.

When you get a moment, please check in your code; I've added you to the project:

http://rubyforge.org/project/memberlist.php?group_id=326

I think this project will be a good one for Ruby, and we will learn a lot as well. Good stuff!

Yours,

Tom

By: Ikkei
RE: Working on the metainfofile creator now.. [ reply ]  
2004-09-03 03:05
update v0.0.2 about make metainfo file
(http://www1.kcn.ne.jp/~tea/tmp/rubit/)

- MetaInfo extends Hash
- Added MetaInfo#load, MetaInfo#save methods
- Added MetaInfo#make is class method, like Factory
- Support multi files (maybe work, not test enough)

MetaInfo.make(path, announce_url) {|m|
m['announce-list'] = [ ... ]
m['comment'] = '...'
}.save(filename)

since MetaInfo 'is_a' Hash.

announce = {'announce' => '', 'announce-list' => []}
m1.merge!(announce)
m2.merge!(announce)

This is an advanage, developper knew Hash api already.
No need to remember other api for metainfo.
and we does not need to define those accessor methods, too.

(known bug)
But if changed under 'info' field,
maybe need to update 'pieces' by your hand.

By: Tom Copeland
RE: Working on the metainfofile creator now.. [ reply ]  
2004-09-01 14:48
> announce-list must be Array.

Yup, you're right, announce-list is a bit more complicated than just one value. Hm. But you can add in a key like that by doing something like:

m.add("announce-list", ["http://some.backup.tracker";])

> thise optional fields

Yup, there are a bunch of them. They can be fetched using the key() method - which is not a good name for it :-).

Yours,

Tom

By: Ikkei
RE: Working on the metainfofile creator now.. [ reply ]  
2004-09-01 11:39
Hi, I checked out cvs now.

> m.add("announce-list", "http://some.backup.tracker";;)

announce-list must be Array.

and its called .write method in makemetafile already. override?

---- more about metainfo fields
I did not research which application has thise,
and could not find document about this. but I had seen metainfo files which has thise optional fields.

encoding, comment.utf-8, publisher.utf-8, publisher-url.utf-8 and
under info field, name.utf-8

those .utf-8 surffixed fields are useful when make gui application.



By: Tom Copeland
RE: Working on the metainfofile creator now.. [ reply ]  
2004-08-30 14:55
OK, now you can add optional keys, like this:

m = MetaInfo.new
m.makemetafile("file", "tracker")
m.add("announce-list", "http://some.backup.tracker";)
m.write

Thanks,

Tom

By: Tom Copeland
RE: Working on the metainfofile creator now.. [ reply ]  
2004-08-30 14:37
Hi Ikkei -

> more details:

Thanks for the link! That document includes some stuff I hadn't seen before; I've been working off the BitTorrent specs here:

http://bitconjurer.org/BitTorrent/protocol.html

> some optional fields in metainfo.

Cool. v0.2 can read optional fields like this:

m = MetaInfo.new
m.decode("somefile.torrent")
puts m.key("some optional key")

but v0.2 doesn't include a way to add optional fields to a metainfo file. Working on that now...

Thanks,

tom

By: Ikkei
RE: Working on the metainfofile creator now.. [ reply ]  
2004-08-28 12:53
Hai, Tom
Yes, I wish porting bittorrent tools and modules to ruby, too.
For me, that was for personal studing,
learning peer-to-peer protocol and learning ruby programing..
Can I know your email address to send the program ?

About tracker ... No,
I wrote was only download part and bencoding.
I'm still on going to learn how to use WEBrick module.


about metainfo file, I suggest TODO
There are some optional fields in metainfo.
"announce-list", "md5sum", "created by" fileds
and utf-8 comment field also (undocumented)

Here has more details:
http://wiki.theory.org/index.php/BitTorrentSpecification

By: Tom Copeland
RE: Working on the metainfofile creator now.. [ reply ]  
2004-08-27 18:24
Hello Ikkei -

Thanks! Yup, hopefully we can put together a nice set of tools for working with BitTorrent in Ruby.

I am almost done with the metainfo file creator... have you done any work on a BT tracker in Ruby?

Yours,

Tom

By: Ikkei
RE: Working on the metainfofile creator now... [ reply ]  
2004-08-27 07:37
Hello, I had interested about bittorrent.
my interest was about peer-to-peer protocol part, but,
I read the spec about metainfo file, bee-encoding,
and tracker also some un-official documents.
Can I help your project ? if you will make other bittorrent tools.

I have written buggy Net::BitTorrent module.
(status buggy, not check exceptions at all, but
at least it can complete download)

By: Tom Copeland
Working on the metainfofile creator now... [ reply ]  
2004-08-26 18:56
...seems like a bare-bones version shouldn't be too bad. Optional keys and such can come later...

Tom