Deluge integration

Information and Tutorials on features in Mylar and how to use it
User avatar
oldirtdog
Posts: 21
Joined: Fri Nov 04, 2016 7:52 pm

Re: Deluge integration

Post by oldirtdog » Thu Oct 26, 2017 3:05 pm

- My password is just mixed case and numbers
- I just deleted the cache file with mylar off, then loaded it back up, forced authentication, and verified the cache file was recreated... same error
- I open up Safari and open 32p and am greeted with my stuff, not a login and captcha... however, if I logoff and back on, I definitely have to go through the captcha
- I am using python 2.7.10 (per Mylar, great feature, thanks!) and get this when I run that command in terminal:
Confusatron:cache mfmarlowefamily$ pip install requests[cryptography]
Requirement already satisfied: requests[cryptography] in /Library/Python/2.7/site-packages/requests-2.5.1-py2.7.egg
requests 2.5.1 does not provide the extra 'cryptography'

I'm not entirely sure what that last set of errors means. One thing that worries me is that the auth shows successful but the ink drops shows NaN... I assume that should reach out and find how many I have in my account?

I appreciate the help... I know this is getting deep...

User avatar
evilhero
Site Admin
Posts: 2027
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Deluge integration

Post by evilhero » Thu Oct 26, 2017 3:24 pm

Try pip install requests[cryptography] --upgrade to update your requests version which should then also update your cryptography to the appropriate level.

If the auth shows successful, then it looks like you're authenticated properly - the inkdrops should display immediately after the successful display (you shouldn't have to refresh the config page, but you could try that too). You do however, have to save the config and restart Mylar for the changes to take effect properly after the successful authentication test result (it doesn't save the settings, it just tests what's in the fields).

As far as your inkdrops, when you're on 32P just look at the top of a given page, you'll see how many inkdrops you have and that's what Mylar should be showing (or at least close to that depending on your upload/downloads happening at that moment).

User avatar
oldirtdog
Posts: 21
Joined: Fri Nov 04, 2016 7:52 pm

Re: Deluge integration

Post by oldirtdog » Thu Oct 26, 2017 3:49 pm

ok, I ran that command... it now shows me this when I try to do the install or upgrade:
Confusatron:cache mfmarlowefamily$ sudo -H pip install requests[cryptography] --upgrade
Requirement already up-to-date: requests[cryptography] in /Library/Python/2.7/site-packages
requests 2.18.4 does not provide the extra 'cryptography'
Requirement already up-to-date: idna<2.7,>=2.5 in /Library/Python/2.7/site-packages (from requests[cryptography])
Requirement already up-to-date: urllib3<1.23,>=1.21.1 in /Library/Python/2.7/site-packages (from requests[cryptography])
Requirement already up-to-date: certifi>=2017.4.17 in /Library/Python/2.7/site-packages (from requests[cryptography])
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in /Library/Python/2.7/site-packages (from requests[cryptography])

I'm not sure that the requests 2.18.4 not providing the extra is a big deal, but it's the only thing that pops out... it all seems right, but I have a feeling this is where the problem lies... the ink drops are still showing NaN but the windows shows successfully authenticated... what's strange, and I'm not sure why it would do this, but when I change the login to an obviously incorrect one, it still shows successfully authenticated.... I restarted mylar and refreshed the browser after making the change, too...

This is now my full debug with a search on 32p:

2017-10-26 11:48:50 ERROR Uncaught exception: Traceback (most recent call last):
File "/Applications/Mylar/mylar/logger.py", line 165, in new_run
old_run(*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/threading.py", line 763, in run
self.__target(*self.__args, **self.__kwargs)
File "/Applications/Mylar/mylar/rsscheckit.py", line 74, in run
feed32p = auth32p.info32p()
TypeError: __init__() should return None, not 'str'
2017-10-26 11:48:50 ERROR [32P-AUTHENTICATION] [LOGIN FAILED] Disabling 32P provider until login error(s) can be fixed in order to avoid temporary bans.
2017-10-26 11:48:50 WARNING [32P-AUTHENTICATION] Both session key and credential-based logins failed.
2017-10-26 11:48:50 ERROR [32P-AUTHENTICATION] Got an exception when trying to login to https://32pag.es/login.php?ajax=1 POST
2017-10-26 11:48:50 INFO [RSS-FEEDS] Initiating Torrent RSS Feed Check on 32P.

User avatar
evilhero
Site Admin
Posts: 2027
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Deluge integration

Post by evilhero » Thu Oct 26, 2017 4:08 pm

Ok, so it looks like they changed the cryptography in later verisons - it looks like it should be pip install requests[security] --upgrade, which should upgrade all the required libraries, or install them if they're not already there. Otherwise, you're above the minimum requirements for usage based on that pip log (minus the cryptography stuff, which it didn't log cause it wasn't supported).

I'm gonna ask you to try something, and hopefully you're ok with editing a file - as we need to know what the exception is that's causing problems.

So in the mylar subdirectory, there's a file called auth32p.py. Shutdown Mylar and then backup the auth32p.py file somewhere, cause once you change it you won't be able to update normally. Then if you can edit that file, and find roughly line 494 you'll see this line:

Code: Select all

logger.error(self.module + " Got an exception when trying to login to %s POST", u)
can you change it so that it's:

Code: Select all

logger.error(self.module + " Got an exception when trying to login to %s POST [%s]", (u,e))
save the file, delete the auth32p.pyc file in the same directory (it can cause problems on some systems if it's left after a code change), then start Mylar up in debug mode and try again to see what the error posted is.

User avatar
oldirtdog
Posts: 21
Joined: Fri Nov 04, 2016 7:52 pm

Re: Deluge integration

Post by oldirtdog » Thu Oct 26, 2017 5:07 pm

ok, I have been trying to get the errors corrected when running the pip stuff. I managed to get it now so it doesn't show me anything red or yellow. Nothing changed though.

I went into the file like you asked and made the change... I suspect this was just to get some better logging... however, it now seems to be working... it shows me the ink drops and the log is now full of file checks... so now I guess we need to look at what it's doing...

I'm using Super Sons (2017) as an example... I have issues 1-9 in my wanted list and it is looking for them on 32p... however, it doesn't seem to find any of them... they all say something like this:

2017-10-26 12:56:17 INFO Could not find Issue 1 of Super Sons (2017) using TPSE [rss]
2017-10-26 12:56:17 INFO Shhh be very quiet...I'm looking for Super Sons issue: 1 (2017) using TPSE [RSS]
2017-10-26 12:56:17 INFO Could not find Issue 1 of Super Sons (2017) using 32P [rss]
2017-10-26 12:56:17 INFO Shhh be very quiet...I'm looking for Super Sons issue: 1 (2017) using 32P [RSS]

I noticed that is for RSS, then I saw the API searches a little above... this is what they say:

2017-10-26 13:01:56 INFO Could not find Issue 3 of Super Sons (2017) using 32P [api]
2017-10-26 13:01:55 INFO matched on Super Sons
2017-10-26 13:01:55 INFO Found Super Sons (2017) issue: 3 using 32P
2017-10-26 13:01:55 INFO entry: {'seeders': u'16', 'scanner': u'Oroboros-DCP', 'pubdate': 'Wed, 19 Apr 2017 09:00:31', 'format': u'cbr', 'chkit': {'series': u'Super Sons', 'id': u'19884'}, 'leechers': u'0', 'link': u'50319', 'int_pubdate': 1492606831.0, 'issues': u'3', 'language': u'English', 'title': u'Super Sons v0 #3', 'filesize': u'36970035', 'pack': u''}
2017-10-26 13:01:54 INFO dataset: [{'series': u'Super Sons', 'id': u'19884'}]
2017-10-26 13:01:54 INFO Exact series ID already discovered previously. Setting to :Super Sons[19884]
2017-10-26 13:01:54 INFO Shhh be very quiet...I'm looking for Super Sons issue: 3 (2017) using 32P

I'm wondering if it's just a name matching kinda thing...

User avatar
evilhero
Site Admin
Posts: 2027
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Deluge integration

Post by evilhero » Thu Oct 26, 2017 6:25 pm

Well it looks like it's finding it fine on 32P, that's what this shows :

Code: Select all

2017-10-26 13:01:55	INFO	Found Super Sons (2017) issue: 3 using 32P
But without debug logging turned on it's really hard to see what's missing (there's a crapload of lines in debug that would help narrow it down). I would guess, based on some problems you're having - that it's probably having some sort of problem sending to your torrent client, however without seeing the debug logs it's really hard cause it's just saying it found it, then couldn't either snatch it or send it to the client.

User avatar
oldirtdog
Posts: 21
Joined: Fri Nov 04, 2016 7:52 pm

Re: Deluge integration

Post by oldirtdog » Thu Oct 26, 2017 6:42 pm

yeah it doesn't look like it is connecting...

2017-10-26 14:37:04 INFO Could not find Issue 9 of Super Sons (2017) using 32P [api]
2017-10-26 14:37:04 ERROR Unable to send torrent - check logs and settings (this would be marked as a BAD torrent if Failed Handling was enabled)
2017-10-26 14:37:04 INFO Not connected to Deluge!
2017-10-26 14:37:04 ERROR Could not connect to Deluge 192.168.0.50
2017-10-26 14:37:04 DEBUG [32P] Saved torrent file to : /Applications/Mylar/cache/Super_Sons_9_2017.torrent
2017-10-26 14:37:04 DEBUG [32P-AUTHENTICATION] 32P (Auth Mode) Authentication already done. Attempting to use existing keys.
2017-10-26 14:37:04 DEBUG [32P] Verify SSL set to : True
2017-10-26 14:37:04 DEBUG filename for torrent set to : /Applications/Mylar/cache/Super_Sons_9_2017.torrent
2017-10-26 14:37:04 INFO matched on Super Sons
2017-10-26 14:37:04 DEBUG Torrent Provider:32P
2017-10-26 14:37:04 DEBUG link:56015
2017-10-26 14:37:04 DEBUG ComicName:Super Sons
2017-10-26 14:37:04 DEBUG link given by: 32P
2017-10-26 14:37:04 INFO Found Super Sons (2017) issue: 9 using 32P

If I go through my settings, I have it configured to use 192.168.0.50:58846 and Deluge is set to use that same port under the Daemon settings... allow remote connections is checked... I use the WebUI, but from what you said, that isn't what we want to use here... when I try to telnet to that port, it always comes back connection refused... I even ran a port scan and it shows it is closed... am I missing something on the deluge side?

User avatar
evilhero
Site Admin
Posts: 2027
Joined: Sat Apr 20, 2013 3:43 pm
Contact:

Re: Deluge integration

Post by evilhero » Thu Oct 26, 2017 6:51 pm

Pretty sure the portscans, telnet's won't work with the deluge daemon port - you wouldn't get a telnet response, since it's not a telnet port. Unless you have a firewall active and you didn't open that port, it really shouldn't matter.

Do you have a username/password entered into mylar for deluge ?

Do you have an auth file (ie. /var/lib/deluge/.config/deluge) with the given username/password therein? Since the auth file is used by your local user, you may have to copy the auth file to /home/myaccount/.config/deluge in order for things to get picked up.

Not sure if this link might help...

User avatar
oldirtdog
Posts: 21
Joined: Fri Nov 04, 2016 7:52 pm

Re: Deluge integration

Post by oldirtdog » Thu Oct 26, 2017 8:23 pm

I do have an auth file in that directory /home/username/.config/deluge ... when I edit it, it shows a localhost with a long string and then my custom login on the second line with my password... this second login is the one I'm using in Mylar...

I installed Deluge using the Deluge.app downloaded from the website... I didn't build it from the macports or whatever... I never saw a reason to... as such, the link you sent me asks me to run deluged at the command line, but that isn't available to me... I guess I'm going to have to take this to the deluge forums now... I think the daemon isn't working like expected...

User avatar
oldirtdog
Posts: 21
Joined: Fri Nov 04, 2016 7:52 pm

Re: Deluge integration

Post by oldirtdog » Thu Oct 26, 2017 8:45 pm

OK, so I think I have it figured out! The daemon wasn't starting because at some point I had turned on the "classic mode" UI... as such, it never asked me to connect or start the daemon using the Connection Manager. As soon as I took that check off and restarted Deluge, it prompted me to start the localhost daemon. I ran a force check of the wanted list and I now have some Super Sons issues downloading in my client!

Holy crap that was a wild ride, huh? I'm so super glad we got it worked out and it's because you're so awesome at what you do... I can't think you enough for what you do and what you've done for the community. I really appreciate it!

Post Reply