]> git.llucax.com Git - software/subdivxget.git/commitdiff
Group subtitle extensions in a variable
authorLeandro Lucarella <luca@llucax.com.ar>
Sat, 14 Jul 2012 18:08:36 +0000 (20:08 +0200)
committerLeandro Lucarella <luca@llucax.com.ar>
Sat, 14 Jul 2012 18:12:54 +0000 (20:12 +0200)
subdivxget

index ae79cde813d65ece9e591c2973104e3565c1d613..954b80a641a5e11cc3ce017eb4ecf87e7e1b9d64 100755 (executable)
@@ -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