diff options
author | Jordan <me@jordan.im> | 2020-09-01 14:22:16 -0700 |
---|---|---|
committer | Jordan <me@jordan.im> | 2020-09-01 14:22:16 -0700 |
commit | 50eae99c1991295a4e32facea456d17e3c6a2c6c (patch) | |
tree | 92076646e00bd6932afb6fe67efe51e0ccf725cb | |
parent | 76cf205696a95e4e812936a6f5aa52f1fd5eb6fd (diff) | |
download | roka-50eae99c1991295a4e32facea456d17e3c6a2c6c.tar.gz roka-50eae99c1991295a4e32facea456d17e3c6a2c6c.zip |
satisfy RFC822 (XML pubDate)
-rw-r--r-- | lib/util.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/util.py b/lib/util.py index ac1c904..fbddb2e 100644 --- a/lib/util.py +++ b/lib/util.py @@ -153,7 +153,9 @@ def generate_rss(request, books): # pubDate descending, day decremented w/ each iteration pub_date = ET.SubElement(item, 'pubDate') - pub_date.text = (date(2000, 12, 31) - timedelta(days=idx)).ctime() + pub_format = '%a, %d %b %Y %H:%M:%S %z' + pub_date.text = (date(2000, 12, 31) - timedelta(days=idx)).strftime( + pub_format) enc_attr = { 'url': '{}?a={}&f={}'.format(request.base_url, book, f), 'length': str(books[book]['files'][f]['size_bytes']), |