diff --git a/searx/engines/kickass.py b/searx/engines/kickass.py index a4d270673..ac349283d 100644 --- a/searx/engines/kickass.py +++ b/searx/engines/kickass.py @@ -102,6 +102,7 @@ def response(resp): magnetlink = result.xpath(magnet_xpath)[0].attrib['href'] torrentfile = result.xpath(torrent_xpath)[0].attrib['href'] + torrentfileurl = quote(torrentfile, safe="%/:=&?~#+!$,;'@()*") # append result results.append({'url': href, @@ -112,7 +113,7 @@ def response(resp): 'filesize': filesize, 'files': files, 'magnetlink': magnetlink, - 'torrentfile': torrentfile, + 'torrentfile': torrentfileurl, 'template': 'torrent.html'}) # return results sorted by seeder diff --git a/searx/templates/oscar/preferences.html b/searx/templates/oscar/preferences.html index 2868adecc..644865822 100644 --- a/searx/templates/oscar/preferences.html +++ b/searx/templates/oscar/preferences.html @@ -113,9 +113,9 @@
{{ icon('transfer') }} {{ _('Seeder') }} {{ result.seed }} • {{ _('Leecher') }} {{ result.leech }}
-{% if result.filesize %}{{ icon('floppy-disk') }} {{ _('Filesize') }}
+{% if result.filesize %}
{{ icon('floppy-disk') }} {{ _('Filesize') }}
- {% if result.filesize < 1024 %}{{ result.filesize }} Byte
- {% elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} kb
- {% elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} MB
- {% elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} GB
- {% else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} TB{% endif %}
+ {% if result.filesize < 1024 %}{{ result.filesize }} {{ _('Bytes') }}
+ {% elif result.filesize < 1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024) }} {{ _('kiB') }}
+ {% elif result.filesize < 1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024) }} {{ _('MiB') }}
+ {% elif result.filesize < 1024*1024*1024*1024 %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024) }} {{ _('GiB') }}
+ {% else %}{{ '{0:0.2f}'.format(result.filesize/1024/1024/1024/1024) }} {{ _('TiB') }}{% endif %}
{% endif %}
-{% if result.files %}{{ icon('file') }} {{ _('Number of Files') }} {{ result.files }}{% endif %}
- {{ icon('magnet') }} {{ _('magnet link') }} - {% if result.torrentfile %}{{ icon('download-alt') }} {{ _('torrent file') }}{% endif %} -
+{% if result.files %}{{ result.content|safe }}
{% endif %} +{% if result.content %}