Update subgen.py

This commit is contained in:
McCloudS
2024-03-19 16:03:16 -06:00
committed by GitHub
parent bf7f6c0e16
commit c86a3be077

View File

@@ -76,7 +76,6 @@ in_docker = os.path.exists('/.dockerenv')
docker_status = "Docker" if in_docker else "Standalone" docker_status = "Docker" if in_docker else "Standalone"
last_print_time = None last_print_time = None
# Define a filter class # Define a filter class
class MultiplePatternsFilter(logging.Filter): class MultiplePatternsFilter(logging.Filter):
def filter(self, record): def filter(self, record):
@@ -90,6 +89,11 @@ class MultiplePatternsFilter(logging.Filter):
"released on ", "released on ",
"Attempting to acquire", "Attempting to acquire",
"acquired on", "acquired on",
"header parsing failed",
"timescale not set",
"misdetection possible",
"srt was added",
"doesn't have any audio to transcribe",
] ]
# Return False if any of the patterns are found, True otherwise # Return False if any of the patterns are found, True otherwise
return not any(pattern in record.getMessage() for pattern in patterns) return not any(pattern in record.getMessage() for pattern in patterns)