Page 1 of 1
[SOLVED] WebUIAPI: how to track a base32 infohash download
Posted: Wed May 13, 2015 11:44 am
by plinplocho
Hi all, I'm implementing a simple gui for qbittorrent, using the new WebUIAPI v2. My problem is, when adding a download via a magnet uri, the /command/download method does not return a handle to the download. As I need to track its state (to perform certain file operation once it's finished) I had to resource to the hash contained in the uri. It works ok, except when it's a base32 hash, in such a case, qbittorrent seems to convert it to sha1 and use that for all the api methods. My goal would be to perform myself the conversion so i can match the hash used by bittorrent. I don´t know how to do that (seems trivial in python, but i´m using delphi) Any ideas? Thanks in advance!
[Edit]
I´ve recently added an entry to the wiki with more details about this, it´s here:
https://github.com/qbittorrent/qBittorrent/wiki/How-to-convert-base32-to-base16-info-hashes
Re: WebUIAPI: how to track a base32 infohash download
Posted: Wed May 13, 2015 10:44 pm
by plinplocho
Solved myself. All i had to do is decode the hash (originally base32 encoded) and then re-encode it in base16. Just for the record, in delphi I've used SZCodeBaseX library, something like:
Hash16:= SZEncodeBase16(SZDecodeBase32(Hash32));
Thanks anyway!
Re: WebUIAPI: how to track a base32 infohash download
Posted: Thu May 14, 2015 1:40 am
by Nemo
Good

. Thanks for writing down the way you have solved it. Might help others who are having the same issue.
And welcome by the way.
Re: WebUIAPI: how to track a base32 infohash download
Posted: Thu May 14, 2015 4:55 pm
by plinplocho
Thanks Nemo, let me add that the new webUI api is great!
Re: WebUIAPI: how to track a base32 infohash download
Posted: Thu May 14, 2015 5:01 pm
by ciaobaby
[quote="Nemo"]
Good

. Thanks for writing down the way you have solved it. Might help others who are having the same issue.
[/quote]
Flesh it out a bit and put it up as a page on the Wiki (
http://wiki.qbittorrent.org)
Re: WebUIAPI: how to track a base32 infohash download
Posted: Tue May 19, 2015 10:54 am
by plinplocho
[quote="ciaobaby"]
[quote="Nemo"]
Good

. Thanks for writing down the way you have solved it. Might help others who are having the same issue.
[/quote]
Flesh it out a bit and put it up as a page on the Wiki (
http://wiki.qbittorrent.org)
[/quote]
Let me know if I can help with that
Re: WebUIAPI: how to track a base32 infohash download
Posted: Tue May 19, 2015 12:32 pm
by ciaobaby
[quote="plinplocho"]
[quote="ciaobaby"]
Flesh it out a bit and put it up as a page on the Wiki (
http://wiki.qbittorrent.org)
[/quote]
Let me know if I can help with that
[/quote]
I was rather suggesting that you could do that,
Personally I haven't done any Delphi programming for over ten years, though as Pascal was the pretty much the first 'serious' language I learned to code in, I do have a bit of a 'soft spot' for Delphi.

Re: [SOLVED] WebUIAPI: how to track a base32 infohash download
Posted: Wed May 20, 2015 3:24 pm
by plinplocho
ok ciaobaby, i´ll try then. English is not my native tongue so it´s a little bit harder for me so i´ll probably ask you for some advice before posting.
Re: [SOLVED] WebUIAPI: how to track a base32 infohash download
Posted: Wed May 20, 2015 5:55 pm
by ciaobaby
Don't worry too much about getting the language precise, there are a few native English speakers (and a some Americans

) who can and will edit any grammar, typos or spellnig errors should it need any 'fixing' to hone the document into final shape
Re: [SOLVED] WebUIAPI: how to track a base32 infohash download
Posted: Tue Jun 02, 2015 12:55 pm
by plinplocho
Well, for everyone interested in this, I added an entry to the wiki, the link is in my first post.