mirror of
https://github.com/scito/extract_otp_secret_keys.git
synced 2025-12-06 23:05:06 +01:00
fix compatibility for Python < 3.11
This commit is contained in:
parent
bda0186d10
commit
892f4f92ae
1 changed files with 4 additions and 1 deletions
|
|
@ -139,7 +139,10 @@ def get_payload_from_line(line, i, args):
|
||||||
print('\nWARN: line is not a otpauth-migration:// URL\ninput file: {}\nline "{}"\nProbably a wrong file was given'.format(args.infile, line))
|
print('\nWARN: line is not a otpauth-migration:// URL\ninput file: {}\nline "{}"\nProbably a wrong file was given'.format(args.infile, line))
|
||||||
parsed_url = urlparse(line)
|
parsed_url = urlparse(line)
|
||||||
if verbose > 1: print('\nDEBUG: parsed_url={}'.format(parsed_url))
|
if verbose > 1: print('\nDEBUG: parsed_url={}'.format(parsed_url))
|
||||||
params = parse_qs(parsed_url.query, strict_parsing=True)
|
try:
|
||||||
|
params = parse_qs(parsed_url.query, strict_parsing=True)
|
||||||
|
except: # Not necessary for Python >= 3.11
|
||||||
|
params = []
|
||||||
if verbose > 1: print('\nDEBUG: querystring params={}'.format(params))
|
if verbose > 1: print('\nDEBUG: querystring params={}'.format(params))
|
||||||
if 'data' not in params:
|
if 'data' not in params:
|
||||||
print('\nERROR: no data query parameter in input URL\ninput file: {}\nline "{}"\nProbably a wrong file was given'.format(args.infile, line))
|
print('\nERROR: no data query parameter in input URL\ninput file: {}\nline "{}"\nProbably a wrong file was given'.format(args.infile, line))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue