From 24b7c11c0eaeb895bf4c4c1b16572160aa529d9d Mon Sep 17 00:00:00 2001 From: Leandro Lucarella Date: Sat, 14 Jul 2012 20:08:36 +0200 Subject: [PATCH] Group subtitle extensions in a variable --- subdivxget | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/subdivxget b/subdivxget index ae79cde..954b80a 100755 --- a/subdivxget +++ b/subdivxget @@ -206,6 +206,7 @@ def subdivx_get_subs(query_str): def get_subs(query_str, filters): + sub_exts = ('.srt', '.sub') zip_exts = ('application/zip',) rar_exts = ('application/rar', 'application/x-rar-compressed') @@ -225,7 +226,7 @@ def get_subs(query_str, filters): z = zipfile.ZipFile(fname, 'r') z.printdir() for fn in z.namelist(): - if fn.endswith('.srt') or fn.endswith('.sub'): + if fn.endswith(sub_exts): if '..' in fn or fn.startswith('/'): print('Dangerous file name:', fn) continue -- 2.43.0