From 8caf5a87273dfb38b53d4e5300f163cec7276132 Mon Sep 17 00:00:00 2001 From: axlt2002 Date: Mon, 16 Mar 2020 16:37:37 +0100 Subject: [PATCH] [scrapertools] regex update + small fix --- core/scrapertools.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/scrapertools.py b/core/scrapertools.py index c01fecac..e984484c 100644 --- a/core/scrapertools.py +++ b/core/scrapertools.py @@ -418,14 +418,14 @@ def get_season_and_episode(title): """ filename = "" - patrons = ["(\d+)x(\d+)", "(?:s|t)(\d+)e(\d+)", - "(?:season|temp\w*)\s*(\d+)\s*(?:capitulo|epi\w*)\s*(\d+)"] + patrons = ["(\d+)\s*[x-]\s*(\d+)", "(\d+)\s*×\s*(\d+)", "(?:[Ss]|[Tt])(\d+)(?:[Ee]|Ep\.)(\d+)", + "(?:[Ss]tag|[Ss]eason|[Ss]tagione\w*)\s*(\d+)\s*(?:[Ee]pi|[Ee]pisode|[Ee]pisodio\w*)\s*(\d+)"] for patron in patrons: try: matches = re.compile(patron, re.I).search(title) if matches: - filename = matches.group(1) + "x" + matches.group(2).zfill(2) + filename = str(int(matches.group(1))) + "x" + str(int(matches.group(2))).zfill(2) break except: pass