mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-20 05:13:16 -07:00
Fixed bugs in torrenttomedia
This commit is contained in:
parent
d93eb866d7
commit
964e3c09fc
2 changed files with 29 additions and 9 deletions
|
@ -39,15 +39,27 @@ def main(inputDirectory, inputName, inputCategory, inputHash, inputID):
|
||||||
utorrentClass = ""
|
utorrentClass = ""
|
||||||
TransmissionClass = ""
|
TransmissionClass = ""
|
||||||
|
|
||||||
# init autoFork
|
|
||||||
fork, fork_params = autoFork(inputCategory)
|
|
||||||
|
|
||||||
Logger.debug("MAIN: Received Directory: %s | Name: %s | Category: %s", inputDirectory, inputName, inputCategory)
|
Logger.debug("MAIN: Received Directory: %s | Name: %s | Category: %s", inputDirectory, inputName, inputCategory)
|
||||||
|
|
||||||
inputDirectory, inputName, inputCategory, root = category_search(inputDirectory, inputName, inputCategory, root, categories) # Confirm the category by parsing directory structure
|
inputDirectory, inputName, inputCategory, root = category_search(inputDirectory, inputName, inputCategory, root, categories) # Confirm the category by parsing directory structure
|
||||||
|
|
||||||
Logger.debug("MAIN: Determined Directory: %s | Name: %s | Category: %s", inputDirectory, inputName, inputCategory)
|
Logger.debug("MAIN: Determined Directory: %s | Name: %s | Category: %s", inputDirectory, inputName, inputCategory)
|
||||||
|
|
||||||
|
# init autoFork
|
||||||
|
if inputCategory in sbCategory:
|
||||||
|
fork, fork_params = autoFork("SickBeard")
|
||||||
|
elif inputCategory in cpsCategory:
|
||||||
|
fork, fork_params = autoFork("CouchPotato")
|
||||||
|
elif inputCategory in hpCategory:
|
||||||
|
fork, fork_params = autoFork("HeadPhones")
|
||||||
|
elif inputCategory in gzCategory:
|
||||||
|
fork, fork_params = autoFork("Gamez")
|
||||||
|
elif inputCategory in mlCategory:
|
||||||
|
fork, fork_params = autoFork("Mylar")
|
||||||
|
else:
|
||||||
|
fork = config.FORKS.items()[config.FORKS.keys().index(config.FORK_DEFAULT)][0]
|
||||||
|
fork_params = config.FORKS.items()[config.FORKS.keys().index(config.FORK_DEFAULT)][0]
|
||||||
|
|
||||||
if inputCategory in sbCategory:
|
if inputCategory in sbCategory:
|
||||||
if fork in config.SICKBEARD_TORRENT and Torrent_ForceLink != 1:
|
if fork in config.SICKBEARD_TORRENT and Torrent_ForceLink != 1:
|
||||||
Logger.info("MAIN: Calling SickBeard's %s branch to post-process: %s",fork ,inputName)
|
Logger.info("MAIN: Calling SickBeard's %s branch to post-process: %s",fork ,inputName)
|
||||||
|
@ -511,10 +523,10 @@ if __name__ == "__main__":
|
||||||
Logger.debug("arg %s is: %s", n, arg)
|
Logger.debug("arg %s is: %s", n, arg)
|
||||||
n = n+1
|
n = n+1
|
||||||
|
|
||||||
if not len(sys.argv) > 1:
|
try:
|
||||||
|
inputDirectory, inputName, inputCategory, inputHash, inputID = parse_args(clientAgent)
|
||||||
|
except:
|
||||||
Logger.exception("MAIN: There was a problem loading variables")
|
Logger.exception("MAIN: There was a problem loading variables")
|
||||||
sys.exit(-1)
|
sys.exit(-1)
|
||||||
|
|
||||||
# process torrent
|
|
||||||
inputDirectory, inputName, inputCategory, inputHash, inputID = parse_args(clientAgent)
|
|
||||||
main(inputDirectory, inputName, inputCategory, inputHash, inputID)
|
main(inputDirectory, inputName, inputCategory, inputHash, inputID)
|
||||||
|
|
|
@ -10,8 +10,13 @@ def autoFork(section):
|
||||||
# config settings
|
# config settings
|
||||||
host = config().get(section, "host")
|
host = config().get(section, "host")
|
||||||
port = config().get(section, "port")
|
port = config().get(section, "port")
|
||||||
username = config().get(section, "username")
|
|
||||||
password = config().get(section, "password")
|
try:
|
||||||
|
username = config().get(section, "username")
|
||||||
|
password = config().get(section, "password")
|
||||||
|
except:
|
||||||
|
username = None
|
||||||
|
password = None
|
||||||
|
|
||||||
try:
|
try:
|
||||||
ssl = int(config().get(section, "ssl"))
|
ssl = int(config().get(section, "ssl"))
|
||||||
|
@ -41,7 +46,10 @@ def autoFork(section):
|
||||||
|
|
||||||
# attempting to auto-detect fork
|
# attempting to auto-detect fork
|
||||||
try:
|
try:
|
||||||
r = requests.get(url, auth=(username, password))
|
if username and password:
|
||||||
|
r = requests.get(url, auth=(username, password))
|
||||||
|
else:
|
||||||
|
r = requests.get(url)
|
||||||
except requests.ConnectionError:
|
except requests.ConnectionError:
|
||||||
Logger.info("Could not connect to SickBeard to perform auto-fork detection!")
|
Logger.info("Could not connect to SickBeard to perform auto-fork detection!")
|
||||||
break
|
break
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue