in scripts/project-page.py [0:0]
def fetch_cve(cve_id):
print(cve_id)
if not os.path.exists('cache/%s.json' % cve_id):
f = urlopen('https://cveprocess.apache.org/publicjson/%s' % cve_id)
with open('cache/%s.json' % cve_id, 'w') as d:
d.write(f.read().decode('utf-8'))
with open('cache/%s.json' % cve_id, 'r') as d:
cve = json.loads(d.read())
if 'containers' in cve.keys():
return cve
else:
if not os.path.exists('cache-converted/%s.json' % cve_id):
subprocess.run(['cve4to5up.py', '-i', 'cache/%s.json' % cve_id, '-o' 'cache-converted/'])
with open('cache-converted/%s.json' % cve_id, 'r') as d:
cve = json.loads(d.read())
return cve