strip N-bit color depth tags (singular and plural) from TMDb query

This commit is contained in:
Justin Oro
2026-08-24 22:03:54 -07:00
parent fd3b99ad65
commit 52da1eb8d0
+2
View File
@@ -794,11 +794,13 @@ IN_FORMAT_PATTERN = re.compile(r'\bin\s+(?:full\s+)?(?:hd|4k|uhd|sd)\b', re.IGNO
FILE_SIZE_PATTERN = re.compile(r'\b\d+(?:\.\d+)?\s?(?:MB|GB)\b', re.IGNORECASE) FILE_SIZE_PATTERN = re.compile(r'\b\d+(?:\.\d+)?\s?(?:MB|GB)\b', re.IGNORECASE)
BIT_DEPTH_PATTERN = re.compile(r'\b\d{1,2}bits?\b', re.IGNORECASE)
def strip_junk_tokens(text): def strip_junk_tokens(text):
text = re.sub(r'\b\d{3,4}p\b', ' ', text, flags=re.IGNORECASE) text = re.sub(r'\b\d{3,4}p\b', ' ', text, flags=re.IGNORECASE)
text = FILE_SIZE_PATTERN.sub(' ', text) text = FILE_SIZE_PATTERN.sub(' ', text)
text = BIT_DEPTH_PATTERN.sub(' ', text)
text = SEASON_RANGE_PATTERN.sub(' ', text) text = SEASON_RANGE_PATTERN.sub(' ', text)
text = IN_FORMAT_PATTERN.sub(' ', text) text = IN_FORMAT_PATTERN.sub(' ', text)
words = text.split() words = text.split()