From: Vincent Le Gallic Date: Fri, 25 Mar 2016 14:06:00 +0000 (+0100) Subject: [rename_series] Better regexp detection of episode titles X-Git-Url: http://gitweb.pimeys.fr/?a=commitdiff_plain;h=ab7839b3a8293bfeb93c37d1b58e08ff80073d3f;p=scripts-20-100.git [rename_series] Better regexp detection of episode titles On ne récupère par les "chaînes en tre guillemet" au milieu d'un plot d'épisode --- diff --git a/rename_series.py b/rename_series.py index a6b89f8..4bc4c81 100755 --- a/rename_series.py +++ b/rename_series.py @@ -21,7 +21,7 @@ def get_titles(filename, debug=False, oneintwo=False): if oneintwo: # On enlève une ligne sur deux text = re.sub("(.*\n).*\n", r'\1', text) - titles = re.findall('"(.*)"', text) + titles = re.findall('^[0-9\s]+"(.*?)"', text, flags=re.MULTILINE) if debug: print "Titres :" pprint.pprint(titles)