mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 22:03:13 -07:00
Merge remote-tracking branch 'clinton-hall/nightly'
This commit is contained in:
commit
72ed27da42
6 changed files with 74 additions and 31 deletions
|
@ -97,7 +97,12 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
|
||||||
if clientAgent != 'manual':
|
if clientAgent != 'manual':
|
||||||
core.pause_torrent(clientAgent, inputHash, inputID, inputName)
|
core.pause_torrent(clientAgent, inputHash, inputID, inputName)
|
||||||
|
|
||||||
if uniquePath:
|
# Incase input is not directory, make sure to create one.
|
||||||
|
# This way Processing is isolated.
|
||||||
|
if not os.path.isdir(os.path.join(inputDirectory, inputName)):
|
||||||
|
basename = os.path.splitext(core.sanitizeName(inputName))[0]
|
||||||
|
outputDestination = os.path.join(core.OUTPUTDIRECTORY, inputCategory, basename)
|
||||||
|
elif uniquePath:
|
||||||
outputDestination = os.path.normpath(
|
outputDestination = os.path.normpath(
|
||||||
core.os.path.join(core.OUTPUTDIRECTORY, inputCategory, core.sanitizeName(inputName)))
|
core.os.path.join(core.OUTPUTDIRECTORY, inputCategory, core.sanitizeName(inputName)))
|
||||||
else:
|
else:
|
||||||
|
@ -197,6 +202,9 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
|
||||||
|
|
||||||
logger.info("Calling %s:%s to post-process:%s" % (sectionName, usercat, inputName))
|
logger.info("Calling %s:%s to post-process:%s" % (sectionName, usercat, inputName))
|
||||||
|
|
||||||
|
if core.TORRENT_CHMOD_DIRECTORY:
|
||||||
|
core.rchmod(outputDestination, core.TORRENT_CHMOD_DIRECTORY)
|
||||||
|
|
||||||
result = [ 0, "" ]
|
result = [ 0, "" ]
|
||||||
if sectionName == 'UserScript':
|
if sectionName == 'UserScript':
|
||||||
result = external_script(outputDestination, inputName, inputCategory, section[usercat])
|
result = external_script(outputDestination, inputName, inputCategory, section[usercat])
|
||||||
|
@ -220,7 +228,9 @@ def processTorrent(inputDirectory, inputName, inputCategory, inputHash, inputID,
|
||||||
plex_update(inputCategory)
|
plex_update(inputCategory)
|
||||||
|
|
||||||
if result[0] != 0:
|
if result[0] != 0:
|
||||||
if clientAgent != 'manual':
|
if not core.TORRENT_RESUME_ON_FAILURE:
|
||||||
|
logger.error("A problem was reported in the autoProcess* script. torrent won't resume seeding (settings)")
|
||||||
|
elif clientAgent != 'manual':
|
||||||
logger.error(
|
logger.error(
|
||||||
"A problem was reported in the autoProcess* script. If torrent was paused we will resume seeding")
|
"A problem was reported in the autoProcess* script. If torrent was paused we will resume seeding")
|
||||||
core.resume_torrent(clientAgent, inputHash, inputID, inputName)
|
core.resume_torrent(clientAgent, inputHash, inputID, inputName)
|
||||||
|
|
|
@ -57,7 +57,7 @@
|
||||||
extract = 1
|
extract = 1
|
||||||
# Set this to minimum required size to consider a media file valid (in MB)
|
# Set this to minimum required size to consider a media file valid (in MB)
|
||||||
minSize = 0
|
minSize = 0
|
||||||
# Enable/Disable deleteing ignored files (samples and invalid media files)
|
# Enable/Disable deleting ignored files (samples and invalid media files)
|
||||||
delete_ignored = 0
|
delete_ignored = 0
|
||||||
##### Enable if Couchpotato is on a remote server for this category
|
##### Enable if Couchpotato is on a remote server for this category
|
||||||
remote_path = 0
|
remote_path = 0
|
||||||
|
@ -83,11 +83,13 @@
|
||||||
process_method =
|
process_method =
|
||||||
# force processing of already processed content when running a manual scan.
|
# force processing of already processed content when running a manual scan.
|
||||||
force = 0
|
force = 0
|
||||||
|
# tell SickRage to delete all source files after processing.
|
||||||
|
delete_on = 0
|
||||||
extract = 1
|
extract = 1
|
||||||
nzbExtractionBy = Downloader
|
nzbExtractionBy = Downloader
|
||||||
# Set this to minimum required size to consider a media file valid (in MB)
|
# Set this to minimum required size to consider a media file valid (in MB)
|
||||||
minSize = 0
|
minSize = 0
|
||||||
# Enable/Disable deleteing ignored files (samples and invalid media files)
|
# Enable/Disable deleting ignored files (samples and invalid media files)
|
||||||
delete_ignored = 0
|
delete_ignored = 0
|
||||||
##### Enable if SickBeard is on a remote server for this category
|
##### Enable if SickBeard is on a remote server for this category
|
||||||
remote_path = 0
|
remote_path = 0
|
||||||
|
@ -115,7 +117,7 @@
|
||||||
wait_for = 2
|
wait_for = 2
|
||||||
# Set this to minimum required size to consider a media file valid (in MB)
|
# Set this to minimum required size to consider a media file valid (in MB)
|
||||||
minSize = 0
|
minSize = 0
|
||||||
# Enable/Disable deleteing ignored files (samples and invalid media files)
|
# Enable/Disable deleting ignored files (samples and invalid media files)
|
||||||
delete_ignored = 0
|
delete_ignored = 0
|
||||||
##### Enable if NzbDrone is on a remote server for this category
|
##### Enable if NzbDrone is on a remote server for this category
|
||||||
remote_path = 0
|
remote_path = 0
|
||||||
|
@ -139,7 +141,7 @@
|
||||||
extract = 1
|
extract = 1
|
||||||
# Set this to minimum required size to consider a media file valid (in MB)
|
# Set this to minimum required size to consider a media file valid (in MB)
|
||||||
minSize = 0
|
minSize = 0
|
||||||
# Enable/Disable deleteing ignored files (samples and invalid media files)
|
# Enable/Disable deleting ignored files (samples and invalid media files)
|
||||||
delete_ignored = 0
|
delete_ignored = 0
|
||||||
##### Enable if HeadPhones is on a remote server for this category
|
##### Enable if HeadPhones is on a remote server for this category
|
||||||
remote_path = 0
|
remote_path = 0
|
||||||
|
@ -163,7 +165,7 @@
|
||||||
extract = 1
|
extract = 1
|
||||||
# Set this to minimum required size to consider a media file valid (in MB)
|
# Set this to minimum required size to consider a media file valid (in MB)
|
||||||
minSize = 0
|
minSize = 0
|
||||||
# Enable/Disable deleteing ignored files (samples and invalid media files)
|
# Enable/Disable deleting ignored files (samples and invalid media files)
|
||||||
delete_ignored = 0
|
delete_ignored = 0
|
||||||
##### Enable if Mylar is on a remote server for this category
|
##### Enable if Mylar is on a remote server for this category
|
||||||
remote_path = 0
|
remote_path = 0
|
||||||
|
@ -188,7 +190,7 @@
|
||||||
extract = 1
|
extract = 1
|
||||||
# Set this to minimum required size to consider a media file valid (in MB)
|
# Set this to minimum required size to consider a media file valid (in MB)
|
||||||
minSize = 0
|
minSize = 0
|
||||||
# Enable/Disable deleteing ignored files (samples and invalid media files)
|
# Enable/Disable deleting ignored files (samples and invalid media files)
|
||||||
delete_ignored = 0
|
delete_ignored = 0
|
||||||
##### Enable if Gamez is on a remote server for this category
|
##### Enable if Gamez is on a remote server for this category
|
||||||
remote_path = 0
|
remote_path = 0
|
||||||
|
@ -204,7 +206,7 @@
|
||||||
###### clientAgent - Supported clients: sabnzbd, nzbget
|
###### clientAgent - Supported clients: sabnzbd, nzbget
|
||||||
clientAgent = sabnzbd
|
clientAgent = sabnzbd
|
||||||
###### SabNZBD (You must edit this if your using nzbToMedia.py with SabNZBD)
|
###### SabNZBD (You must edit this if your using nzbToMedia.py with SabNZBD)
|
||||||
sabnzbd_host = localhost
|
sabnzbd_host = http://localhost
|
||||||
sabnzbd_port = 8080
|
sabnzbd_port = 8080
|
||||||
sabnzbd_apikey =
|
sabnzbd_apikey =
|
||||||
###### Enter the default path to your default download directory (non-category downloads). this directory is protected by safe_mode.
|
###### Enter the default path to your default download directory (non-category downloads). this directory is protected by safe_mode.
|
||||||
|
@ -239,6 +241,8 @@
|
||||||
DelugePWD = your password
|
DelugePWD = your password
|
||||||
###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ######
|
###### ADVANCED USE - ONLY EDIT IF YOU KNOW WHAT YOU'RE DOING ######
|
||||||
deleteOriginal = 0
|
deleteOriginal = 0
|
||||||
|
chmodDirecotry = 0
|
||||||
|
resumeOnFailure = 1
|
||||||
|
|
||||||
[Extensions]
|
[Extensions]
|
||||||
compressedExtensions = .zip,.rar,.7z,.gz,.bz,.tar,.arj,.1,.01,.001
|
compressedExtensions = .zip,.rar,.7z,.gz,.bz,.tar,.arj,.1,.01,.001
|
||||||
|
@ -262,10 +266,11 @@
|
||||||
subLanguages = eng,spa,fra
|
subLanguages = eng,spa,fra
|
||||||
# transcode. enable to use transcoder
|
# transcode. enable to use transcoder
|
||||||
transcode = 0
|
transcode = 0
|
||||||
###### duplicate =1 will cretae a new file. =0 will replace the original
|
###### duplicate =1 will create a new file. =0 will replace the original
|
||||||
duplicate = 1
|
duplicate = 1
|
||||||
# concat. joins cd1 cd2 etc into a single video.
|
# concat. joins cd1 cd2 etc into a single video.
|
||||||
concat = 1
|
concat = 1
|
||||||
|
# IgnoreExtensions is a comma-separated list of extensions that will not be transcoded.
|
||||||
ignoreExtensions = .avi,.mkv,.mp4
|
ignoreExtensions = .avi,.mkv,.mp4
|
||||||
# outputFastStart. 1 will use -movflags + faststart. 0 will disable this from being used.
|
# outputFastStart. 1 will use -movflags + faststart. 0 will disable this from being used.
|
||||||
outputFastStart = 0
|
outputFastStart = 0
|
||||||
|
@ -279,9 +284,9 @@
|
||||||
audioLanguage = eng
|
audioLanguage = eng
|
||||||
# allAudioLanguages. 1 will keep all audio tracks (uses AudioCodec3) where available.
|
# allAudioLanguages. 1 will keep all audio tracks (uses AudioCodec3) where available.
|
||||||
allAudioLanguages = 0
|
allAudioLanguages = 0
|
||||||
# allSubLanguages. 1 will keep all exisiting sub languages. 0 will discare those not in your list above.
|
# allSubLanguages. 1 will keep all existing sub languages. 0 will discard those not in your list above.
|
||||||
allSubLanguages = 0
|
allSubLanguages = 0
|
||||||
# embedSubs. 1 will embded external sub/srt subs into your video if this is supported.
|
# embedSubs. 1 will embed external sub/srt subs into your video if this is supported.
|
||||||
embedSubs = 1
|
embedSubs = 1
|
||||||
# burnInSubtitle. burns the default sub language into your video (needed for players that don't support subs)
|
# burnInSubtitle. burns the default sub language into your video (needed for players that don't support subs)
|
||||||
burnInSubtitle = 0
|
burnInSubtitle = 0
|
||||||
|
@ -347,7 +352,7 @@
|
||||||
#for example FP,FN,DN, TN, TL for file path (absolute file name with path), file name, absolute directory name (with path), Torrent Name, Torrent Label/Category.
|
#for example FP,FN,DN, TN, TL for file path (absolute file name with path), file name, absolute directory name (with path), Torrent Name, Torrent Label/Category.
|
||||||
#So the result is /media/test/script/script.sh FP FN DN TN TL. Add other arguments as needed eg -f, -r
|
#So the result is /media/test/script/script.sh FP FN DN TN TL. Add other arguments as needed eg -f, -r
|
||||||
user_script_param = FN
|
user_script_param = FN
|
||||||
#Set user_script_runOnce = 0 to run for each file, or 1 to only run once (presumably on teh entire directory).
|
#Set user_script_runOnce = 0 to run for each file, or 1 to only run once (presumably on the entire directory).
|
||||||
user_script_runOnce = 0
|
user_script_runOnce = 0
|
||||||
#Specify the successcodes returned by the user script as a comma separated list. Linux default is 0
|
#Specify the successcodes returned by the user script as a comma separated list. Linux default is 0
|
||||||
user_script_successCodes = 0
|
user_script_successCodes = 0
|
||||||
|
@ -371,5 +376,5 @@
|
||||||
[Custom]
|
[Custom]
|
||||||
# enter a list (comma separated) of Group Tags you want removed from filenames to help with subtitle matching.
|
# enter a list (comma separated) of Group Tags you want removed from filenames to help with subtitle matching.
|
||||||
# e.g remove_group = [rarbag],-NZBgeek
|
# e.g remove_group = [rarbag],-NZBgeek
|
||||||
# be careful if your "group" is a common "real" word. Please report if you have any group replacments that would fall in this category.
|
# be careful if your "group" is a common "real" word. Please report if you have any group replacements that would fall in this category.
|
||||||
remove_group =
|
remove_group =
|
||||||
|
|
|
@ -56,8 +56,8 @@ FORK_SICKRAGE = "sickrage"
|
||||||
FORKS[FORK_DEFAULT] = {"dir": None}
|
FORKS[FORK_DEFAULT] = {"dir": None}
|
||||||
FORKS[FORK_FAILED] = {"dirName": None, "failed": None}
|
FORKS[FORK_FAILED] = {"dirName": None, "failed": None}
|
||||||
FORKS[FORK_FAILED_TORRENT] = {"dir": None, "failed": None, "process_method": None}
|
FORKS[FORK_FAILED_TORRENT] = {"dir": None, "failed": None, "process_method": None}
|
||||||
FORKS[FORK_SICKRAGE] = {"dir": None, "failed": None, "process_method": None, "force": None}
|
FORKS[FORK_SICKRAGE] = {"dir": None, "failed": None, "process_method": None, "force": None, "delete_on": None}
|
||||||
ALL_FORKS = {"dir": None, "dirName": None, "failed": None, "process_method": None, "force": None}
|
ALL_FORKS = {"dir": None, "dirName": None, "failed": None, "process_method": None, "force": None, "delete_on": None}
|
||||||
SICKBEARD_FAILED = [FORK_FAILED, FORK_FAILED_TORRENT, FORK_SICKRAGE]
|
SICKBEARD_FAILED = [FORK_FAILED, FORK_FAILED_TORRENT, FORK_SICKRAGE]
|
||||||
SICKBEARD_TORRENT = [FORK_FAILED_TORRENT, FORK_SICKRAGE]
|
SICKBEARD_TORRENT = [FORK_FAILED_TORRENT, FORK_SICKRAGE]
|
||||||
|
|
||||||
|
@ -98,7 +98,9 @@ USELINK = None
|
||||||
OUTPUTDIRECTORY = None
|
OUTPUTDIRECTORY = None
|
||||||
NOFLATTEN = []
|
NOFLATTEN = []
|
||||||
DELETE_ORIGINAL = None
|
DELETE_ORIGINAL = None
|
||||||
|
TORRENT_CHMOD_DIRECTORY = None
|
||||||
TORRENT_DEFAULTDIR = None
|
TORRENT_DEFAULTDIR = None
|
||||||
|
TORRENT_RESUME_ON_FAILURE = None
|
||||||
|
|
||||||
REMOTEPATHS = []
|
REMOTEPATHS = []
|
||||||
|
|
||||||
|
@ -210,9 +212,9 @@ def initialize(section=None):
|
||||||
ACODEC2, ACODEC2_ALLOW, ABITRATE2, ACODEC3, ACODEC3_ALLOW, ABITRATE3, ALLOWSUBS, SEXTRACT, SEMBED, SLANGUAGES, \
|
ACODEC2, ACODEC2_ALLOW, ABITRATE2, ACODEC3, ACODEC3_ALLOW, ABITRATE3, ALLOWSUBS, SEXTRACT, SEMBED, SLANGUAGES, \
|
||||||
SINCLUDE, SUBSDIR, SCODEC, OUTPUTFASTSTART, OUTPUTQUALITYPERCENT, BURN, GETSUBS, HWACCEL, LOG_DIR, LOG_FILE, \
|
SINCLUDE, SUBSDIR, SCODEC, OUTPUTFASTSTART, OUTPUTQUALITYPERCENT, BURN, GETSUBS, HWACCEL, LOG_DIR, LOG_FILE, \
|
||||||
NICENESS, LOG_DEBUG, FORCE_CLEAN, FFMPEG_PATH, FFMPEG, FFPROBE, AUDIOCONTAINER, EXTCONTAINER, TORRENT_CLASS, \
|
NICENESS, LOG_DEBUG, FORCE_CLEAN, FFMPEG_PATH, FFMPEG, FFPROBE, AUDIOCONTAINER, EXTCONTAINER, TORRENT_CLASS, \
|
||||||
DELETE_ORIGINAL, PASSWORDSFILE, USER_DELAY, USER_SCRIPT, USER_SCRIPT_CLEAN, USER_SCRIPT_MEDIAEXTENSIONS, \
|
DELETE_ORIGINAL, TORRENT_CHMOD_DIRECTORY, PASSWORDSFILE, USER_DELAY, USER_SCRIPT, USER_SCRIPT_CLEAN, USER_SCRIPT_MEDIAEXTENSIONS, \
|
||||||
USER_SCRIPT_PARAM, USER_SCRIPT_RUNONCE, USER_SCRIPT_SUCCESSCODES, DOWNLOADINFO, CHECK_MEDIA, SAFE_MODE, \
|
USER_SCRIPT_PARAM, USER_SCRIPT_RUNONCE, USER_SCRIPT_SUCCESSCODES, DOWNLOADINFO, CHECK_MEDIA, SAFE_MODE, \
|
||||||
TORRENT_DEFAULTDIR, NZB_DEFAULTDIR, REMOTEPATHS, LOG_ENV, PID_FILE, MYAPP, ACHANNELS, ACHANNELS2, ACHANNELS3, \
|
TORRENT_DEFAULTDIR, TORRENT_RESUME_ON_FAILURE, NZB_DEFAULTDIR, REMOTEPATHS, LOG_ENV, PID_FILE, MYAPP, ACHANNELS, ACHANNELS2, ACHANNELS3, \
|
||||||
PLEXSSL, PLEXHOST, PLEXPORT, PLEXTOKEN, PLEXSEC
|
PLEXSSL, PLEXHOST, PLEXPORT, PLEXTOKEN, PLEXSEC
|
||||||
|
|
||||||
if __INITIALIZED__:
|
if __INITIALIZED__:
|
||||||
|
@ -339,6 +341,8 @@ def initialize(section=None):
|
||||||
if isinstance(NOFLATTEN, str): NOFLATTEN = NOFLATTEN.split(',')
|
if isinstance(NOFLATTEN, str): NOFLATTEN = NOFLATTEN.split(',')
|
||||||
if isinstance(CATEGORIES, str): CATEGORIES = CATEGORIES.split(',')
|
if isinstance(CATEGORIES, str): CATEGORIES = CATEGORIES.split(',')
|
||||||
DELETE_ORIGINAL = int(CFG["Torrent"]["deleteOriginal"])
|
DELETE_ORIGINAL = int(CFG["Torrent"]["deleteOriginal"])
|
||||||
|
TORRENT_CHMOD_DIRECTORY = int(CFG["Torrent"]["chmodDirecotry"], 8)
|
||||||
|
TORRENT_RESUME_ON_FAILURE = int(CFG["Torrent"]["resumeOnFailure"])
|
||||||
UTORRENTWEBUI = CFG["Torrent"]["uTorrentWEBui"] # http://localhost:8090/gui/
|
UTORRENTWEBUI = CFG["Torrent"]["uTorrentWEBui"] # http://localhost:8090/gui/
|
||||||
UTORRENTUSR = CFG["Torrent"]["uTorrentUSR"] # mysecretusr
|
UTORRENTUSR = CFG["Torrent"]["uTorrentUSR"] # mysecretusr
|
||||||
UTORRENTPWD = CFG["Torrent"]["uTorrentPWD"] # mysecretpwr
|
UTORRENTPWD = CFG["Torrent"]["uTorrentPWD"] # mysecretpwr
|
||||||
|
@ -740,3 +744,15 @@ def restart():
|
||||||
status = p.returncode
|
status = p.returncode
|
||||||
|
|
||||||
os._exit(status)
|
os._exit(status)
|
||||||
|
|
||||||
|
def rchmod(path, mod):
|
||||||
|
logger.log("Changing file mode of %s to %s" % (path, oct(mod)))
|
||||||
|
os.chmod(path, mod)
|
||||||
|
if not os.path.isdir(path):
|
||||||
|
return # Skip files
|
||||||
|
|
||||||
|
for root, dirs, files in os.walk(path):
|
||||||
|
for d in dirs:
|
||||||
|
os.chmod(os.path.join(root, d), mod)
|
||||||
|
for f in files:
|
||||||
|
os.chmod(os.path.join(root, f), mod)
|
||||||
|
|
|
@ -104,6 +104,10 @@ class autoProcessTV:
|
||||||
force = int(core.CFG[section][inputCategory]["force"])
|
force = int(core.CFG[section][inputCategory]["force"])
|
||||||
except:
|
except:
|
||||||
force = 0
|
force = 0
|
||||||
|
try:
|
||||||
|
delete_on = int(core.CFG[section][inputCategory]["delete_on"])
|
||||||
|
except:
|
||||||
|
delete_on = 0
|
||||||
try:
|
try:
|
||||||
extract = int(section[inputCategory]["extract"])
|
extract = int(section[inputCategory]["extract"])
|
||||||
except:
|
except:
|
||||||
|
@ -211,6 +215,12 @@ class autoProcessTV:
|
||||||
else:
|
else:
|
||||||
del fork_params[param]
|
del fork_params[param]
|
||||||
|
|
||||||
|
if param == "delete_on":
|
||||||
|
if delete_on:
|
||||||
|
fork_params[param] = delete_on
|
||||||
|
else:
|
||||||
|
del fork_params[param]
|
||||||
|
|
||||||
# delete any unused params so we don't pass them to SB by mistake
|
# delete any unused params so we don't pass them to SB by mistake
|
||||||
[fork_params.pop(k) for k,v in fork_params.items() if v is None]
|
[fork_params.pop(k) for k,v in fork_params.items() if v is None]
|
||||||
|
|
||||||
|
|
|
@ -798,7 +798,10 @@ def find_download(clientAgent, download_id):
|
||||||
if clientAgent == 'deluge':
|
if clientAgent == 'deluge':
|
||||||
return False
|
return False
|
||||||
if clientAgent == 'sabnzbd':
|
if clientAgent == 'sabnzbd':
|
||||||
baseURL = "http://%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT)
|
if "http" in core.SABNZBDHOST:
|
||||||
|
baseURL = "%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT)
|
||||||
|
else:
|
||||||
|
baseURL = "http://%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT)
|
||||||
url = baseURL
|
url = baseURL
|
||||||
params = {}
|
params = {}
|
||||||
params['apikey'] = core.SABNZBDAPIKEY
|
params['apikey'] = core.SABNZBDAPIKEY
|
||||||
|
@ -819,7 +822,10 @@ def find_download(clientAgent, download_id):
|
||||||
def get_nzoid(inputName):
|
def get_nzoid(inputName):
|
||||||
nzoid = None
|
nzoid = None
|
||||||
logger.debug("Searching for nzoid from SAbnzbd ...")
|
logger.debug("Searching for nzoid from SAbnzbd ...")
|
||||||
baseURL = "http://%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT)
|
if "http" in core.SABNZBDHOST:
|
||||||
|
baseURL = "%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT)
|
||||||
|
else:
|
||||||
|
baseURL = "http://%s:%s/api" % (core.SABNZBDHOST, core.SABNZBDPORT)
|
||||||
url = baseURL
|
url = baseURL
|
||||||
params = {}
|
params = {}
|
||||||
params['apikey'] = core.SABNZBDAPIKEY
|
params['apikey'] = core.SABNZBDAPIKEY
|
||||||
|
@ -1057,7 +1063,7 @@ def server_responding(baseURL):
|
||||||
|
|
||||||
def plex_update(category):
|
def plex_update(category):
|
||||||
if core.PLEXSSL:
|
if core.PLEXSSL:
|
||||||
ulr = 'https://'
|
url = 'https://'
|
||||||
else:
|
else:
|
||||||
url = 'http://'
|
url = 'http://'
|
||||||
url = url + core.PLEXHOST + ':' + core.PLEXPORT + '/library/sections/'
|
url = url + core.PLEXHOST + ':' + core.PLEXPORT + '/library/sections/'
|
||||||
|
|
|
@ -277,8 +277,6 @@ def buildCommands(file, newDir, movieName, bitbucket):
|
||||||
audio_cmd.extend(['-c:a:' + str(used_audio), core.ACODEC])
|
audio_cmd.extend(['-c:a:' + str(used_audio), core.ACODEC])
|
||||||
else:
|
else:
|
||||||
audio_cmd.extend(['-c:a:' + str(used_audio), 'copy'])
|
audio_cmd.extend(['-c:a:' + str(used_audio), 'copy'])
|
||||||
if core.ACODEC == 'aac':
|
|
||||||
audio_cmd.extend(['-strict', '-2'])
|
|
||||||
elif audio3: # just pick the default audio track
|
elif audio3: # just pick the default audio track
|
||||||
map_cmd.extend(['-map', '0:' + str(audio3[0]["index"])])
|
map_cmd.extend(['-map', '0:' + str(audio3[0]["index"])])
|
||||||
a_mapped.extend([audio3[0]["index"]])
|
a_mapped.extend([audio3[0]["index"]])
|
||||||
|
@ -292,8 +290,6 @@ def buildCommands(file, newDir, movieName, bitbucket):
|
||||||
audio_cmd.extend(['-c:a:' + str(used_audio), core.ACODEC])
|
audio_cmd.extend(['-c:a:' + str(used_audio), core.ACODEC])
|
||||||
else:
|
else:
|
||||||
audio_cmd.extend(['-c:a:' + str(used_audio), 'copy'])
|
audio_cmd.extend(['-c:a:' + str(used_audio), 'copy'])
|
||||||
if core.ACODEC == 'aac':
|
|
||||||
audio_cmd.extend(['-strict', '-2'])
|
|
||||||
|
|
||||||
if core.ACHANNELS and channels and channels > core.ACHANNELS:
|
if core.ACHANNELS and channels and channels > core.ACHANNELS:
|
||||||
audio_cmd.extend(['-ac:a:' + str(used_audio), str(core.ACHANNELS)])
|
audio_cmd.extend(['-ac:a:' + str(used_audio), str(core.ACHANNELS)])
|
||||||
|
@ -307,6 +303,8 @@ def buildCommands(file, newDir, movieName, bitbucket):
|
||||||
audio_cmd.extend(['-q:a:' + str(used_audio), str(core.OUTPUTQUALITYPERCENT)])
|
audio_cmd.extend(['-q:a:' + str(used_audio), str(core.OUTPUTQUALITYPERCENT)])
|
||||||
if audio_cmd[1] == 'copy':
|
if audio_cmd[1] == 'copy':
|
||||||
audio_cmd[1] = core.ACODEC
|
audio_cmd[1] = core.ACODEC
|
||||||
|
if audio_cmd[1] == 'aac':
|
||||||
|
audio_cmd[2:2] = ['-strict', '-2']
|
||||||
|
|
||||||
if core.ACODEC2_ALLOW:
|
if core.ACODEC2_ALLOW:
|
||||||
used_audio += 1
|
used_audio += 1
|
||||||
|
@ -334,8 +332,6 @@ def buildCommands(file, newDir, movieName, bitbucket):
|
||||||
audio_cmd2.extend(['-c:a:' + str(used_audio), core.ACODEC2])
|
audio_cmd2.extend(['-c:a:' + str(used_audio), core.ACODEC2])
|
||||||
else:
|
else:
|
||||||
audio_cmd2.extend(['-c:a:' + str(used_audio), 'copy'])
|
audio_cmd2.extend(['-c:a:' + str(used_audio), 'copy'])
|
||||||
if core.ACODEC2 == 'aac':
|
|
||||||
audio_cmd2.extend(['-strict', '-2'])
|
|
||||||
elif audio3: # just pick the default audio track
|
elif audio3: # just pick the default audio track
|
||||||
map_cmd.extend(['-map', '0:' + str(audio3[0]["index"])])
|
map_cmd.extend(['-map', '0:' + str(audio3[0]["index"])])
|
||||||
a_mapped.extend([audio3[0]["index"]])
|
a_mapped.extend([audio3[0]["index"]])
|
||||||
|
@ -349,8 +345,6 @@ def buildCommands(file, newDir, movieName, bitbucket):
|
||||||
audio_cmd2.extend(['-c:a:' + str(used_audio), core.ACODEC2])
|
audio_cmd2.extend(['-c:a:' + str(used_audio), core.ACODEC2])
|
||||||
else:
|
else:
|
||||||
audio_cmd2.extend(['-c:a:' + str(used_audio), 'copy'])
|
audio_cmd2.extend(['-c:a:' + str(used_audio), 'copy'])
|
||||||
if core.ACODEC2 == 'aac':
|
|
||||||
audio_cmd2.extend(['-strict', '-2'])
|
|
||||||
|
|
||||||
if core.ACHANNELS2 and channels and channels > core.ACHANNELS2:
|
if core.ACHANNELS2 and channels and channels > core.ACHANNELS2:
|
||||||
audio_cmd2.extend(['-ac:a:' + str(used_audio), str(core.ACHANNELS2)])
|
audio_cmd2.extend(['-ac:a:' + str(used_audio), str(core.ACHANNELS2)])
|
||||||
|
@ -364,6 +358,8 @@ def buildCommands(file, newDir, movieName, bitbucket):
|
||||||
audio_cmd2.extend(['-q:a:' + str(used_audio), str(core.OUTPUTQUALITYPERCENT)])
|
audio_cmd2.extend(['-q:a:' + str(used_audio), str(core.OUTPUTQUALITYPERCENT)])
|
||||||
if audio_cmd2[1] == 'copy':
|
if audio_cmd2[1] == 'copy':
|
||||||
audio_cmd2[1] = core.ACODEC2
|
audio_cmd2[1] = core.ACODEC2
|
||||||
|
if audio_cmd2[1] == 'aac':
|
||||||
|
audio_cmd2[2:2] = ['-strict', '-2']
|
||||||
audio_cmd.extend(audio_cmd2)
|
audio_cmd.extend(audio_cmd2)
|
||||||
|
|
||||||
if core.AINCLUDE and audio3 and core.ACODEC3:
|
if core.AINCLUDE and audio3 and core.ACODEC3:
|
||||||
|
@ -386,8 +382,6 @@ def buildCommands(file, newDir, movieName, bitbucket):
|
||||||
audio_cmd3.extend(['-c:a:' + str(used_audio), core.ACODEC3])
|
audio_cmd3.extend(['-c:a:' + str(used_audio), core.ACODEC3])
|
||||||
else:
|
else:
|
||||||
audio_cmd3.extend(['-c:a:' + str(used_audio), 'copy'])
|
audio_cmd3.extend(['-c:a:' + str(used_audio), 'copy'])
|
||||||
if core.ACODEC3 == 'aac':
|
|
||||||
audio_cmd3.extend(['-strict', '-2'])
|
|
||||||
|
|
||||||
if core.ACHANNELS3 and channels and channels > core.ACHANNELS3:
|
if core.ACHANNELS3 and channels and channels > core.ACHANNELS3:
|
||||||
audio_cmd3.extend(['-ac:a:' + str(used_audio), str(core.ACHANNELS3)])
|
audio_cmd3.extend(['-ac:a:' + str(used_audio), str(core.ACHANNELS3)])
|
||||||
|
@ -401,6 +395,8 @@ def buildCommands(file, newDir, movieName, bitbucket):
|
||||||
audio_cmd3.extend(['-q:a:' + str(used_audio), str(core.OUTPUTQUALITYPERCENT)])
|
audio_cmd3.extend(['-q:a:' + str(used_audio), str(core.OUTPUTQUALITYPERCENT)])
|
||||||
if audio_cmd3[1] == 'copy':
|
if audio_cmd3[1] == 'copy':
|
||||||
audio_cmd3[1] = core.ACODEC3
|
audio_cmd3[1] = core.ACODEC3
|
||||||
|
if audio_cmd3[1] == 'aac':
|
||||||
|
audio_cmd3[2:2] = ['-strict', '-2']
|
||||||
audio_cmd.extend(audio_cmd3)
|
audio_cmd.extend(audio_cmd3)
|
||||||
|
|
||||||
s_mapped = []
|
s_mapped = []
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue