This commit is contained in:
Kovid Goyal 2024-06-30 16:12:41 +05:30
commit 9f10c93890
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -18,6 +18,12 @@ def resize(x):
if '_750' in k:
return v
m_fr = {
1: 'janvier', 2: 'février', 3: 'mars', 4: 'avril',
5: 'mai', 6: 'juin', 7: 'juillet', 8: 'août',
9: 'septembre', 10: 'octobre', 11: 'novembre', 12: 'décembre'
}
def json_to_html(raw):
data = json.loads(raw)
@ -26,7 +32,7 @@ def json_to_html(raw):
auth = '<p class="auth">{}</p>\n'
dt = datetime.fromisoformat(data['last_updated_date'][:-1]) + timedelta(seconds=time.timezone)
dt = dt.strftime('%b %d, %Y, %H:%M')
dt = dt.strftime('%d ' + m_fr[dt.month] + ' %Y')
a = [x['name'] for x in data['credits']['by']]
if a:
auth = auth.format(', '.join(a) + ' | ' + dt)