From 07fd6863643fba9bfaa6e0733536581c97e3e7b3 Mon Sep 17 00:00:00 2001 From: Akamaru Date: Mon, 7 Dec 2015 19:44:09 +0100 Subject: [PATCH] Torrent Plugin Fix; Ignoriere myfigurecollection in url_title --- plugins/location_manager.lua | 5 +++++ plugins/{ => pluginsold}/reload.lua | 0 plugins/torrent_search.lua | 22 ++++++++++++++++++---- plugins/url_title.lua | 1 + 4 files changed, 24 insertions(+), 4 deletions(-) rename plugins/{ => pluginsold}/reload.lua (100%) diff --git a/plugins/location_manager.lua b/plugins/location_manager.lua index 0831b16..e84c475 100644 --- a/plugins/location_manager.lua +++ b/plugins/location_manager.lua @@ -3,6 +3,8 @@ do +require("./plugins/time") + local function set_location(user_id, location) local hash = 'user:'..user_id local set_location = get_location(user_id) @@ -40,6 +42,9 @@ local function run(msg, matches) if not set_location then return 'Du hast keinen Ort gesetzt' else + local lat,lng = get_latlong(set_location) + local receiver = get_receiver(msg) + send_location(receiver, lat, lng, ok_cb, false) return 'Gesetzter Wohnort: '..set_location end end diff --git a/plugins/reload.lua b/plugins/pluginsold/reload.lua similarity index 100% rename from plugins/reload.lua rename to plugins/pluginsold/reload.lua diff --git a/plugins/torrent_search.lua b/plugins/torrent_search.lua index b8ba29d..37d6d74 100644 --- a/plugins/torrent_search.lua +++ b/plugins/torrent_search.lua @@ -1,7 +1,21 @@ - local function search_kickass(query) - local url = 'http://kat.cr/json.php?q='..URL.escape(query) - local b,c = http.request(url) - local data = json:decode(b) +local https = require ('ssl.https') +local ltn12 = require ("ltn12") + +local function search_kickass(query) + local url = 'https://kat.cr/json.php?q='..URL.escape(query) + + local resp = {} + + local b,c = https.request + { + url = url, + protocol = "tlsv1", + sink = ltn12.sink.table(resp) + } + + resp = table.concat(resp) + + local data = json:decode(resp) local text = 'Results: '..data.total_results..'\n\n' local results = math.min(#data.list, 5) diff --git a/plugins/url_title.lua b/plugins/url_title.lua index 6472b5e..ecf1c63 100644 --- a/plugins/url_title.lua +++ b/plugins/url_title.lua @@ -95,6 +95,7 @@ function run(msg, matches) string.match(msg.text, "wikia.com") or string.match(msg.text, "rule34.xxx/index.php") or string.match(msg.text, "openings.moe/%?video") or + string.match(msg.text, "myfigurecollection.net") or string.match(msg.text, "dropbox.com/s/") then print('Ungültig, da "'..title..'"') else