From d4621a23a7a10378ac7eac94947e3ba78e6b41fe Mon Sep 17 00:00:00 2001 From: sharkykh Date: Sun, 14 May 2017 09:23:30 +0300 Subject: [PATCH] Add bare torrent hash lambda is probably not the best way to go, suggestions for improvement are welcome! --- nyaa/routes.py | 1 + nyaa/templates/rss.xml | 1 + 2 files changed, 2 insertions(+) diff --git a/nyaa/routes.py b/nyaa/routes.py index 48c8428..27d2dfb 100644 --- a/nyaa/routes.py +++ b/nyaa/routes.py @@ -303,6 +303,7 @@ def render_rss(label, query, use_elastic): use_elastic=use_elastic, term=label, site_url=flask.request.url_root, + compute_hash=lambda x: base64.b32encode(x).decode('utf-8'), torrent_query=query) response = flask.make_response(rss_xml) response.headers['Content-Type'] = 'application/xml' diff --git a/nyaa/templates/rss.xml b/nyaa/templates/rss.xml index c6fdcdd..91da605 100644 --- a/nyaa/templates/rss.xml +++ b/nyaa/templates/rss.xml @@ -29,6 +29,7 @@ {{ torrent.stats.seed_count }} {{ torrent.stats.leech_count }} {{ torrent.stats.download_count }} + {{ compute_hash(torrent.info_hash) }} {% endfor %}