DobyTang / LazyLibrarian

This project isn't finished yet. Goal is to create a SickBeard, CouchPotato, Headphones-like application for ebooks. Headphones is used as a base, so there are still a lot of references to it.
728 stars 72 forks source link

rtorrent error: Could not find info-hash #1554

Closed WillowMist closed 5 years ago

WillowMist commented 6 years ago

Has anything changed for rtorrent in LL lately? It appears nothing has sent to rtorrent for me in 13 weeks. I'm getting the following error:

29-Aug-2018 14:50:02 - DEBUG :: SEARCHBOOK : rtorrent.py:getServer:45 : rTorrent client version = 0.9.6 29-Aug-2018 14:50:09 - ERROR :: SEARCHBOOK : rtorrent.py:addTorrent:102 : rTorrent Error: Fault: <Fault -501: 'Could not find info-hash.'> Caveat: I'm using jackett, and I've tried two different jackett installations. downloadmethods.py is getting the file from jackett, and I've verified it by copying the url and downloading it manually. I've also been able to upload the downloaded file to the rutorrent interface, and it succeeds.

I'm just not sure where to debug further. Any suggestions?

To help with identifying and fixing issues, please include as much information as possible, including:

LazyLibrarian version number: ff8bc4cba7b9bb30ef1c7ad0aeef64ec90aad030

Operating system used: Freenas

Interface in use: Bookstrap

Which api: GoodReads

Source of your LazyLibrarian installation: git, philborman

philborman commented 6 years ago

rtorrent has always been a bit of a problem. There is little to no documentation, and I don't use it myself so it's a pig to maintain. Nothing has changed in the rtorrent interface since February, apart from a few message changes in June which don't affect function.

There were some jackett changes that had to be coded around for the deluge interface back in July, might be something similar needed for rtorrent? Jacket sometimes sends torrent urls back to lazylibrarian b64encoded whereas it used to always send plain text. See lazylibrarian commit 084f847. Deluge can't handle the already encoded data, maybe rtorrent can't either? Only applies to torrent urls, not magnet links. Can you confirm if it's a url or a magnet, and are you up for some editing to debug/fix it?

WillowMist commented 6 years ago

It is a URL, and I'm happy to try :)

philborman commented 6 years ago

ok great thanks, first thing is to find out exactly what we are sending to rtorrent, so in downloadmethods.py line 365 is downloadID, res = rtorrent.addTorrent(tor_url, hashid) just before that we need to add logger.info("URL: %s" % tor_url[:40]) logger.info("HASH: %s" % hashid) logger.info("DATA: %s" % torrent[:40])

this is just to make sure the values look sensible, and to check torrent isn't empty and whether it is already encoded. We don't currently use torrent data in rtorrent, just the url and hash but we could maybe use data instead, that works with jackett/deluge

WillowMist commented 6 years ago

False alarm, sorta. It seems that since my Jackett instance was on the local network, but the rtorrent wasn't, it couldn't see the URL. It might be good to send the data rather than the torrent for that reason, but it's not an encoding thing, it seems.

philborman commented 6 years ago

Ah, I see. I have attached a zip with 3 new files in it. Can you rename or move the old lazylibrarian files first so you can put them back afterwards and drop these replacements in.

These files should send data to rtorrent instead of the url, and we try with and without encoding the data first. Transmission needs the data encoding, deluge doesn't care. Not sure about rtorrent yet. I have also added some debug lines to get info for extra features that were missing from rtorrent before, the results of the extra log messages will be useful to get them working.

If the download successfully gets sent to rtorrent, go to the "history" page and you should see the file listed at the top of the page. In the log there should be lines prefixed PAB with a sequence of 5 numbers. These should help me work out how to get a proper percentage for the bar. There is no documentation for rtorrent, just the names bytes_done, completed_bytes, complete, left_bytes, size_bytes I'm hoping it's simple and "complete" is either an integer 0 to 100 or a float 0.0 to 1.0 (deluge uses one method, transmission uses the other) or it could be just True/False in which case some of the other numbers can be used to calculate the percentage. The log will show this line every few seconds while you are on "history" page, just 2 or 3 lines as the download is running should be enough info.

Also when the postprocessor runs after the download completes there should be 2 more lines printed prefixed PAB, one with a list of filenames and the other with a list of sizes. Again without documentation I don't know what to expect. Some downloaders send a dictionary of values, some send text, some send a json encoded list.

Thanks. rtorrent.zip

WillowMist commented 6 years ago

30-Aug-2018 10:29:06 - DEBUG :: SEARCHBOOK : rtorrent.py:getServer:46 : rTorrent client version = 0.9.6 30-Aug-2018 10:29:06 - DEBUG :: SEARCHBOOK : rtorrent.py:addTorrent:78 : Sending rTorrent content [d8:announce79:http://t.obfuscated.net/...] 30-Aug-2018 10:29:06 - ERROR :: SEARCHBOOK : rtorrent.py:addTorrent:105 : rTorrent Error: Fault: <Fault -503: 'Call XML not a proper XML-RPC call. Call is not valid XML. XML parsing failed'> 30-Aug-2018 10:29:06 - ERROR :: SEARCHBOOK : downloadmethods.py:TORDownloadMethod:511 : Failed to send torrent to RTORRENT

philborman commented 6 years ago

ok so it looks like we do need it encoded... Two options, 50/50 Try this one first... rtorrent.zip

WillowMist commented 6 years ago

30-Aug-2018 11:04:01 - DEBUG :: SEARCHBOOK : rtorrent.py:getServer:46 : rTorrent client version = 0.9.6 30-Aug-2018 11:04:01 - DEBUG :: SEARCHBOOK : rtorrent.py:addTorrent:78 : Sending rTorrent content [d8:announce79:http://t.obfuscated.net/...] 30-Aug-2018 11:04:08 - ERROR :: SEARCHBOOK : rtorrent.py:addTorrent:105 : rTorrent Error: Fault: <Fault -501: 'Could not find info-hash.'> 30-Aug-2018 11:04:08 - ERROR :: SEARCHBOOK : downloadmethods.py:TORDownloadMethod:511 : Failed to send torrent to RTORRENT

I'm also getting this from postprocess: 30-Aug-2018 11:08:03 - ERROR :: POSTPROCESS : postprocess.py:getDownloadFiles:1071 : Failed to get list of files from RTORRENT for ce34bab7164c6c2453ac9972e58523306c384c39: Fault <Fault -501: 'Too few arguments, missing index.'>

philborman commented 6 years ago

It's fun trying to debug without a working rtorrent to try and no documentation ;-) Here is another attempt to get the data sent to rtorrent, and an attempt to send the index for getDownloadFiles rtorrent.zip

WillowMist commented 6 years ago

Never a dull moment :)

Same error:

30-Aug-2018 12:21:04 - DEBUG :: SEARCHBOOK : rtorrent.py:getServer:47 : rTorrent client version = 0.9.6 30-Aug-2018 12:21:04 - DEBUG :: SEARCHBOOK : rtorrent.py:addTorrent:79 : Sending rTorrent content [d8:announce79:http://t.somesite.net/...] 30-Aug-2018 12:21:12 - ERROR :: SEARCHBOOK : rtorrent.py:addTorrent:106 : rTorrent Error: Fault: <Fault -501: 'Could not find info-hash.'> 30-Aug-2018 12:21:12 - ERROR :: SEARCHBOOK : downloadmethods.py:TORDownloadMethod:511 : Failed to send torrent to RTORRENT

philborman commented 6 years ago

ok, thanks for that. Think I will have to get a working rtorrent here to try.

WillowMist commented 6 years ago

Ok, I'll switch back for now. I have it working, but not in an optimal way :) Thanks for jumping on the task so quickly :)

philborman commented 6 years ago

Think it's fixed now. rtorrent does need the data encoding, just not in the same way as any of the other torrent downloaders :-) rtorrent.zip I think the progress bar and postprocessor should be ok now too, but the extra debug lines are still in there to check...