Discussion:
[libtorrent] Any specific reason as to my INFO-HASH to add_torrent_params does starting a torrent download
Viren Negi
2017-04-15 11:20:21 UTC
Permalink
Hi,
I have improvised the simple_client.cc to extend the torrent to accept
magnetic link and info_hash

While I see the magnetic link stuff work but when I try with info hash I
don't any satisfactory result.

Here a git diff of actual modification I made to simple_client.cc

https://gist.github.com/anonymous/977a393a03ad01523f210b1046afc054

<https://gist.github.com/anonymous/977a393a03ad01523f210b1046afc054>

Not sure what I'm doing through. The example on how to use a info_hash in
add_torrent_params is taken from python example.

https://github.com/arvidn/libtorrent/blob/master/bindings/python/src/session.cpp#L247-L248

I think I making a some stupid mistake but I'm not able to figure that out.

Thanks.
Arvid Norberg
2017-04-16 03:31:00 UTC
Permalink
Post by Viren Negi
Hi,
I have improvised the simple_client.cc to extend the torrent to accept
magnetic link and info_hash
While I see the magnetic link stuff work but when I try with info hash I
don't any satisfactory result.
Here a git diff of actual modification I made to simple_client.cc
https://gist.github.com/anonymous/977a393a03ad01523f210b1046afc054
<https://gist.github.com/anonymous/977a393a03ad01523f210b1046afc054>
Not sure what I'm doing through. The example on how to use a info_hash in
add_torrent_params is taken from python example.
https://github.com/arvidn/libtorrent/blob/master/
bindings/python/src/session.cpp#L247-L248
I think I making a some stupid mistake but I'm not able to figure that out.
I suspect you pass in the info-hash hex encoded on the command line, you
Post by Viren Negi
p.info_hash = sha1_hash(argv[1]);
You need to decode it into binary. I believe, with proper escaping, you
could pass the info-hash as binary on the command line, except for a 0,
which likely would be interpreted as a string terminator at some point.
--
Arvid Norberg
Loading...