sabToSiCKRAGE.py Issues

Support for the Debian/Ubuntu package, created by JCFP.
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
simons1000
Newbie
Newbie
Posts: 1
Joined: November 8th, 2016, 8:43 am

sabToSiCKRAGE.py Issues

Post by simons1000 »

Version: (SABnzbd Version: 1.1.1RC3l)
OS: (ubuntu 14.04.5 LTS)
Install-type: (Ubuntu repository)
Skin (if applicable): (n/a)
Firewall Software: (n/a
Are you using IPV6? (no)
Is the issue reproducible? (yes/no)

I has been running sickbeard and sabnzbd and the sabtosickbeard.py script was running perfectly. Decided to change to sickrage and sabnzbd. I updated autoProcessTV.py and autoProcessTV.cfg with my local settings and I can't get it to work.

I get this in the history page: Exit(1) NameError: global name ’HTTPBasicAuthHandler’ is not defined
And this on the script log: Loading config from /home/user/.sickrage/autoProcessTV/autoProcessTV.cfg

Opening URL: http://localhost:8081/home/postprocess/ ... 2FSeason+2
Traceback (most recent call last):
File "/home/user/.sickrage/autoProcessTV/sabToSiCKRAGE.py", line 31, in <module>
autoProcessTV.processEpisode(sys.argv[1], sys.argv[2], sys.argv[7])
File "/home/user/.sickrage/autoProcessTV/autoProcessTV.py", line 118, in processEpisode
handler = HTTPBasicAuthHandler(password_mgr)
NameError: global name 'HTTPBasicAuthHandler' is not defined

Any help you could offer would be much appreciated.

Cheers,

Simon
User avatar
safihre
Administrator
Administrator
Posts: 5366
Joined: April 30th, 2015, 7:35 am
Contact:

Re: sabToSiCKRAGE.py Issues

Post by safihre »

You should ask the sickrage forum! Not completely sure why it's missing that handler..
If you like our support, check our special newsserver deal or donate at: https://sabnzbd.org/donate
downloadmonkey
Newbie
Newbie
Posts: 10
Joined: December 22nd, 2015, 3:26 am

Re: sabToSiCKRAGE.py Issues

Post by downloadmonkey »

Hi

Apparently they don't maintain it properly and unfortunately they disabled issues on Github (don't like that!).
However, the error is in the

Code: Select all

autoProcessTV.py
file as they only define

Code: Select all

HTTPBasicAuthHandler
when an ImportError occurs.

I've bad news and good news for you ;)
The good news is, you can easily fix this issue by patching the file:

Code: Select all

--- autoProcessTV.py.orig	2016-11-20 00:54:47.694745314 +0100
+++ autoProcessTV.py	2016-11-20 00:43:05.252957094 +0100
@@ -32,7 +32,6 @@
     import configparser
     import urllib.request as urllib2
     from urllib.parse import urlencode
-    HTTPBasicAuthHandler = urllib2.HTTPBasicAuthHandler


 def processEpisode(dir_to_process, org_NZB_name=None, status=None):
@@ -115,7 +114,7 @@
     try:
         password_mgr = urllib2.HTTPPasswordMgrWithDefaultRealm()
         password_mgr.add_password(None, url, username, password)
-        handler = HTTPBasicAuthHandler(password_mgr)
+        handler = urllib2.HTTPBasicAuthHandler(password_mgr)
         opener = urllib2.build_opener(handler)
         urllib2.install_opener(opener)
If you don't know patches then simply go to line 137 an replace this…

Code: Select all

handler = HTTPBasicAuthHandler(password_mgr)
… with this…

Code: Select all

handler = urllib2.HTTPBasicAuthHandler(password_mgr)
WARNING: It's Python, so indentation matters ;)

Now the bad news: Apparently with the new login form/mask, SiCKRAGE ignores HTTP Basic auth. So even now as the script performs correctly, SiCKRAGE will simply redirect you (or in this case the script) to the login page. Don't know how to fix it, because I didn't had a look at the SiCKRAGE source code so far.

But IMHO it's a PITA that they decided to drop issue support on GitHub :( To be honest, I think they no longer support these post processing scripts, because they don't work out of the box and the last update was 27 days ago :( Let's see what the future brings.

Cheers
Domi
downloadmonkey
Newbie
Newbie
Posts: 10
Joined: December 22nd, 2015, 3:26 am

Re: sabToSiCKRAGE.py Issues

Post by downloadmonkey »

Btw in case you're running SABnzbd and SiCKRAGE on the same instance, then you can probably use https://github.com/SiCKRAGETV/SiCKRAGE/ ... iCKRAGE.py. According to the source code, it needs to be placed in the right directory and it will import the SiCKRAGE Python module to open a web session.

Unfortunately I'm using Docker, which means there's no SiCKRAGE Python module in the SABnzbd docker image/container. I don't know if they're looking forward to replace

Code: Select all

sabToSiCKRAGE
with

Code: Select all

mediaToSiCKRAGE
, but I think that would be a bad idea!
downloadmonkey
Newbie
Newbie
Posts: 10
Joined: December 22nd, 2015, 3:26 am

Re: sabToSiCKRAGE.py Issues

Post by downloadmonkey »

Post Reply