diff --git a/autoProcess/autoProcessGames.py b/autoProcess/autoProcessGames.py index f78d7932..3ebe521d 100644 --- a/autoProcess/autoProcessGames.py +++ b/autoProcess/autoProcessGames.py @@ -12,24 +12,6 @@ from nzbToMediaEnv import * Logger = logging.getLogger() -class AuthURLOpener(urllib.FancyURLopener): - def __init__(self, user, pw): - self.username = user - self.password = pw - self.numTries = 0 - urllib.FancyURLopener.__init__(self) - - def prompt_user_passwd(self, host, realm): - if self.numTries == 0: - self.numTries = 1 - return (self.username, self.password) - else: - return ('', '') - - def openit(self, url): - self.numTries = 0 - return urllib.FancyURLopener.open(self, url) - def process(dirName, nzbName=None, status=0): status = int(status) @@ -45,8 +27,6 @@ def process(dirName, nzbName=None, status=0): host = config.get("Gamez", "host") port = config.get("Gamez", "port") - username = config.get("Gamez", "username") - password = config.get("Gamez", "password") apikey = config.get("Gamez", "apikey") try: @@ -59,8 +39,6 @@ def process(dirName, nzbName=None, status=0): except ConfigParser.NoOptionError: web_root = "" - myOpener = AuthURLOpener(username, password) - if ssl: protocol = "https://" else: @@ -79,7 +57,7 @@ def process(dirName, nzbName=None, status=0): Logger.debug("Opening URL: %s", url) try: - urlObj = myOpener.openit(url) + urlObj = urllib.urlopen(url) except: Logger.exception("Unable to open URL") return 1 # failure diff --git a/autoProcess/autoProcessMovie.py b/autoProcess/autoProcessMovie.py index f0597408..a0d2605c 100644 --- a/autoProcess/autoProcessMovie.py +++ b/autoProcess/autoProcessMovie.py @@ -14,24 +14,6 @@ from nzbToMediaSceneExceptions import process_all_exceptions Logger = logging.getLogger() -class AuthURLOpener(urllib.FancyURLopener): - def __init__(self, user, pw): - self.username = user - self.password = pw - self.numTries = 0 - urllib.FancyURLopener.__init__(self) - - def prompt_user_passwd(self, host, realm): - if self.numTries == 0: - self.numTries = 1 - return (self.username, self.password) - else: - return ('', '') - - def openit(self, url): - self.numTries = 0 - return urllib.FancyURLopener.open(self, url) - def get_imdb(nzbName, dirName): imdbid = "" @@ -59,7 +41,7 @@ def get_imdb(nzbName, dirName): Logger.info("Postprocessing will continue, but the movie may not be identified correctly by CouchPotato") return "" -def get_movie_info(myOpener, baseURL, imdbid, download_id): +def get_movie_info(baseURL, imdbid, download_id): if not imdbid and not download_id: return "" @@ -68,7 +50,7 @@ def get_movie_info(myOpener, baseURL, imdbid, download_id): Logger.debug("Opening URL: %s", url) try: - urlObj = myOpener.openit(url) + urlObj = urllib.urlopen(url) except: Logger.exception("Unable to open URL") return "" @@ -106,7 +88,7 @@ def get_movie_info(myOpener, baseURL, imdbid, download_id): return movie_id -def get_status(myOpener, baseURL, movie_id, clientAgent, download_id): +def get_status(baseURL, movie_id, clientAgent, download_id): if not movie_id: return "", clientAgent, "none", "none" @@ -115,7 +97,7 @@ def get_status(myOpener, baseURL, movie_id, clientAgent, download_id): Logger.debug("Opening URL: %s", url) try: - urlObj = myOpener.openit(url) + urlObj = urllib.urlopen(url) except: Logger.exception("Unable to open URL") return "", clientAgent, "none", "none" @@ -199,8 +181,6 @@ def process(dirName, nzbName=None, status=0, clientAgent = "manual", download_id host = config.get("CouchPotato", "host") port = config.get("CouchPotato", "port") - username = config.get("CouchPotato", "username") - password = config.get("CouchPotato", "password") apikey = config.get("CouchPotato", "apikey") delay = float(config.get("CouchPotato", "delay")) method = config.get("CouchPotato", "method") @@ -222,8 +202,6 @@ def process(dirName, nzbName=None, status=0, clientAgent = "manual", download_id except (ConfigParser.NoOptionError, ValueError): transcode = 0 - myOpener = AuthURLOpener(username, password) - nzbName = str(nzbName) # make sure it is a string imdbid = get_imdb(nzbName, dirName) @@ -238,9 +216,9 @@ def process(dirName, nzbName=None, status=0, clientAgent = "manual", download_id baseURL = protocol + host + ":" + port + web_root + "/api/" + apikey + "/" - movie_id = get_movie_info(myOpener, baseURL, imdbid, download_id) # get the CPS database movie id this movie. + movie_id = get_movie_info(baseURL, imdbid, download_id) # get the CPS database movie id this movie. - initial_status, clientAgent, download_id, initial_release_status = get_status(myOpener, baseURL, movie_id, clientAgent, download_id) + initial_status, clientAgent, download_id, initial_release_status = get_status(baseURL, movie_id, clientAgent, download_id) process_all_exceptions(nzbName.lower(), dirName) @@ -268,7 +246,7 @@ def process(dirName, nzbName=None, status=0, clientAgent = "manual", download_id Logger.debug("Opening URL: %s", url) try: - urlObj = myOpener.openit(url) + urlObj = urllib.urlopen(url) except: Logger.exception("Unable to open URL") return 1 # failure @@ -296,7 +274,7 @@ def process(dirName, nzbName=None, status=0, clientAgent = "manual", download_id Logger.debug("Opening URL: %s", url) try: - urlObj = myOpener.openit(url) + urlObj = urllib.urlopen(url) except: Logger.exception("Unable to open URL") return 1 # failure @@ -321,7 +299,7 @@ def process(dirName, nzbName=None, status=0, clientAgent = "manual", download_id start = datetime.datetime.now() # set time for timeout pause_for = wait_for * 10 # keep this so we only ever have 6 complete loops. while (datetime.datetime.now() - start) < datetime.timedelta(minutes=wait_for): # only wait 2 (default) minutes, then return. - movie_status, clientAgent, download_id, release_status = get_status(myOpener, baseURL, movie_id, clientAgent, download_id) # get the current status fo this movie. + movie_status, clientAgent, download_id, release_status = get_status(baseURL, movie_id, clientAgent, download_id) # get the current status fo this movie. if movie_status != initial_status: # Something has changed. CPS must have processed this movie. Logger.info("SUCCESS: This movie is now marked as status %s in CouchPotatoServer", movie_status) return 0 # success diff --git a/autoProcess/autoProcessMusic.py b/autoProcess/autoProcessMusic.py index 534e18ca..bc991768 100644 --- a/autoProcess/autoProcessMusic.py +++ b/autoProcess/autoProcessMusic.py @@ -12,24 +12,6 @@ from nzbToMediaEnv import * Logger = logging.getLogger() -class AuthURLOpener(urllib.FancyURLopener): - def __init__(self, user, pw): - self.username = user - self.password = pw - self.numTries = 0 - urllib.FancyURLopener.__init__(self) - - def prompt_user_passwd(self, host, realm): - if self.numTries == 0: - self.numTries = 1 - return (self.username, self.password) - else: - return ('', '') - - def openit(self, url): - self.numTries = 0 - return urllib.FancyURLopener.open(self, url) - def process(dirName, nzbName=None, status=0): status = int(status) @@ -45,8 +27,6 @@ def process(dirName, nzbName=None, status=0): host = config.get("HeadPhones", "host") port = config.get("HeadPhones", "port") - username = config.get("HeadPhones", "username") - password = config.get("HeadPhones", "password") apikey = config.get("HeadPhones", "apikey") delay = float(config.get("HeadPhones", "delay")) @@ -60,8 +40,6 @@ def process(dirName, nzbName=None, status=0): except ConfigParser.NoOptionError: web_root = "" - myOpener = AuthURLOpener(username, password) - if ssl: protocol = "https://" else: @@ -84,7 +62,7 @@ def process(dirName, nzbName=None, status=0): Logger.debug("Opening URL: %s", url) try: - urlObj = myOpener.openit(url) + urlObj = urllib.urlopen(url) except: Logger.exception("Unable to open URL") return 1 # failure diff --git a/autoProcess/migratecfg.py b/autoProcess/migratecfg.py index ca207ffc..ecd1018a 100644 --- a/autoProcess/migratecfg.py +++ b/autoProcess/migratecfg.py @@ -33,6 +33,8 @@ def migrate(): value = os.path.split(os.path.normpath(value))[0] confignew.set("Torrent", option, value) continue + if option in ["username", "password" ]: # these are no-longer needed. + continue confignew.set(section, option, value) section = "SickBeard" @@ -68,6 +70,8 @@ def migrate(): except: pass for item in original: + if option in ["username", "password" ]: # these are no-longer needed. + continue option, value = item confignew.set(section, option, value) @@ -88,6 +92,8 @@ def migrate(): except: pass for item in original: + if option in ["username", "password" ]: # these are no-longer needed. + continue option, value = item confignew.set(section, option, value) @@ -225,8 +231,8 @@ def addnzbget(): confignew.read(configFilenamenew) section = "CouchPotato" - envKeys = ['CATEGORY', 'APIKEY', 'HOST', 'PORT', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT', 'DELAY', 'METHOD', 'DELETE_FAILED'] - cfgKeys = ['cpsCategory', 'apikey', 'host', 'port', 'username', 'password', 'ssl', 'web_root', 'delay', 'method', 'delete_failed'] + envKeys = ['CATEGORY', 'APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'DELAY', 'METHOD', 'DELETE_FAILED'] + cfgKeys = ['cpsCategory', 'apikey', 'host', 'port', 'ssl', 'web_root', 'delay', 'method', 'delete_failed'] for index in range(len(envKeys)): key = 'NZBPO_CPS' + envKeys[index] if os.environ.has_key(key): @@ -246,8 +252,8 @@ def addnzbget(): confignew.set(section, option, value) section = "HeadPhones" - envKeys = ['CATEGORY', 'APIKEY', 'HOST', 'PORT', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT', 'DELAY'] - cfgKeys = ['hpCategory', 'apikey', 'host', 'port', 'username', 'password', 'ssl', 'web_root', 'delay'] + envKeys = ['CATEGORY', 'APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT', 'DELAY'] + cfgKeys = ['hpCategory', 'apikey', 'host', 'port', 'ssl', 'web_root', 'delay'] for index in range(len(envKeys)): key = 'NZBPO_HP' + envKeys[index] if os.environ.has_key(key): @@ -266,8 +272,8 @@ def addnzbget(): confignew.set(section, option, value) section = "Gamez" - envKeys = ['CATEGORY', 'APIKEY', 'HOST', 'PORT', 'USERNAME', 'PASSWORD', 'SSL', 'WEB_ROOT'] - cfgKeys = ['gzCategory', 'apikey', 'host', 'port', 'username', 'password', 'ssl', 'web_root'] + envKeys = ['CATEGORY', 'APIKEY', 'HOST', 'PORT', 'SSL', 'WEB_ROOT'] + cfgKeys = ['gzCategory', 'apikey', 'host', 'port', 'ssl', 'web_root'] for index in range(len(envKeys)): key = 'NZBPO_GZ' + envKeys[index] if os.environ.has_key(key): diff --git a/autoProcessMedia.cfg.sample b/autoProcessMedia.cfg.sample index 6c68642f..aecdb7c6 100644 --- a/autoProcessMedia.cfg.sample +++ b/autoProcessMedia.cfg.sample @@ -8,8 +8,6 @@ cpsCategory = movie apikey = host = localhost port = 5050 -username = -password = ###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ###### ssl = 0 web_root = @@ -42,8 +40,6 @@ hpCategory = music apikey = host = localhost port = 8181 -username = -password = ###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ###### ssl = 0 web_root = @@ -70,8 +66,6 @@ gzCategory = games apikey = host = localhost port = 8085 -username = -password = ###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ###### ssl = 0 web_root = diff --git a/changelog.txt b/changelog.txt index 5525a3cb..596443f1 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,12 @@ Change_LOG / History +VX.X XX/XX/2013 + +Impacts All +Allow use of experimental AAC codec in transcoder. +Remove username and password when api key is used. + + V8.2 26/05/2013 Impacts All diff --git a/nzbToCouchPotato.py b/nzbToCouchPotato.py index bcdd120b..736c8bfa 100755 --- a/nzbToCouchPotato.py +++ b/nzbToCouchPotato.py @@ -28,12 +28,6 @@ # CouchPotato port. #cpsport=5050 -# CouchPotato username. -#cpsusername= - -# CouchPotato password. -#cpspassword= - # CouchPotato uses ssl (0, 1). # # Set to 1 if using ssl, else set to 0. diff --git a/nzbToGamez.py b/nzbToGamez.py index 36e0c769..963b7854 100755 --- a/nzbToGamez.py +++ b/nzbToGamez.py @@ -28,12 +28,6 @@ # Gamez port. #gzport=8085 -# Gamez username. -#gzusername= - -# Gamez password. -#gzpassword= - # Gamez uses ssl (0, 1). # # Set to 1 if using ssl, else set to 0. diff --git a/nzbToHeadPhones.py b/nzbToHeadPhones.py index 8521d27d..e7daec1b 100755 --- a/nzbToHeadPhones.py +++ b/nzbToHeadPhones.py @@ -28,12 +28,6 @@ # HeadPhones port. #hpport=8181 -# HeadPhones username. -#hpusername= - -# HeadPhones password. -#hppassword= - # HeadPhones uses ssl (0, 1). # # Set to 1 if using ssl, else set to 0. diff --git a/nzbToMedia.py b/nzbToMedia.py index 7b2f7db7..1f70ee3c 100755 --- a/nzbToMedia.py +++ b/nzbToMedia.py @@ -28,12 +28,6 @@ # CouchPotato port. #cpsport=5050 -# CouchPotato username. -#cpsusername= - -# CouchPotato password. -#cpspassword= - # CouchPotato uses ssl (0, 1). # # Set to 1 if using ssl, else set to 0. @@ -119,12 +113,6 @@ # HeadPhones port. #hpport=8181 -# HeadPhones username. -#hpusername= - -# HeadPhones password. -#hppassword= - # HeadPhones uses ssl (0, 1). # # Set to 1 if using ssl, else set to 0. @@ -185,12 +173,6 @@ # Gamez port. #gzport=8085 -# Gamez username. -#gzusername= - -# Gamez password. -#gzpassword= - # Gamez uses ssl (0, 1). # # Set to 1 if using ssl, else set to 0.