From c07a83a5d9d55bc837653b8412d69bbe9b8cc1b1 Mon Sep 17 00:00:00 2001 From: polizz Date: Tue, 29 Dec 2020 14:20:20 -0600 Subject: [PATCH 1/7] Fix for satellites not moving --- VideoSort.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/VideoSort.py b/VideoSort.py index e108e48..9d3477a 100755 --- a/VideoSort.py +++ b/VideoSort.py @@ -475,10 +475,10 @@ def move_satellites(videofile, dest): if guess and 'subtitle_language' in guess: fbase = fbase[:fbase.rfind('.')] # Use alpha2 subtitle language from GuessIt (en, es, de, etc.) - subpart = '.' + guess['subtitle_language'][0].alpha2 + subpart = '.' + guess['subtitle_language'].alpha2 if verbose: if subpart != '': - print('Satellite: %s is a subtitle [%s]' % (filename, guess['subtitle_language'][0])) + print('Satellite: %s is a subtitle [%s]' % (filename, guess['subtitle_language'])) else: # English (or undetermined) print('Satellite: %s is a subtitle' % filename) @@ -489,7 +489,7 @@ def move_satellites(videofile, dest): if guess is not None: # Guess details are not important, just that there was a match fbase = base - if fbase.lower() == base.lower(): + if fbase.lower() != base.lower(): old = fpath new = destbasenm + subpart + fext if verbose: From f9c393ec1cdaf826f039b5e703a3ee579d0ee67f Mon Sep 17 00:00:00 2001 From: James Sumners Date: Fri, 22 Oct 2021 18:21:11 -0400 Subject: [PATCH 2/7] Fix silly Python 3.8 API change --- lib/babelfish/converters/__init__.py | 7 +++++-- lib/rebulk/match.py | 7 ++++++- lib/rebulk/utils.py | 5 ++++- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/lib/babelfish/converters/__init__.py b/lib/babelfish/converters/__init__.py index feb687b..5f85fe7 100644 --- a/lib/babelfish/converters/__init__.py +++ b/lib/babelfish/converters/__init__.py @@ -2,13 +2,16 @@ # Use of this source code is governed by the 3-clause BSD license # that can be found in the LICENSE file. # -import collections +try: + from collections.abc import MutableMapping +except ImportError: + from collections import MutableMapping from pkg_resources import iter_entry_points, EntryPoint from ..exceptions import LanguageConvertError, LanguageReverseError # from https://github.com/kennethreitz/requests/blob/master/requests/structures.py -class CaseInsensitiveDict(collections.MutableMapping): +class CaseInsensitiveDict(MutableMapping): """A case-insensitive ``dict``-like object. Implements all methods and operations of diff --git a/lib/rebulk/match.py b/lib/rebulk/match.py index a786df4..aeb75c0 100644 --- a/lib/rebulk/match.py +++ b/lib/rebulk/match.py @@ -5,7 +5,12 @@ """ import copy import itertools -from collections import defaultdict, MutableSequence +import collections +try: + from collections import defaultdict + from collections.abc import MutableSequence +except ImportError: + from collections import defaultdict, MutableSequence try: from collections import OrderedDict # pylint:disable=ungrouped-imports diff --git a/lib/rebulk/utils.py b/lib/rebulk/utils.py index 9aaf56d..f36338f 100644 --- a/lib/rebulk/utils.py +++ b/lib/rebulk/utils.py @@ -3,7 +3,10 @@ """ Various utilities functions """ -from collections import MutableSet +try: + from collections.abc import MutableSet +except ImportError: + from collections import MutablSet from types import GeneratorType From 37b2473cdd3f428b0252dbc1e80b0884a3b6eafe Mon Sep 17 00:00:00 2001 From: James Sumners Date: Sun, 7 Nov 2021 14:57:47 -0500 Subject: [PATCH 3/7] Fix another import --- lib/dateutil/parser.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/dateutil/parser.py b/lib/dateutil/parser.py index 8b6c2d2..aa15aed 100644 --- a/lib/dateutil/parser.py +++ b/lib/dateutil/parser.py @@ -9,6 +9,11 @@ import string import time import collections +try: + from collections.abc import Callable +except ImportError: + from collections import Callable + from io import StringIO from six import text_type, binary_type, integer_types @@ -311,9 +316,9 @@ def parse(self, timestr, default=None, ignoretz=False, tzinfos=None, if res.weekday is not None and not res.day: ret = ret+relativedelta.relativedelta(weekday=res.weekday) if not ignoretz: - if (isinstance(tzinfos, collections.Callable) or + if (isinstance(tzinfos, Callable) or tzinfos and res.tzname in tzinfos): - if isinstance(tzinfos, collections.Callable): + if isinstance(tzinfos, Callable): tzdata = tzinfos(res.tzname, res.tzoffset) else: tzdata = tzinfos.get(res.tzname) From 0aedd3e88024ee086ae7101732f12c63ccc2ef79 Mon Sep 17 00:00:00 2001 From: James Sumners Date: Tue, 21 Feb 2023 18:14:32 -0500 Subject: [PATCH 4/7] Fix more Python nonsense Fix lifted from https://github.com/lmfit/lmfit-py/commit/13a14b289ac358fb8c32072162d65c7a3c2af264 --- lib/rebulk/loose.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/rebulk/loose.py b/lib/rebulk/loose.py index 72543b1..5977d64 100644 --- a/lib/rebulk/loose.py +++ b/lib/rebulk/loose.py @@ -63,7 +63,7 @@ def function_args(callable_, *args, **kwargs): :return: (args, kwargs) matching the function signature :rtype: tuple """ - argspec = inspect.getargspec(callable_) # pylint:disable=deprecated-method + argspec = inspect.getfullargspec(callable_) return argspec_args(argspec, False, *args, **kwargs) @@ -80,7 +80,7 @@ def constructor_args(class_, *args, **kwargs): :return: (args, kwargs) matching the function signature :rtype: tuple """ - argspec = inspect.getargspec(_constructor(class_)) # pylint:disable=deprecated-method + argspec = inspect.getfullargspec(_constructor(class_)) return argspec_args(argspec, True, *args, **kwargs) @@ -99,7 +99,7 @@ def argspec_args(argspec, constructor, *args, **kwargs): :return: (args, kwargs) matching the function signature :rtype: tuple """ - if argspec.keywords: + if argspec.varkw: call_kwarg = kwargs else: call_kwarg = dict((k, kwargs[k]) for k in kwargs if k in argspec.args) # Python 2.6 dict comprehension From ffe77b031265d11a3bfb9f525d76a65f127e25f9 Mon Sep 17 00:00:00 2001 From: James Sumners Date: Mon, 22 Jan 2024 15:26:08 -0500 Subject: [PATCH 5/7] Fix another import --- lib/pkg_resources.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pkg_resources.py b/lib/pkg_resources.py index 31736f4..fa4dce8 100755 --- a/lib/pkg_resources.py +++ b/lib/pkg_resources.py @@ -13,7 +13,7 @@ method. """ -import sys, os, zipimport, time, re, imp, types +import sys, os, zipimport, time, re, importlib, types #PY3: from urlparse import urlparse, urlunparse #PY3: From 5e8b7199c3e6cf5facffe2291386d56b227474f6 Mon Sep 17 00:00:00 2001 From: James Sumners Date: Sun, 22 Sep 2024 22:39:42 -0400 Subject: [PATCH 6/7] Fix broken regex --- VideoSort.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VideoSort.py b/VideoSort.py index 9d3477a..e5901ad 100755 --- a/VideoSort.py +++ b/VideoSort.py @@ -619,7 +619,7 @@ def get_titles(name, titleing=False): ''' #make valid filename - title = re.sub('[\"\:\?\*\\\/\<\>\|]', ' ', name) + title = re.sub('[\":\?\*\\\/\<\>\|]', ' ', name) if titleing: title = titler(title) # title the show name so it is in a consistant letter case From 8cadde2e3fc215a5588b33628885aec8e48cb22c Mon Sep 17 00:00:00 2001 From: James Sumners Date: Tue, 24 Dec 2024 17:00:58 -0500 Subject: [PATCH 7/7] Fix broken regex --- VideoSort.py | 6 +++--- yes | 7 +++++++ yes.pub | 1 + 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 yes create mode 100644 yes.pub diff --git a/VideoSort.py b/VideoSort.py index e5901ad..041fe4f 100755 --- a/VideoSort.py +++ b/VideoSort.py @@ -619,7 +619,7 @@ def get_titles(name, titleing=False): ''' #make valid filename - title = re.sub('[\":\?\*\\\/\<\>\|]', ' ', name) + title = re.sub(r'[\":\?\*\\\/\<\>\|]', ' ', name) if titleing: title = titler(title) # title the show name so it is in a consistant letter case @@ -1022,9 +1022,9 @@ def deobfuscate_path(filename): def remove_year(title): """ Removes year from series name (if exist) """ - m = re.compile('..*(\((19|20)\d\d\))').search(title) + m = re.compile(r'..*(\((19|20)\d\d\))').search(title) if not m: - m = re.compile('..*((19|20)\d\d)').search(title) + m = re.compile(r'..*((19|20)\d\d)').search(title) if m: if verbose: print('Removing year from series name') diff --git a/yes b/yes new file mode 100644 index 0000000..62c0c2a --- /dev/null +++ b/yes @@ -0,0 +1,7 @@ +-----BEGIN OPENSSH PRIVATE KEY----- +b3BlbnNzaC1rZXktdjEAAAAABG5vbmUAAAAEbm9uZQAAAAAAAAABAAAAMwAAAAtzc2gtZW +QyNTUxOQAAACDGd9M18gUDNdnkDqdTD8r7SiGdKKodTbSrjK36j2T52gAAAJCSuoA1krqA +NQAAAAtzc2gtZWQyNTUxOQAAACDGd9M18gUDNdnkDqdTD8r7SiGdKKodTbSrjK36j2T52g +AAAEChs6KJtZJUfOpKfsaZjGcKwo09Dz8bR7bNhFbSu4FRHcZ30zXyBQM12eQOp1MPyvtK +IZ0oqh1NtKuMrfqPZPnaAAAACWh0cGNAaHRwYwECAwQ= +-----END OPENSSH PRIVATE KEY----- diff --git a/yes.pub b/yes.pub new file mode 100644 index 0000000..0a097f7 --- /dev/null +++ b/yes.pub @@ -0,0 +1 @@ +ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMZ30zXyBQM12eQOp1MPyvtKIZ0oqh1NtKuMrfqPZPna htpc@htpc