mirror of
https://github.com/SickGear/SickGear.git
synced 2025-01-07 10:33:38 +00:00
Fixed mediaToSickBeard issues
This commit is contained in:
parent
4cf5dc0fba
commit
4e7710797a
2 changed files with 2 additions and 8 deletions
|
@ -1,14 +1,10 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python2
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import ConfigParser
|
import ConfigParser
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
#Needed for importing logging & requests module
|
|
||||||
from sickbeard.exceptions import ex
|
|
||||||
|
|
||||||
sickbeardPath = os.path.split(os.path.split(sys.argv[0])[0])[0]
|
sickbeardPath = os.path.split(os.path.split(sys.argv[0])[0])[0]
|
||||||
sys.path.append(os.path.join( sickbeardPath, 'lib'))
|
sys.path.append(os.path.join( sickbeardPath, 'lib'))
|
||||||
sys.path.append(sickbeardPath)
|
sys.path.append(sickbeardPath)
|
||||||
|
@ -37,6 +33,7 @@ logdirsetting = config.get("General", "log_dir") if config.get("General", "log_d
|
||||||
logdir = os.path.normpath(os.path.join(sickbeardPath, logdirsetting))
|
logdir = os.path.normpath(os.path.join(sickbeardPath, logdirsetting))
|
||||||
logfile = os.path.join(logdir, 'sickbeard.log')
|
logfile = os.path.join(logdir, 'sickbeard.log')
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
handler = logging.FileHandler(logfile)
|
handler = logging.FileHandler(logfile)
|
||||||
except:
|
except:
|
||||||
|
@ -48,7 +45,6 @@ handler.setFormatter(formatter)
|
||||||
scriptlogger.addHandler(handler)
|
scriptlogger.addHandler(handler)
|
||||||
scriptlogger.setLevel(logging.DEBUG)
|
scriptlogger.setLevel(logging.DEBUG)
|
||||||
|
|
||||||
|
|
||||||
def utorrent():
|
def utorrent():
|
||||||
# print 'Calling utorrent'
|
# print 'Calling utorrent'
|
||||||
if len(sys.argv) < 2:
|
if len(sys.argv) < 2:
|
||||||
|
@ -128,7 +124,6 @@ def blackhole():
|
||||||
# return (dirName, nzbName)
|
# return (dirName, nzbName)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
||||||
scriptlogger.info(u'Starting external PostProcess script ' + __file__)
|
scriptlogger.info(u'Starting external PostProcess script ' + __file__)
|
||||||
|
|
||||||
host = config.get("General", "web_host")
|
host = config.get("General", "web_host")
|
||||||
|
@ -202,7 +197,7 @@ def main():
|
||||||
try:
|
try:
|
||||||
response = requests.get(url, auth=(username, password), params=params, verify=False)
|
response = requests.get(url, auth=(username, password), params=params, verify=False)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
scriptlogger.error(u': Unknown exception raised when opening url: ' + ex(e))
|
scriptlogger.error(u': Unknown exception raised when opening url: ' + str(e))
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,6 @@
|
||||||
|
|
||||||
from sickbeard.encodingKludge import fixStupidEncodings
|
from sickbeard.encodingKludge import fixStupidEncodings
|
||||||
|
|
||||||
|
|
||||||
def ex(e):
|
def ex(e):
|
||||||
"""
|
"""
|
||||||
Returns a unicode string from the exception text if it exists.
|
Returns a unicode string from the exception text if it exists.
|
||||||
|
|
Loading…
Reference in a new issue