Support Requests: Browse | Submit New | Admin

[#4966] How can I use your package to bencode / bdecode from another script?

Date:
2006-07-06 18:57
Priority:
3
Submitted By:
Paul Heldens (pheldens)
Assigned To:
Nobody (None)
Category:
None
State:
Open
Summary:
How can I use your package to bencode / bdecode from another script?

Detailed description
As an tracker co-admin I sometimes need to debug tracker issues and it's handy to have a small converter:

I got as far as this:

> cat url
#!/usr/local/bin/ruby
require "cgi"
require "rubytorrent"

puts ARGV[0].to_s
puts ARGV[0].to_s.to_bencoding
puts CGI::escape(ARGV[0].to_s.to_bencoding)


but the generated doesnt seem right compared to bencoded + urlencoded strings by other clients:

> ruby url 2a4074ef5225865057cc49cd698b8477199779b6
2a4074ef5225865057cc49cd698b8477199779b6
40:2a4074ef5225865057cc49cd698b8477199779b6
40%3A2a4074ef5225865057cc49cd698b8477199779b6

Add A Comment: Notepad

Please login


Followup

No Followups Have Been Posted

Attached Files:

Name Description Download
No Files Currently Attached

Changes:

No Changes Have Been Made to This Item