diff --git a/autoProcess/autoProcessComics.py b/autoProcess/autoProcessComics.py index a4b56fc0..72c06efb 100644 --- a/autoProcess/autoProcessComics.py +++ b/autoProcess/autoProcessComics.py @@ -4,12 +4,14 @@ import os.path import time import ConfigParser import logging +import socket from nzbToMediaEnv import * from nzbToMediaUtil import * from nzbToMediaSceneExceptions import process_all_exceptions Logger = logging.getLogger() +socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout. class AuthURLOpener(urllib.FancyURLopener): def __init__(self, user, pw): diff --git a/autoProcess/autoProcessGames.py b/autoProcess/autoProcessGames.py index 00d67dbf..9fd6a082 100644 --- a/autoProcess/autoProcessGames.py +++ b/autoProcess/autoProcessGames.py @@ -7,11 +7,13 @@ import datetime import time import json import logging +import socket from nzbToMediaEnv import * from nzbToMediaUtil import * Logger = logging.getLogger() +socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout. def process(dirName, nzbName=None, status=0, inputCategory=None): diff --git a/autoProcess/autoProcessMovie.py b/autoProcess/autoProcessMovie.py index 6e5c7022..fce9c074 100644 --- a/autoProcess/autoProcessMovie.py +++ b/autoProcess/autoProcessMovie.py @@ -7,6 +7,7 @@ import datetime import time import json import logging +import socket import Transcoder from nzbToMediaEnv import * @@ -14,6 +15,7 @@ from nzbToMediaUtil import * from nzbToMediaSceneExceptions import process_all_exceptions Logger = logging.getLogger() +socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout. def get_imdb(nzbName, dirName): diff --git a/autoProcess/autoProcessMusic.py b/autoProcess/autoProcessMusic.py index 3daab4b8..ce5d2e84 100644 --- a/autoProcess/autoProcessMusic.py +++ b/autoProcess/autoProcessMusic.py @@ -7,11 +7,13 @@ import datetime import time import json import logging +import socket from nzbToMediaEnv import * from nzbToMediaUtil import * Logger = logging.getLogger() +socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout. def process(dirName, nzbName=None, status=0, inputCategory=None): diff --git a/autoProcess/autoProcessTV.py b/autoProcess/autoProcessTV.py index cb15175b..951b0ffc 100644 --- a/autoProcess/autoProcessTV.py +++ b/autoProcess/autoProcessTV.py @@ -5,6 +5,7 @@ import ConfigParser import logging import shutil import time +import socket import Transcoder from nzbToMediaEnv import * @@ -12,6 +13,8 @@ from nzbToMediaUtil import * from nzbToMediaSceneExceptions import process_all_exceptions Logger = logging.getLogger() +TimeOut = 4 * int(TimeOut) # SickBeard needs to complete all moving and renaming before returning the log sequence via url. +socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout. class AuthURLOpener(urllib.FancyURLopener): diff --git a/autoProcess/nzbToMediaEnv.py b/autoProcess/nzbToMediaEnv.py index ce61d247..fc97377e 100644 --- a/autoProcess/nzbToMediaEnv.py +++ b/autoProcess/nzbToMediaEnv.py @@ -2,6 +2,7 @@ # Global Constants VERSION = 'V9.0' +TimeOut = 60 # Constants pertinant to SabNzb SABNZB_NO_OF_ARGUMENTS = 8 diff --git a/changelog.txt b/changelog.txt index 6110721d..36a713fe 100644 --- a/changelog.txt +++ b/changelog.txt @@ -14,6 +14,7 @@ Added Torrent Hash to Deluge to assist with movie ID. Added passwords option to attempt extraction od passworded archives. Impacts All +Added default socket timeout to prevent script hanging when the destination servers don't respond to http requests. Made processing Category Centric as an option for people running multiple versions of SickBeard and CouchPotato etc. Added TPB version of SickBeard processing. This now uses a fork pass-in instead of failed_fork. Added new option to convert files, directories, and parameters to ASCII. To be used if you regularly download "foreign" titles and have problems with CP/SB.