From 95e4c70d9a85b4f1737bd5b272756d7efce2df64 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Tue, 9 Jul 2019 15:05:33 +1200 Subject: [PATCH 1/3] Set theme jekyll-theme-cayman --- _config.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 _config.yml diff --git a/_config.yml b/_config.yml new file mode 100644 index 00000000..c4192631 --- /dev/null +++ b/_config.yml @@ -0,0 +1 @@ +theme: jekyll-theme-cayman \ No newline at end of file From f92f8f3952c25d4c1d9158d2310ff14ab4371989 Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Wed, 23 Sep 2020 15:40:54 +1200 Subject: [PATCH 2/3] Add .gz support (#1781) #1715 --- core/extractor/__init__.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/core/extractor/__init__.py b/core/extractor/__init__.py index 44be3102..67501d92 100644 --- a/core/extractor/__init__.py +++ b/core/extractor/__init__.py @@ -28,11 +28,11 @@ def extract(file_path, output_destination): wscriptlocation = os.path.join(os.environ['WINDIR'], 'system32', 'wscript.exe') invislocation = os.path.join(core.APP_ROOT, 'core', 'extractor', 'bin', 'invisible.vbs') cmd_7zip = [wscriptlocation, invislocation, str(core.SHOWEXTRACT), core.SEVENZIP, 'x', '-y'] - ext_7zip = ['.rar', '.zip', '.tar.gz', 'tgz', '.tar.bz2', '.tbz', '.tar.lzma', '.tlz', '.7z', '.xz'] + ext_7zip = ['.rar', '.zip', '.tar.gz', 'tgz', '.tar.bz2', '.tbz', '.tar.lzma', '.tlz', '.7z', '.xz', '.gz'] extract_commands = dict.fromkeys(ext_7zip, cmd_7zip) # Using unix else: - required_cmds = ['unrar', 'unzip', 'tar', 'unxz', 'unlzma', '7zr', 'bunzip2'] + required_cmds = ['unrar', 'unzip', 'tar', 'unxz', 'unlzma', '7zr', 'bunzip2', 'gunzip'] # ## Possible future suport: # gunzip: gz (cmd will delete original archive) # ## the following do not extract to dest dir @@ -49,6 +49,7 @@ def extract(file_path, output_destination): '.tar.lzma': ['tar', '--lzma', '-xf'], '.tlz': ['tar', '--lzma', '-xf'], '.tar.xz': ['tar', '--xz', '-xf'], '.txz': ['tar', '--xz', '-xf'], '.7z': ['7zr', 'x'], + '.gz': ['gunzip'], } # Test command exists and if not, remove if not os.getenv('TR_TORRENT_DIR'): @@ -82,6 +83,8 @@ def extract(file_path, output_destination): # Check if this is a tar if os.path.splitext(ext[0])[1] == '.tar': cmd = extract_commands['.tar{ext}'.format(ext=ext[1])] + else: # Try gunzip + cmd = extract_commands[ext[1]] elif ext[1] in ('.1', '.01', '.001') and os.path.splitext(ext[0])[1] in ('.rar', '.zip', '.7z'): cmd = extract_commands[os.path.splitext(ext[0])[1]] elif ext[1] in ('.cb7', '.cba', '.cbr', '.cbt', '.cbz'): # don't extract these comic book archives. @@ -128,14 +131,15 @@ def extract(file_path, output_destination): else: cmd = core.NICENESS + cmd cmd2 = cmd - cmd2.append('-p-') # don't prompt for password. + if not 'gunzip' in cmd: #gunzip doesn't support password + cmd2.append('-p-') # don't prompt for password. p = Popen(cmd2, stdout=devnull, stderr=devnull, startupinfo=info) # should extract files fine. res = p.wait() if res == 0: # Both Linux and Windows return 0 for successful. core.logger.info('EXTRACTOR: Extraction was successful for {file} to {destination}'.format (file=file_path, destination=output_destination)) success = 1 - elif len(passwords) > 0: + elif len(passwords) > 0 and not 'gunzip' in cmd: core.logger.info('EXTRACTOR: Attempting to extract with passwords') for password in passwords: if password == '': # if edited in windows or otherwise if blank lines. From b9c3ccb71dbc591b5e1b6418ef249079fc93e8cf Mon Sep 17 00:00:00 2001 From: Clinton Hall Date: Wed, 23 Sep 2020 16:08:32 +1200 Subject: [PATCH 3/3] Merge Nightly (#1783) * Add Failed to SickGear fork detection (#1772) * Fix for failed passed as 2,3 from SAB (#1777) * Fix DB import (#1779) * Sqlite3.row handling fix * Fix import error in Python3 * make nzbToWatcher.py executable. #1780 * Update to V12.1.07 (#1782) --- .bumpversion.cfg | 2 +- TorrentToMedia.py | 6 +++--- core/__init__.py | 4 ++-- core/auto_process/tv.py | 2 ++ libs/custom/syno/auth.py | 6 +++--- nzbToMedia.py | 4 ++-- nzbToWatcher3.py | 0 setup.py | 2 +- 8 files changed, 14 insertions(+), 12 deletions(-) mode change 100644 => 100755 nzbToWatcher3.py diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 579736dd..891b8c0a 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 12.1.06 +current_version = 12.1.07 commit = True tag = False diff --git a/TorrentToMedia.py b/TorrentToMedia.py index 28f09d76..56a9b5a7 100755 --- a/TorrentToMedia.py +++ b/TorrentToMedia.py @@ -333,9 +333,9 @@ def main(args): (os.path.basename(dir_name))) core.DOWNLOAD_INFO = core.get_download_info(os.path.basename(dir_name), 0) if core.DOWNLOAD_INFO: - client_agent = text_type(core.DOWNLOAD_INFO[0].get('client_agent', 'manual')) - input_hash = text_type(core.DOWNLOAD_INFO[0].get('input_hash', '')) - input_id = text_type(core.DOWNLOAD_INFO[0].get('input_id', '')) + client_agent = text_type(core.DOWNLOAD_INFO[0]['client_agent']) or 'manual' + input_hash = text_type(core.DOWNLOAD_INFO[0]['input_hash']) or '' + input_id = text_type(core.DOWNLOAD_INFO[0]['input_id']) or '' logger.info('Found download info for {0}, ' 'setting variables now ...'.format(os.path.basename(dir_name))) else: diff --git a/core/__init__.py b/core/__init__.py index 04c9dbf5..aa644bca 100644 --- a/core/__init__.py +++ b/core/__init__.py @@ -83,7 +83,7 @@ from core.utils import ( wake_up, ) -__version__ = '12.1.06' +__version__ = '12.1.07' # Client Agents NZB_CLIENTS = ['sabnzbd', 'nzbget', 'manual'] @@ -118,7 +118,7 @@ FORKS = { 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, 'cmd': 'postprocess'}, 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, 'cmd': 'sg.postprocess'}, + FORK_SICKGEAR_API: {'path': None, 'process_method': None, 'force_replace': None, 'return_data': None, 'type': None, 'is priority': None, 'failed': None, 'cmd': 'sg.postprocess'}, 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()])))} diff --git a/core/auto_process/tv.py b/core/auto_process/tv.py index a06a1985..8d4d5654 100644 --- a/core/auto_process/tv.py +++ b/core/auto_process/tv.py @@ -188,6 +188,8 @@ def process(section, dir_name, input_name=None, failed=False, client_agent='manu for param in copy.copy(fork_params): if param == 'failed': + if failed > 1: + failed = 1 fork_params[param] = failed if 'proc_type' in fork_params: del fork_params['proc_type'] diff --git a/libs/custom/syno/auth.py b/libs/custom/syno/auth.py index ef8d2f8e..fb3a4927 100644 --- a/libs/custom/syno/auth.py +++ b/libs/custom/syno/auth.py @@ -97,7 +97,7 @@ class Authentication: req_param['_sid'] = self._sid - if method is 'get': + if method == 'get': url = ('%s%s' % (self._base_url, api_path)) + '?api=' + api_name response = requests.get(url, req_param) @@ -106,7 +106,7 @@ class Authentication: else: return response - elif method is 'post': + elif method == 'post': url = ('%s%s' % (self._base_url, api_path)) + '?api=' + api_name response = requests.post(url, req_param) @@ -121,4 +121,4 @@ class Authentication: @property def base_url(self): - return self._base_url \ No newline at end of file + return self._base_url diff --git a/nzbToMedia.py b/nzbToMedia.py index 485b2279..0cc0b796 100755 --- a/nzbToMedia.py +++ b/nzbToMedia.py @@ -1016,8 +1016,8 @@ def main(args, section=None): logger.info('Found download info for {0}, ' 'setting variables now ...'.format (os.path.basename(dir_name))) - client_agent = text_type(core.DOWNLOAD_INFO[0].get('client_agent', 'manual')) - download_id = text_type(core.DOWNLOAD_INFO[0].get('input_id', '')) + client_agent = text_type(core.DOWNLOAD_INFO[0]['client_agent']) or 'manual' + download_id = text_type(core.DOWNLOAD_INFO[0]['input_id']) or '' else: logger.info('Unable to locate download info for {0}, ' 'continuing to try and process this release ...'.format diff --git a/nzbToWatcher3.py b/nzbToWatcher3.py old mode 100644 new mode 100755 diff --git a/setup.py b/setup.py index 3de2a100..0ac63738 100644 --- a/setup.py +++ b/setup.py @@ -23,7 +23,7 @@ def read(*names, **kwargs): setup( name='nzbToMedia', - version='12.1.06', + version='12.1.07', license='GPLv3', description='Efficient on demand post processing', long_description="""