mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-30 03:28:26 -07:00
move socket timeout before url call for renamer. fixes #242
This commit is contained in:
parent
dfe4ed9ad4
commit
a29206d51c
1 changed files with 5 additions and 3 deletions
|
@ -258,6 +258,9 @@ def process(dirName, nzbName=None, status=0, clientAgent = "manual", download_id
|
||||||
process_all_exceptions(nzbName.lower(), dirName)
|
process_all_exceptions(nzbName.lower(), dirName)
|
||||||
nzbName, dirName = converto_to_ascii(nzbName, dirName)
|
nzbName, dirName = converto_to_ascii(nzbName, dirName)
|
||||||
|
|
||||||
|
TimeOut2 = int(wait_for) * 60 # If transfering files across directories, it now appears CouchPotato can take a while to confirm this url request... Try using wait_for timing.
|
||||||
|
socket.setdefaulttimeout(int(TimeOut2)) #initialize socket timeout. We may now be able to remove the delays from the wait_for section below?
|
||||||
|
|
||||||
if status == 0:
|
if status == 0:
|
||||||
if transcode == 1:
|
if transcode == 1:
|
||||||
result = Transcoder.Transcode_directory(dirName)
|
result = Transcoder.Transcode_directory(dirName)
|
||||||
|
@ -311,8 +314,6 @@ def process(dirName, nzbName=None, status=0, clientAgent = "manual", download_id
|
||||||
url = baseURL + "movie.searcher.try_next/?id=" + movie_id
|
url = baseURL + "movie.searcher.try_next/?id=" + movie_id
|
||||||
|
|
||||||
Logger.debug("Opening URL: %s", url)
|
Logger.debug("Opening URL: %s", url)
|
||||||
TimeOut2 = wait_for * 60 # If transfering files across directories, it now appears CouchPotato can take a while to confirm this url request... Try using wait_for timing.
|
|
||||||
socket.setdefaulttimeout(int(TimeOut2)) #initialize socket timeout. We may now be able to remove the delays from the wait_for section below?
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
urlObj = urllib.urlopen(url)
|
urlObj = urllib.urlopen(url)
|
||||||
|
@ -338,8 +339,9 @@ def process(dirName, nzbName=None, status=0, clientAgent = "manual", download_id
|
||||||
|
|
||||||
# we will now check to see if CPS has finished renaming before returning to TorrentToMedia and unpausing.
|
# we will now check to see if CPS has finished renaming before returning to TorrentToMedia and unpausing.
|
||||||
socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout.
|
socket.setdefaulttimeout(int(TimeOut)) #initialize socket timeout.
|
||||||
|
|
||||||
start = datetime.datetime.now() # set time for timeout
|
start = datetime.datetime.now() # set time for timeout
|
||||||
pause_for = wait_for * 10 # keep this so we only ever have 6 complete loops. This may not be necessary now?
|
pause_for = int(wait_for) * 10 # keep this so we only ever have 6 complete loops. This may not be necessary now?
|
||||||
while (datetime.datetime.now() - start) < datetime.timedelta(minutes=wait_for): # only wait 2 (default) minutes, then return.
|
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(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.
|
if movie_status != initial_status: # Something has changed. CPS must have processed this movie.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue