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

Deluge integration

Post by oldirtdog » Mon Oct 16, 2017 8:53 pm

I'm trying to setup the deluge integration with Mylar and not having very good luck. I might be confused as to what it will actually do, as well. Basically, I want Mylar to go out to 32p (not working either, but might be a different topic) and download a torrent file on a wanted issue. How do we get it to put that torrent file in deluge automatically? I can handle the file once it gets to deluge as far as post processing and importing.

I have the Deluge WebUI setup and working fine, but I am confused because the Mylar deluge config page asks for a username and a password while the WebUI only asks for a password. Does a walkthrough for this type of situation exist out there?

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

Re: Deluge integration

Post by evilhero » Tue Oct 17, 2017 2:06 pm

The Deluge daemon uses an auth file located in the user's .config directory normally (ie. /home/user/.config/deluge/auth), and it parses this for authentication. But in order to parse the file, you need to ensure the deluge daemon is enabled and running - Mylar connects via the daemon, not via the web ui ;)

Go into Preferences / Daemon. Then enable the Daemon port and chose an appropriate port number and ensure that 'Allow Remote Connections' is enabled as well. Then Apply the settings. In Mylar, you enter in the url:port as the host entry (ie. thisis.deluge.com:22181 - don't preceed it with a protocol either).

Once you run the daemon once, the auth file is generated and from there you can edit the file manually and change passwords, or view what the username/passwords are - I believe it defaults to the username/password of whoever is running the Deluge daemon. So then just plunk in the username/password into Mylar, save the config and restart Mylar for the changes to take effect (restarts are required after provider changes, this will be fixed in the next commit or two).

Once you get that connecting OK, paste the problem you're having with 32P (with debug logs, cause I'll just ask for them anyways and it will save a few steps) into a new post in the Problems/Bugs/Issues forum.

As far as workflow, yes - Mylar will automatically send the given torrent from 32P to the deluge client directly via the daemon, label it (if you have the label plugin enabled within deluge) and start downloading it without any prompting from the user.

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

Re: Deluge integration

Post by oldirtdog » Tue Oct 17, 2017 5:00 pm

ok, I have the settings in deluge preferences... however, it doesn't let me telnet to the port, even when on the same PC... is there something I'm missing? The auth file was there when I started, so I assume it started it... is there a particular process that I can check for? I know this isn't deluge support forums, but I'm just not sure how to make sure Mylar is connecting... Is there something in the logs that I should check for? I enabled debug logs and a search for daemon and deluge shows nothing... a search for 32p shows nothing either...

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

Re: Deluge integration

Post by evilhero » Tue Oct 17, 2017 7:39 pm

You can't telnet into the port it's not a telnet/ssh port.

I'm going at this blind - I'll need to see the debug logs that show the search, etc. It won't have anything for deluge in the logs if it has nothing to send - once it attempts to send a torrent to it then it logs the connection attempt and other information.

Basically, if you can't snatch a torrent the process never does anything else.

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

Re: Deluge integration

Post by oldirtdog » Tue Oct 17, 2017 7:51 pm

Gotcha... that makes sense... I'll grab a copy of the logs tonight...

So, maybe we should look into the torrent grab first? I have items in my wanted list... will Mylar just reach out to 32p and search for those issues?

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

Re: Deluge integration

Post by oldirtdog » Wed Oct 18, 2017 1:20 am

OK, so I'm looking at the 32p stuff... I thought doing the auth mode would be the best, but the test shows Successfully Authenticated no matter what I put in the user/pass blanks... It also shows Inkblots NaN, so I assume that's not good... This is from the logs, immediately after restart:
2017-10-17 20:58:32 ERROR [32P-AUTHENTICATION] [LOGIN FAILED] Disabling 32P provider until login error(s) can be fixed in order to avoid temporary bans.
2017-10-17 20:58:32 WARNING [32P-AUTHENTICATION] Both session key and credential-based logins failed.
2017-10-17 20:58:32 ERROR [32P-AUTHENTICATION] Got an exception when trying to login to https://32pag.es/login.php?ajax=1 POST
2017-10-17 20:58:32 INFO [RSS-FEEDS] Initiating Torrent RSS Feed Check on 32P.

Now, if I go to Legacy Mode, I have my key, but I'm not sure what to put for the RSS feed. I put the RSS feed for my bookmarks just to keep it simple and short. Is there one I should be using otherwise? This is what the logs look like once I do a force RSS:

2017-10-17 21:09:04 INFO Could not find Issue 3 of Grant Morrison's Avatarex: Destroyer of Darkness (2016) using 32P [rss]
2017-10-17 21:09:04 INFO Shhh be very quiet...I'm looking for Grant Morrisons Avatarex Destroyer of Darkness issue: 3 (2017) using 32P [RSS]
2017-10-17 21:09:04 INFO Alternate Search pattern detected...re-adjusting to : Grant Morrisons Avatarex Destroyer of Darkness
2017-10-17 21:09:04 INFO Shhh be very quiet...I'm looking for Grant Morrison's Avatarex: Destroyer of Darkness issue: 3 (2017) using 32P [RSS]
2017-10-17 21:09:04 INFO [SEARCH] Special Characters exist within Series Title. Enabling search-safe Name : Grant Morrisons Avatarex Destroyer of Darkness

I do not know that it's looking at my watched list because the Avatarex comic is on there... However, I also know that the particular issue is on 32p... it seems to be complaining about the special characters... surely there is a better way to do this... I just feel like Im missing something...

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

Re: Deluge integration

Post by oldirtdog » Tue Oct 24, 2017 12:54 pm

Bump... sorry, I hate to be a bother... I know you're super busy :?

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

Re: Deluge integration

Post by evilhero » Tue Oct 24, 2017 2:30 pm

No worries - weekends are usually bad for me with time, and yesterday was just one of those days that happen the odd time.

So when you use Legacy mode, you only tap into the RSS Feeds - there's no backlog search available. Which basically means that if Mylar isn't running and actively monitoring the 32p feed when a given issue becomes available, it will never be retrieved (unless it's reposted thereafter, or you happen to catch the tail end of the feed that holds the issue). Mylar will cache the results forever, so the longer it's running the larger the backlog it can search against (the cache). So the RSS results you're getting above are probably correct, since that particular issue might be on 32p, but not on a current RSS feed that you just would have started to monitor. The special characters warning is just Mylar detecting something unique in the series title, and making adjustments to the search query.

Auth mode will tap into both the RSS feeds and allow for backlog searching (ala API). There are some limitations with the backlog searching however (mainly annuals are problematic). However it's also harder to setup for some due to the login/pass and having the requirements to allow Mylar to signon to 32p - usually all of which the requirements are already filled as you kinda need it to run Mylar.

Also note that if you change the values for your signon for 32P within Mylar and then test - depending on your version/commit (ie. if you're up-to-date) it will not use the values you just entered, but will use the values that were loaded initially. In this case, with every signon change you'd need to save the config, restart Mylar and then try the test again if this was the case - or just make sure you're running an up-to-date branch of Mylar and then you can perform the test connection using the values that you entered. But you still always have to save the configuration if you want the values to be used going forward (and after the save, restart Mylar so the settings can be properly applied - this is a long outstanding issue that will get fixed very soon).

So if you're having problems with Auth mode, then it's usually due to either a lack of proper support for your python (either you're not running a minimum version of 2.7.9+, or you don't have the proper library installed although that would manifest itself in an SSL-related error), or your password has been changed/is incorrect.

Easiest to try is the last option:
- First thing is to shutdown Mylar.
- Then go into the cache folder and delete the .32p_cookies.dat file (it should be hidden, but it's there).
- Then open up the config.ini and make positive that your 32p username / password is set correctly and ensure mode_32p = 1 (this will set the mode to auth mode).
- Save the config.ini if you change anything.
- Now start Mylar and immediately go into the Logs tab and enable debug mode (Logs tab/toggle vebose on).
- Then try to do a test connection for 32p and it should signon ok - however note that if the signon page for 32P has the captcha enabled, you won't be able to signon.

Once you signon once successfully however, the captcha issue isn't a problem, since Mylar will then use your session information which is stored in the .32p_cookies.dat file for future signons. You just seem to be stuck somewhere between the two now for some reason.

As for Legacy mode, you would just paste in any full rss feed url for 32p - the easiest to use is the link from the RSS Icon on the Browse Torrents page. Paste that full url in for the feed, and then your key and that should work - but the ideal method to use is the Auth mode for obvious reasons.

As an aside, you should be aware (if you don't already know), you cannot use a VPN with Auth mode - you will get banned from 32p. This has been discussed in their forums as well as a warning showing within Mylar when you enable Auth mode.

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

Re: Deluge integration

Post by oldirtdog » Tue Oct 24, 2017 7:53 pm

well, I did all that... I checked my version of python (2.7.10), checked my 32p login, went through the cache delete process.

As for the login, I logged into 32p on the server using Safari and the captcha was definitely there... however, I went through it, putting the check in remember me, just in case... I used the same login as I typed in the config file... The logs show this, which I have had since I started this whole thing up in auth mode...

2017-10-24 15:49:00 ERROR [32P-AUTHENTICATION] [LOGIN FAILED] Disabling 32P provider until login error(s) can be fixed in order to avoid temporary bans.
2017-10-24 15:49:00 WARNING [32P-AUTHENTICATION] Both session key and credential-based logins failed.
2017-10-24 15:49:00 ERROR [32P-AUTHENTICATION] Got an exception when trying to login to https://32pag.es/login.php?ajax=1 POST
2017-10-24 15:49:00 INFO [RSS-FEEDS] Initiating Torrent RSS Feed Check on 32P.

What do we do from here? I am definitely not using a VPN, but I do have a proxy connected in Deluge... that shouldn't matter, huh?

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

Re: Deluge integration

Post by evilhero » Thu Oct 26, 2017 2:02 pm

No the proxy wouldn't matter at this point, as it's not even signing on to 32P let alone trying to snatch a torrent from there to send to deluge (unless you have Mylar using the proxy). And clicking on the remember me option doesn't affect Mylar at all since it doesn't use a web-browser to signon ;) That's what the 32p_cookies.dat file is for - it saves your sessions information so it will 'remember' your information thereby avoiding the captchas, but you have to successfully signon on once with Mylar.

Here's some more questions for ya:
- do you have any special characters in your password that might cause problems ?
- did you delete the cache/.32p_cookies.dat file with Mylar not running ?
- the captcha is no longer present on 32P (at least atm), have you tried it since the captcha prompt is no longer present?
- the fact that both the session key & credentials have failed, providing that the key was deleted as above and the user/pass are correct - usually is due to the inability to use https sites due to a lack of a module being installed. Do you have any other sites within Mylar that use https and work? Normally, installing the requests-cryptography module fires things off for people, which is as simple as doing this from a command line if you have pip installed:

Code: Select all

pip install requests[cryptography]

Post Reply