add orjson and *.json to gitignore

This commit is contained in:
L1ghtn1ng 2021-05-31 23:35:48 +01:00
parent 2a9e0a11dd
commit 59686d3dd5
2 changed files with 4 additions and 3 deletions

1
.gitignore vendored
View file

@ -5,6 +5,7 @@
*.htm
*.vscode
*.xml
*.json
debug_results.txt
venv
.mypy_cache

View file

@ -9,7 +9,7 @@
from theHarvester.lib.core import *
import argparse
import asyncio
import json
import orjson
import netaddr
import re
import sys
@ -828,8 +828,8 @@ async def handler(lst):
shodanalysis = sorted(set(shodanalysis))
shodan_dict["servers"] = [server for server in shodanalysis]
json_dict["shodan"] = shodan_dict
with open(filename, 'w+') as json_file:
json.dump(json_dict, json_file, indent=4)
with open(filename, 'wb+') as fp:
fp.write(orjson.dumps(json_dict, option=orjson.OPT_SORT_KEYS))
print('[*] JSON File saved.')
except Exception as error:
print(f'\033[93m[!] An error occurred while saving the JSON file: {error} \033[0m')