Mercurial > codedump
diff gendesc.py @ 118:eac6dae753ca
*: major cleanup
committer: GitHub <noreply@github.com>
author | Paper <37962225+mrpapersonic@users.noreply.github.com> |
---|---|
date | Fri, 03 Mar 2023 22:51:28 +0000 |
parents | getdate.py@1508aee998df |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gendesc.py Fri Mar 03 22:51:28 2023 +0000 @@ -0,0 +1,10 @@ +import json +import sys +import datetime + +with open(sys.argv[1]) as f: + data = json.load(f) + print(data['fulltitle'] + " [{0}]".format(data["uploader"]), end="\n\n-----------------\n\n") + upload_date = datetime.datetime(int(data["upload_date"][:-4]), int(data["upload_date"][4:][:-2]), int(data["upload_date"][6:])) + print("Published on " + f"{upload_date.strftime('%b')} {upload_date.strftime('%d').strip('0')}, {upload_date.strftime('%Y')}", end="\n\n") + print(data["description"])