captcha(-old).py: Fix undefined variables and remove some unused ones

Change-Id: I13b46cceb68a0118274a1fe9d3547b193f62b53d
This commit is contained in:
Reedy 2024-01-15 19:05:27 +00:00
parent 11213652b6
commit 1a305a40ee
2 changed files with 3 additions and 7 deletions

View file

@ -203,10 +203,10 @@ def run_in_thread(object):
# 64 bits of hash is plenty for this purpose
md5hash = hashlib.md5((key+salt+word+key+salt).encode('utf-8')).hexdigest()[:16]
filename = "image_%s_%s.png" % (salt, md5hash)
if dirs:
if opts.dirs:
subdir = gen_subdir(output, md5hash, dirs)
filename = os.path.join(subdir, filename)
if verbose:
if opts.verbose:
print(filename)
gen_captcha(word, font, fontsize, os.path.join(output, filename))
@ -261,8 +261,6 @@ if __name__ == '__main__':
badwordlist = read_wordlist(opts.blacklist) + read_wordlist(opts.badwordlist)
count = opts.count
fill = opts.fill
dirs = opts.dirs
verbose = opts.verbose
fontsize = opts.font_size
threads = opts.threads

View file

@ -210,7 +210,7 @@ def run_in_thread(object):
# 64 bits of hash is plenty for this purpose
md5hash = hashlib.md5((key+salt+word+key+salt).encode('utf-8')).hexdigest()[:16]
filename = "image_%s_%s.png" % (salt, md5hash)
if dirs:
if opts.dirs:
subdir = gen_subdir(output, md5hash, dirs)
filename = os.path.join(subdir, filename)
if opts.verbose:
@ -268,8 +268,6 @@ if __name__ == '__main__':
badwordlist = read_wordlist(opts.blacklist) + read_wordlist(opts.badwordlist)
count = opts.count
fill = opts.fill
dirs = opts.dirs
verbose = opts.verbose
fontsize = opts.font_size
threads = opts.threads