Discussion:
[libtorrent] "Re: Any specific reason as to my INFO-HASH to
Viren Negi
8 years ago
Permalink
Taken reference from the http://libtorrent.org/examples.html. I modified to
code to look like this

add_torrent_params p;
....
....
sha1_hash t1;
if(from_hex(argv[1], 40, (char *)&t1[0])) {
p.info_hash = t1;
std::cout << "Got here" << std::endl;
}
else {
std::cout << "invalid info-hash" << std::endl;
exit(1);
}

I still don't see it working.
Arvid Norberg
8 years ago
Permalink
Post by Viren Negi
Taken reference from the http://libtorrent.org/examples.html. I modified to
code to look like this
add_torrent_params p;
....
....
sha1_hash t1;
if(from_hex(argv[1], 40, (char *)&t1[0])) {
p.info_hash = t1;
std::cout << "Got here" << std::endl;
}
else {
std::cout << "invalid info-hash" << std::endl;
exit(1);
}
I still don't see it working.
How does it fail?

Does it work if you pass the hex encoded info-hash as a magnet link to
parse_magnet_uri()?

If so, you could take a look at the add_torrent_params object in the
debugger and see if you any difference in the info hash field.
--
Arvid Norberg
Continue reading on narkive:
Loading...