From: Leandro Lucarella Date: Sat, 14 Jul 2012 18:08:36 +0000 (+0200) Subject: Group subtitle extensions in a variable X-Git-Url: https://git.llucax.com/software/subdivxget.git/commitdiff_plain/24b7c11c0eaeb895bf4c4c1b16572160aa529d9d Group subtitle extensions in a variable --- 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