mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-08-21 05:43:16 -07:00
Merge branch 'nightly' into dev
This commit is contained in:
commit
8c8ea0f6fe
8 changed files with 52 additions and 44 deletions
|
@ -1,5 +1,5 @@
|
||||||
[bumpversion]
|
[bumpversion]
|
||||||
current_version = 12.1.05
|
current_version = 12.1.06
|
||||||
commit = True
|
commit = True
|
||||||
tag = False
|
tag = False
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ from core.utils import (
|
||||||
wake_up,
|
wake_up,
|
||||||
)
|
)
|
||||||
|
|
||||||
__version__ = '12.1.05'
|
__version__ = '12.1.06'
|
||||||
|
|
||||||
# Client Agents
|
# Client Agents
|
||||||
NZB_CLIENTS = ['sabnzbd', 'nzbget', 'manual']
|
NZB_CLIENTS = ['sabnzbd', 'nzbget', 'manual']
|
||||||
|
@ -113,12 +113,12 @@ FORKS = {
|
||||||
FORK_FAILED_TORRENT: {'dir': None, 'failed': None, 'process_method': None},
|
FORK_FAILED_TORRENT: {'dir': None, 'failed': None, 'process_method': None},
|
||||||
FORK_SICKRAGE: {'proc_dir': None, 'failed': None, 'process_method': None, 'force': None, 'delete_on': None},
|
FORK_SICKRAGE: {'proc_dir': None, 'failed': None, 'process_method': None, 'force': None, 'delete_on': None},
|
||||||
FORK_SICKCHILL: {'proc_dir': None, 'failed': None, 'process_method': None, 'force': None, 'delete_on': None, 'force_next': None},
|
FORK_SICKCHILL: {'proc_dir': None, 'failed': None, 'process_method': None, 'force': None, 'delete_on': None, 'force_next': None},
|
||||||
FORK_SICKCHILL_API: {'path': None, 'failed': None, 'process_method': None, 'force_replace': None, 'return_data': None, 'type': None, 'delete': None, 'force_next': None, 'is_priority': None},
|
FORK_SICKCHILL_API: {'path': None, 'failed': None, 'process_method': None, 'force_replace': None, 'return_data': None, 'type': None, 'delete': None, 'force_next': None, 'is_priority': None, 'cmd': 'postprocess'},
|
||||||
FORK_SICKBEARD_API: {'path': None, 'failed': None, 'process_method': None, 'force_replace': None, 'return_data': None, 'type': None, 'delete': None, 'force_next': None},
|
FORK_SICKBEARD_API: {'path': None, 'failed': None, 'process_method': None, 'force_replace': None, 'return_data': None, 'type': None, 'delete': None, 'force_next': None, 'cmd': 'postprocess'},
|
||||||
FORK_MEDUSA: {'proc_dir': None, 'failed': None, 'process_method': None, 'force': None, 'delete_on': None, 'ignore_subs': None},
|
FORK_MEDUSA: {'proc_dir': None, 'failed': None, 'process_method': None, 'force': None, 'delete_on': None, 'ignore_subs': None},
|
||||||
FORK_MEDUSA_API: {'path': None, 'failed': None, 'process_method': None, 'force_replace': None, 'return_data': None, 'type': None, 'delete_files': None, 'is_priority': None},
|
FORK_MEDUSA_API: {'path': None, 'failed': None, 'process_method': None, 'force_replace': None, 'return_data': None, 'type': None, 'delete_files': None, 'is_priority': None, 'cmd': 'postprocess'},
|
||||||
FORK_SICKGEAR: {'dir': None, 'failed': None, 'process_method': None, 'force': None},
|
FORK_SICKGEAR: {'dir': None, 'failed': None, 'process_method': None, 'force': None},
|
||||||
FORK_SICKGEAR_API: {'path': None, 'process_method': None, 'force_replace': None, 'return_data': None, 'type': None, 'is priority': None},
|
FORK_SICKGEAR_API: {'path': None, 'process_method': None, 'force_replace': None, 'return_data': None, 'type': None, 'is priority': None, 'cmd': 'sg.postprocess'},
|
||||||
FORK_STHENO: {'proc_dir': None, 'failed': None, 'process_method': None, 'force': None, 'delete_on': None, 'ignore_subs': None},
|
FORK_STHENO: {'proc_dir': None, 'failed': None, 'process_method': None, 'force': None, 'delete_on': None, 'ignore_subs': None},
|
||||||
}
|
}
|
||||||
ALL_FORKS = {k: None for k in set(list(itertools.chain.from_iterable([FORKS[x].keys() for x in FORKS.keys()])))}
|
ALL_FORKS = {k: None for k in set(list(itertools.chain.from_iterable([FORKS[x].keys() for x in FORKS.keys()])))}
|
||||||
|
|
|
@ -200,7 +200,8 @@ def process(section, dir_name, input_name=None, failed=False, client_agent='manu
|
||||||
del fork_params['quiet']
|
del fork_params['quiet']
|
||||||
|
|
||||||
if param == 'type':
|
if param == 'type':
|
||||||
fork_params[param] = 'manual'
|
if 'type' in fork_params: # only set if we haven't already deleted for 'failed' above.
|
||||||
|
fork_params[param] = 'manual'
|
||||||
if 'proc_type' in fork_params:
|
if 'proc_type' in fork_params:
|
||||||
del fork_params['proc_type']
|
del fork_params['proc_type']
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
shutil.copyfile(core.CONFIG_SPEC_FILE, core.CONFIG_FILE)
|
shutil.copyfile(core.CONFIG_SPEC_FILE, core.CONFIG_FILE)
|
||||||
CFG_OLD = config(core.CONFIG_FILE)
|
CFG_OLD = config(core.CONFIG_FILE)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
logger.debug('Error {msg} when copying to .cfg'.format(msg=error))
|
logger.error('Error {msg} when copying to .cfg'.format(msg=error))
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# check for autoProcessMedia.cfg.spec and create if it does not exist
|
# check for autoProcessMedia.cfg.spec and create if it does not exist
|
||||||
|
@ -135,7 +135,7 @@ class ConfigObj(configobj.ConfigObj, Section):
|
||||||
shutil.copyfile(core.CONFIG_FILE, core.CONFIG_SPEC_FILE)
|
shutil.copyfile(core.CONFIG_FILE, core.CONFIG_SPEC_FILE)
|
||||||
CFG_NEW = config(core.CONFIG_SPEC_FILE)
|
CFG_NEW = config(core.CONFIG_SPEC_FILE)
|
||||||
except Exception as error:
|
except Exception as error:
|
||||||
logger.debug('Error {msg} when copying to .spec'.format(msg=error))
|
logger.error('Error {msg} when copying to .spec'.format(msg=error))
|
||||||
|
|
||||||
# check for autoProcessMedia.cfg and autoProcessMedia.cfg.spec and if they don't exist return and fail
|
# check for autoProcessMedia.cfg and autoProcessMedia.cfg.spec and if they don't exist return and fail
|
||||||
if CFG_NEW is None or CFG_OLD is None:
|
if CFG_NEW is None or CFG_OLD is None:
|
||||||
|
|
|
@ -41,6 +41,7 @@ def api_check(r, params, rem_params):
|
||||||
optional_parameters = json_data['optionalParameters'].keys()
|
optional_parameters = json_data['optionalParameters'].keys()
|
||||||
# Find excess parameters
|
# Find excess parameters
|
||||||
excess_parameters = set(params).difference(optional_parameters)
|
excess_parameters = set(params).difference(optional_parameters)
|
||||||
|
excess_parameters.remove('cmd') # Don't remove cmd from api params
|
||||||
logger.debug('Removing excess parameters: {}'.format(sorted(excess_parameters)))
|
logger.debug('Removing excess parameters: {}'.format(sorted(excess_parameters)))
|
||||||
rem_params.extend(excess_parameters)
|
rem_params.extend(excess_parameters)
|
||||||
return rem_params, True
|
return rem_params, True
|
||||||
|
@ -111,13 +112,15 @@ def auto_fork(section, input_category):
|
||||||
# then in order of most unique parameters.
|
# then in order of most unique parameters.
|
||||||
|
|
||||||
if apikey:
|
if apikey:
|
||||||
url = '{protocol}{host}:{port}{root}/api/{apikey}/?cmd=sg.postprocess&help=1'.format(
|
url = '{protocol}{host}:{port}{root}/api/{apikey}/'.format(
|
||||||
protocol=protocol, host=host, port=port, root=web_root, apikey=apikey,
|
protocol=protocol, host=host, port=port, root=web_root, apikey=apikey,
|
||||||
)
|
)
|
||||||
|
api_params = {'cmd': 'sg.postprocess', 'help': '1'}
|
||||||
else:
|
else:
|
||||||
url = '{protocol}{host}:{port}{root}/home/postprocess/'.format(
|
url = '{protocol}{host}:{port}{root}/home/postprocess/'.format(
|
||||||
protocol=protocol, host=host, port=port, root=web_root,
|
protocol=protocol, host=host, port=port, root=web_root,
|
||||||
)
|
)
|
||||||
|
api_params = {}
|
||||||
|
|
||||||
# attempting to auto-detect fork
|
# attempting to auto-detect fork
|
||||||
try:
|
try:
|
||||||
|
@ -130,7 +133,7 @@ def auto_fork(section, input_category):
|
||||||
if r.status_code in [401, 403] and r.cookies.get('_xsrf'):
|
if r.status_code in [401, 403] and r.cookies.get('_xsrf'):
|
||||||
login_params['_xsrf'] = r.cookies.get('_xsrf')
|
login_params['_xsrf'] = r.cookies.get('_xsrf')
|
||||||
s.post(login, data=login_params, stream=True, verify=False)
|
s.post(login, data=login_params, stream=True, verify=False)
|
||||||
r = s.get(url, auth=(username, password), verify=False)
|
r = s.get(url, auth=(username, password), params=api_params, verify=False)
|
||||||
except requests.ConnectionError:
|
except requests.ConnectionError:
|
||||||
logger.info('Could not connect to {section}:{category} to perform auto-fork detection!'.format
|
logger.info('Could not connect to {section}:{category} to perform auto-fork detection!'.format
|
||||||
(section=section, category=input_category))
|
(section=section, category=input_category))
|
||||||
|
@ -141,11 +144,9 @@ def auto_fork(section, input_category):
|
||||||
if found:
|
if found:
|
||||||
params['cmd'] = 'sg.postprocess'
|
params['cmd'] = 'sg.postprocess'
|
||||||
else: # try different api set for non-SickGear forks.
|
else: # try different api set for non-SickGear forks.
|
||||||
url = '{protocol}{host}:{port}{root}/api/{apikey}/?cmd=help&subject=postprocess'.format(
|
api_params = {'cmd': 'help', 'subject': 'postprocess'}
|
||||||
protocol=protocol, host=host, port=port, root=web_root, apikey=apikey,
|
|
||||||
)
|
|
||||||
try:
|
try:
|
||||||
r = s.get(url, auth=(username, password), verify=False)
|
r = s.get(url, auth=(username, password), params=api_params, verify=False)
|
||||||
except requests.ConnectionError:
|
except requests.ConnectionError:
|
||||||
logger.info('Could not connect to {section}:{category} to perform auto-fork detection!'.format
|
logger.info('Could not connect to {section}:{category} to perform auto-fork detection!'.format
|
||||||
(section=section, category=input_category))
|
(section=section, category=input_category))
|
||||||
|
|
|
@ -102,8 +102,8 @@
|
||||||
|
|
||||||
# Niceness for external tasks Extractor and Transcoder.
|
# Niceness for external tasks Extractor and Transcoder.
|
||||||
#
|
#
|
||||||
# Set the Niceness value for the nice command. These range from -20 (most favorable to the process) to 19 (least favorable to the process).
|
# Set the Niceness value for the nice command. These range from -20 (most favorable to the process) to 19 (least favorable to the process).
|
||||||
# If entering an integer e.g 'niceness=4', this is added to the nice command and passed as 'nice -n4' (Default).
|
# If entering an integer e.g 'niceness=4', this is added to the nice command and passed as 'nice -n4' (Default).
|
||||||
# If entering a comma separated list e.g. 'niceness=nice,4' this will be passed as 'nice 4' (Safer).
|
# If entering a comma separated list e.g. 'niceness=nice,4' this will be passed as 'nice 4' (Safer).
|
||||||
#niceness=nice,-n0
|
#niceness=nice,-n0
|
||||||
|
|
||||||
|
@ -208,22 +208,25 @@
|
||||||
# ffmpeg output settings.
|
# ffmpeg output settings.
|
||||||
#outputVideoExtension=.mp4
|
#outputVideoExtension=.mp4
|
||||||
#outputVideoCodec=libx264
|
#outputVideoCodec=libx264
|
||||||
#VideoCodecAllow =
|
#VideoCodecAllow=
|
||||||
#outputVideoResolution=720:-1
|
#outputVideoResolution=720:-1
|
||||||
#outputVideoPreset=medium
|
#outputVideoPreset=medium
|
||||||
#outputVideoFramerate=24
|
#outputVideoFramerate=24
|
||||||
#outputVideoBitrate=800k
|
#outputVideoBitrate=800k
|
||||||
#outputAudioCodec=libmp3lame
|
#outputAudioCodec=ac3
|
||||||
#AudioCodecAllow =
|
#AudioCodecAllow=
|
||||||
#outputAudioBitrate=128k
|
#outputAudioChannels=6
|
||||||
#outputQualityPercent = 0
|
#outputAudioBitrate=640k
|
||||||
#outputAudioTrack2Codec = libfaac
|
#outputQualityPercent=
|
||||||
#AudioCodec2Allow =
|
#outputAudioTrack2Codec=libfaac
|
||||||
#outputAudioTrack2Bitrate = 128k
|
#AudioCodec2Allow=
|
||||||
#outputAudioOtherCodec = libmp3lame
|
#outputAudioTrack2Channels=2
|
||||||
#AudioOtherCodecAllow =
|
#outputAudioTrack2Bitrate=160k
|
||||||
#outputAudioOtherBitrate = 128k
|
#outputAudioOtherCodec=libmp3lame
|
||||||
#outputSubtitleCodec =
|
#AudioOtherCodecAllow=
|
||||||
|
#outputAudioOtherChannels=2
|
||||||
|
#outputAudioOtherBitrate=128k
|
||||||
|
#outputSubtitleCodec=
|
||||||
|
|
||||||
## WakeOnLan
|
## WakeOnLan
|
||||||
|
|
||||||
|
|
|
@ -107,8 +107,8 @@
|
||||||
|
|
||||||
# Niceness for external tasks Extractor and Transcoder.
|
# Niceness for external tasks Extractor and Transcoder.
|
||||||
#
|
#
|
||||||
# Set the Niceness value for the nice command. These range from -20 (most favorable to the process) to 19 (least favorable to the process).
|
# Set the Niceness value for the nice command. These range from -20 (most favorable to the process) to 19 (least favorable to the process).
|
||||||
# If entering an integer e.g 'niceness=4', this is added to the nice command and passed as 'nice -n4' (Default).
|
# If entering an integer e.g 'niceness=4', this is added to the nice command and passed as 'nice -n4' (Default).
|
||||||
# If entering a comma separated list e.g. 'niceness=nice,4' this will be passed as 'nice 4' (Safer).
|
# If entering a comma separated list e.g. 'niceness=nice,4' this will be passed as 'nice 4' (Safer).
|
||||||
#niceness=nice,-n0
|
#niceness=nice,-n0
|
||||||
|
|
||||||
|
@ -213,22 +213,25 @@
|
||||||
# ffmpeg output settings.
|
# ffmpeg output settings.
|
||||||
#outputVideoExtension=.mp4
|
#outputVideoExtension=.mp4
|
||||||
#outputVideoCodec=libx264
|
#outputVideoCodec=libx264
|
||||||
#VideoCodecAllow =
|
#VideoCodecAllow=
|
||||||
#outputVideoResolution=720:-1
|
#outputVideoResolution=720:-1
|
||||||
#outputVideoPreset=medium
|
#outputVideoPreset=medium
|
||||||
#outputVideoFramerate=24
|
#outputVideoFramerate=24
|
||||||
#outputVideoBitrate=800k
|
#outputVideoBitrate=800k
|
||||||
#outputAudioCodec=libmp3lame
|
#outputAudioCodec=ac3
|
||||||
#AudioCodecAllow =
|
#AudioCodecAllow=
|
||||||
#outputAudioBitrate=128k
|
#outputAudioChannels=6
|
||||||
#outputQualityPercent = 0
|
#outputAudioBitrate=640k
|
||||||
#outputAudioTrack2Codec = libfaac
|
#outputQualityPercent=
|
||||||
#AudioCodec2Allow =
|
#outputAudioTrack2Codec=libfaac
|
||||||
#outputAudioTrack2Bitrate = 128k
|
#AudioCodec2Allow=
|
||||||
#outputAudioOtherCodec = libmp3lame
|
#outputAudioTrack2Channels=2
|
||||||
#AudioOtherCodecAllow =
|
#outputAudioTrack2Bitrate=160k
|
||||||
#outputAudioOtherBitrate = 128k
|
#outputAudioOtherCodec=libmp3lame
|
||||||
#outputSubtitleCodec =
|
#AudioOtherCodecAllow=
|
||||||
|
#outputAudioOtherChannels=2
|
||||||
|
#outputAudioOtherBitrate=128k
|
||||||
|
#outputSubtitleCodec=
|
||||||
|
|
||||||
## WakeOnLan
|
## WakeOnLan
|
||||||
|
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -23,7 +23,7 @@ def read(*names, **kwargs):
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
name='nzbToMedia',
|
name='nzbToMedia',
|
||||||
version='12.1.05',
|
version='12.1.06',
|
||||||
license='GPLv3',
|
license='GPLv3',
|
||||||
description='Efficient on demand post processing',
|
description='Efficient on demand post processing',
|
||||||
long_description="""
|
long_description="""
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue