Skip to content

Commit

Permalink
Merge pull request #1 from signorrayan/main
Browse files Browse the repository at this point in the history
a bit improvements in the code
  • Loading branch information
adulau committed Nov 25, 2021
2 parents cb4bf2d + 3af0c60 commit e548f9a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bin/hashlookup-json-importer.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@
if args.verbose:
v = h.get_version()
print(f"hashlookup-lib version: {v}")


hashes = ['md5', 'sha-1', 'sha-256', 'sha-512', 'tlsh', 'ssdeep']
for line in sys.stdin:
hashes = ['md5', 'sha-1', 'sha-256', 'sha-512', 'tlsh', 'ssdeep']
record = json.loads(line)
for key in record.keys():
if key in hashes or key.lower() in hashes:
if key.lower() in hashes:
k = key.upper()
if record[key] == "":
continue
Expand All @@ -63,7 +63,7 @@
h.add_meta(key=key, value=record[key])
if args.parent is not None:
h.add_parent(value=args.parent)
if args.parent is not None and args.parent_meta is not None:
if (args.parent and args.parent_meta) is not None:
for pmeta in args.parent_meta:
k, v = pmeta.split(",")
h.add_parent_meta(value=args.parent, meta_key=k, meta_value=v)
Expand Down

0 comments on commit e548f9a

Please sign in to comment.