Skip to content

Commit

Permalink
add minimal metadata to key files
Browse files Browse the repository at this point in the history
  • Loading branch information
hannob committed Jul 25, 2024
1 parent e2938d1 commit 09626e2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion keyfinder
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/python3

import argparse
import datetime
import hashlib
import os
import re
Expand Down Expand Up @@ -136,10 +137,12 @@ if __name__ == "__main__":
if args.url:
for url in args.input:
host = urllib.parse.urlparse(url).netloc
today = datetime.datetime.now(tz=datetime.timezone.utc).date().isoformat()
meta = f"url: {url}\ndate: {today}\n\n"
r = requests.get(url, timeout=60)
keys = findkeys(r.content)
for k in keys:
writekey(k, host, args.outdir)
writekey(meta + k, host, args.outdir)
sys.exit(0)

for path in args.input:
Expand Down

0 comments on commit 09626e2

Please sign in to comment.