mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-19 12:59:36 -07:00
Added better logging for failed downloads when processing failed movies
This commit is contained in:
parent
a96bbeea5e
commit
0589a7e3ee
1 changed files with 13 additions and 13 deletions
|
@ -225,6 +225,10 @@ class autoProcessMovie:
|
||||||
else:
|
else:
|
||||||
logger.postprocess("Download of %s has failed.", nzbName)
|
logger.postprocess("Download of %s has failed.", nzbName)
|
||||||
|
|
||||||
|
if delete_failed and not os.path.dirname(dirName) == dirName:
|
||||||
|
logger.postprocess("Deleting failed files and folder %s", dirName)
|
||||||
|
delete(dirName)
|
||||||
|
|
||||||
if not download_id:
|
if not download_id:
|
||||||
logger.warning("Cound not find a movie in the database for release %s", nzbName)
|
logger.warning("Cound not find a movie in the database for release %s", nzbName)
|
||||||
logger.warning("Please manually ignore this release and refresh the wanted movie")
|
logger.warning("Please manually ignore this release and refresh the wanted movie")
|
||||||
|
@ -247,29 +251,25 @@ class autoProcessMovie:
|
||||||
logger.postprocess("%s has been set to ignored on CouchPotato", nzbName)
|
logger.postprocess("%s has been set to ignored on CouchPotato", nzbName)
|
||||||
else:
|
else:
|
||||||
logger.warning("Failed to ignore %s on CouchPotato ...", nzbName)
|
logger.warning("Failed to ignore %s on CouchPotato ...", nzbName)
|
||||||
|
|
||||||
logger.postprocess("Snatching next highest ranked release on CouchPotato ...")
|
logger.postprocess("Snatching next highest ranked release on CouchPotato ...")
|
||||||
|
|
||||||
url = baseURL + "/movie.searcher.try_next"
|
url = baseURL + "/movie.searcher.try_next"
|
||||||
logger.debug("Opening URL: %s", url)
|
logger.debug("Opening URL: %s", url)
|
||||||
|
|
||||||
for line in r.iter_lines():
|
|
||||||
if line: logger.postprocess("%s", line)
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
r = requests.get(url, params={'media_id':media_id}, stream=True)
|
r = requests.get(url, params={'media_id':media_id})
|
||||||
except requests.ConnectionError:
|
except requests.ConnectionError:
|
||||||
logger.error("Unable to open URL")
|
logger.error("Unable to open URL")
|
||||||
return 1 # failure
|
return 1 # failure
|
||||||
|
|
||||||
for line in r.iter_lines():
|
result = r.json()
|
||||||
if line: logger.postprocess("%s", line)
|
if result['success']:
|
||||||
|
logger.postprocess("CouchPotato successfully snatched the next highest release ...", nzbName)
|
||||||
logger.postprocess("%s FAILED!, Trying the next best release on CouchPotatoServer", nzbName)
|
return 0
|
||||||
if delete_failed and not os.path.dirname(dirName) == dirName:
|
else:
|
||||||
logger.postprocess("Deleting failed files and folder %s", dirName)
|
logger.postprocess("CouchPotato was unable to find a higher release then %s to snatch ...", nzbName)
|
||||||
delete(dirName)
|
return 1
|
||||||
return 0 # success
|
|
||||||
|
|
||||||
if not (download_id or media_id or release_id):
|
if not (download_id or media_id or release_id):
|
||||||
return 1
|
return 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue