checksums

This commit is contained in:
mwiegand 2022-04-10 21:45:55 +02:00
parent f146708b7c
commit 57a17342ed

View file

@ -91,6 +91,7 @@ import pytz
import re
from urllib.parse import urlparse
import requests
from hashlib import sha3_256
pdt = pytz.timezone("Us/Pacific")
@ -103,7 +104,10 @@ def parse_trs(trs):
to_name = tds[1].text
date = datetime.strptime(tds[2].text, '%b %d, %Y @ %I:%M%p PDT').replace(tzinfo=pdt)
text = tds[3].text
print(f'({date}) {from_name} -> {to_name}: {text}')
checksum = sha3_256(
(from_url + to_url + str(date.timestamp()) + text).encode()
).hexdigest()
print(f'(#{checksum}@{date}) {from_name} -> {to_name}: {text}')
# download steamuserimages
for url_string in re.findall(r'(https?://\S+)', text):