Mercurial > codedump
comparison gendesc.py @ 128:1a83948b7f80
gendesc: only use fulltitle if available
author | Paper <paper@tflc.us> |
---|---|
date | Sun, 19 Oct 2025 22:46:55 -0400 |
parents | eac6dae753ca |
children |
comparison
equal
deleted
inserted
replaced
127:fd2ea604dcf2 | 128:1a83948b7f80 |
---|---|
2 import sys | 2 import sys |
3 import datetime | 3 import datetime |
4 | 4 |
5 with open(sys.argv[1]) as f: | 5 with open(sys.argv[1]) as f: |
6 data = json.load(f) | 6 data = json.load(f) |
7 print(data['fulltitle'] + " [{0}]".format(data["uploader"]), end="\n\n-----------------\n\n") | 7 title = data['title'] if not 'fulltitle' in data else data['fulltitle'] |
8 print(title + " [{0}]".format(data["uploader"]), end="\n\n-----------------\n\n") | |
8 upload_date = datetime.datetime(int(data["upload_date"][:-4]), int(data["upload_date"][4:][:-2]), int(data["upload_date"][6:])) | 9 upload_date = datetime.datetime(int(data["upload_date"][:-4]), int(data["upload_date"][4:][:-2]), int(data["upload_date"][6:])) |
9 print("Published on " + f"{upload_date.strftime('%b')} {upload_date.strftime('%d').strip('0')}, {upload_date.strftime('%Y')}", end="\n\n") | 10 print("Published on " + f"{upload_date.strftime('%b')} {upload_date.strftime('%d').strip('0')}, {upload_date.strftime('%Y')}", end="\n\n") |
10 print(data["description"]) | 11 print(data["description"]) |