From 3b0142cedcde39e4c2097ecd916a870a3ced5ec6 Mon Sep 17 00:00:00 2001 From: Vito Graffagnino Date: Tue, 8 Sep 2020 18:10:49 +0100 Subject: Added the relevent parts of the .config directory. Alss add ssh config --- .w3m/cgi-bin/magnet.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100755 .w3m/cgi-bin/magnet.py (limited to '.w3m/cgi-bin/magnet.py') diff --git a/.w3m/cgi-bin/magnet.py b/.w3m/cgi-bin/magnet.py new file mode 100755 index 0000000..72b51d4 --- /dev/null +++ b/.w3m/cgi-bin/magnet.py @@ -0,0 +1,23 @@ +#!/usr/bin/python2 +# coding=utf-8 + +import sys +import os +import subprocess + +uri = os.environ.get('QUERY_STRING') +referer = os.environ.get('HTTP_REFERER') + +if not uri: + print + print "Error: No URI" + sys.exit() + +cmd_list = ("transmission-remote", "-a", uri) + +subprocess.call(cmd_list) + +if referer: + print "HTTP/1.1 303 See Other" + print "Location: %s" % referer + -- cgit v1.2.3