Defekte Plugins entfernt
This commit is contained in:
74
plugins/pluginsold/gay.lua
Normal file
74
plugins/pluginsold/gay.lua
Normal file
@@ -0,0 +1,74 @@
|
||||
do
|
||||
|
||||
function getGay(text)
|
||||
local text = URL.escape(text)
|
||||
local api = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=8&q=gay+porn"
|
||||
local res, code = http.request(api..text)
|
||||
if code ~= 200 then return nil end
|
||||
local google = json:decode(res)
|
||||
|
||||
if google.responseStatus ~= 200 then
|
||||
return nil
|
||||
end
|
||||
|
||||
local data = google.responseData
|
||||
|
||||
if not data or not data.results then
|
||||
return nil
|
||||
end
|
||||
|
||||
if #data.results == 0 then
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Random image from table
|
||||
-- local i = math.random(#data.results)
|
||||
-- return data.results[i].url
|
||||
return data.results
|
||||
end
|
||||
|
||||
function run(msg, matches)
|
||||
local receiver = get_receiver(msg)
|
||||
local text = matches[1]
|
||||
|
||||
local results = getGay(text)
|
||||
if not results then
|
||||
return "Kein Bild gefunden."
|
||||
end
|
||||
local i = math.random(#results)
|
||||
local url = nil;
|
||||
|
||||
local failed = true
|
||||
local nofTries = 0
|
||||
while failed and nofTries < #results do
|
||||
url = results[i].url;
|
||||
print("Bilder-URL: ", url)
|
||||
|
||||
if string.ends(url, ".gif") then
|
||||
failed = not send_document_from_url(receiver, url, nil, nil, true)
|
||||
elseif string.ends(url, ".jpg") or string.ends(url, ".jpeg") or string.ends(url, ".png") then
|
||||
failed = not send_photo_from_url(receiver, url, nil, nil, true)
|
||||
end
|
||||
|
||||
nofTries = nofTries + 1
|
||||
i = i+1
|
||||
if i > #results then
|
||||
i = 1
|
||||
end
|
||||
end
|
||||
|
||||
if failed then
|
||||
return "Fehler beim Laden des Bildes."
|
||||
else
|
||||
return "Source: "..url
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sucht Bild mit Google-API und versendet es [NSFW]",
|
||||
usage = {"/gay"},
|
||||
patterns = {"^/gay$"},
|
||||
run = run
|
||||
}
|
||||
end
|
||||
--Modified by Akamaru [https://ponywave.de]
|
||||
166
plugins/pluginsold/img_google.lua
Normal file
166
plugins/pluginsold/img_google.lua
Normal file
@@ -0,0 +1,166 @@
|
||||
do
|
||||
|
||||
local _blacklist
|
||||
|
||||
local function getGoogleImage(text)
|
||||
local text = URL.escape(text)
|
||||
local api = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=8&safe=active&q="
|
||||
local res, code = http.request(api..text)
|
||||
if code ~= 200 then return nil end
|
||||
local google = json:decode(res)
|
||||
|
||||
if google.responseStatus ~= 200 then
|
||||
return nil
|
||||
end
|
||||
|
||||
local data = google.responseData
|
||||
|
||||
if not data or not data.results then
|
||||
return nil
|
||||
end
|
||||
|
||||
if #data.results == 0 then
|
||||
return nil
|
||||
end
|
||||
|
||||
return data.results
|
||||
end
|
||||
|
||||
local function is_blacklisted(msg)
|
||||
local var = false
|
||||
for v,word in pairs(_blacklist) do
|
||||
if string.find(string.lower(msg), string.lower(word)) then
|
||||
print("Wort steht auf der Blacklist!")
|
||||
var = true
|
||||
break
|
||||
end
|
||||
end
|
||||
return var
|
||||
end
|
||||
|
||||
local function show_blacklist()
|
||||
if not _blacklist[1] then
|
||||
return "Keine Wörter geblacklisted!\nBlackliste welche mit /imgblacklist add [Wort]"
|
||||
else
|
||||
local sort_alph = function( a,b ) return a < b end
|
||||
table.sort( _blacklist, sort_alph )
|
||||
local blacklist = "Folgende Wörter stehen auf der Blacklist:\n"
|
||||
for v,word in pairs(_blacklist) do
|
||||
blacklist = blacklist..'- '..word..'\n'
|
||||
end
|
||||
return blacklist
|
||||
end
|
||||
end
|
||||
|
||||
local function add_blacklist()
|
||||
print('Blacklisting '..word..' - saving to redis set telegram:img_blacklist')
|
||||
if redis:sismember("telegram:img_blacklist", word) == true then
|
||||
return '"'..word..'" steht schon auf der Blacklist.'
|
||||
else
|
||||
redis:sadd("telegram:img_blacklist", word)
|
||||
return '"'..word..'" blacklisted!'
|
||||
end
|
||||
end
|
||||
|
||||
local function remove_blacklist()
|
||||
print('De-blacklisting '..word..' - removing from redis set telegram:img_blacklist')
|
||||
if redis:sismember("telegram:img_blacklist", word) == true then
|
||||
redis:srem("telegram:img_blacklist", word)
|
||||
return '"'..word..'" erfolgreich von der Blacklist gelöscht!'
|
||||
else
|
||||
return '"'..word..'" steht nicht auf der Blacklist.'
|
||||
end
|
||||
end
|
||||
|
||||
local function run(msg, matches)
|
||||
local receiver = get_receiver(msg)
|
||||
local text = matches[1]
|
||||
if matches[2] then word = string.lower(matches[2]) end
|
||||
|
||||
_blacklist = redis:smembers("telegram:img_blacklist")
|
||||
|
||||
if text == "/imgblacklist show" then
|
||||
if is_sudo(msg) then
|
||||
return show_blacklist()
|
||||
else
|
||||
return "Du bist kein Superuser. Dieser Vorfall wird gemeldet!"
|
||||
end
|
||||
end
|
||||
|
||||
if text == "/imgblacklist add" and word == nil then
|
||||
return "Benutzung: /imgblacklist add [Wort]"
|
||||
elseif text == "/imgblacklist add" and word then
|
||||
if is_sudo(msg) then
|
||||
return add_blacklist()
|
||||
else
|
||||
return "Du bist kein Superuser. Dieser Vorfall wird gemeldet!"
|
||||
end
|
||||
end
|
||||
|
||||
if text == "/imgblacklist del" and word == nil then
|
||||
return "Benutzung: /imgblacklist del [Wort]"
|
||||
elseif text == "/imgblacklist del" and word then
|
||||
if is_sudo(msg) then
|
||||
return remove_blacklist()
|
||||
else
|
||||
return "Du bist kein Superuser. Dieser Vorfall wird gemeldet!"
|
||||
end
|
||||
end
|
||||
|
||||
print ('Checking if search contains blacklisted words: '..text)
|
||||
if is_blacklisted(text) then
|
||||
return "Vergiss es ._."
|
||||
end
|
||||
|
||||
local results = getGoogleImage(text)
|
||||
if not results then
|
||||
return "Kein Bild gefunden!"
|
||||
end
|
||||
|
||||
-- Random image from table
|
||||
local i = math.random(#results)
|
||||
local url = nil;
|
||||
|
||||
local failed = true
|
||||
local nofTries = 0
|
||||
while failed and nofTries < #results do
|
||||
url = results[i].url;
|
||||
print("Bilder-URL: ", url)
|
||||
|
||||
if string.ends(url, ".gif") then
|
||||
failed = not send_document_from_url(receiver, url, nil, nil, true)
|
||||
elseif string.ends(url, ".jpg") or string.ends(url, ".jpeg") or string.ends(url, ".png") then
|
||||
failed = not send_photo_from_url(receiver, url, nil, nil, true)
|
||||
end
|
||||
|
||||
nofTries = nofTries + 1
|
||||
i = i+1
|
||||
if i > #results then
|
||||
i = 1
|
||||
end
|
||||
end
|
||||
|
||||
if failed then
|
||||
return "Fehler beim Herunterladen eines Bildes."
|
||||
else
|
||||
return "Source: "..url
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sucht Bild mit Google-API und versendet es (SafeSearch aktiv)",
|
||||
usage = {
|
||||
"/img [Suchbegriff]",
|
||||
"/imgblacklist show: Zeigt Blacklist (nur Superuser)",
|
||||
"/imgblacklist add [Wort]: Fügt Wort der Blacklist hinzu (nur Superuser)",
|
||||
"/imgblacklist del [Wort]: Entfernt Wort aus der Blacklist (nur Superuser)"
|
||||
},
|
||||
patterns = {
|
||||
"^/img (.*)$",
|
||||
"^(/imgblacklist show)$",
|
||||
"^(/imgblacklist add) (.*)$",
|
||||
"^(/imgblacklist del) (.*)$"
|
||||
},
|
||||
run = run
|
||||
}
|
||||
end
|
||||
161
plugins/pluginsold/img_google_nsfw.lua
Normal file
161
plugins/pluginsold/img_google_nsfw.lua
Normal file
@@ -0,0 +1,161 @@
|
||||
do
|
||||
|
||||
local _blacklist
|
||||
|
||||
local function getNSFWImage(text)
|
||||
local text = URL.escape(text)
|
||||
local api = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=8&q="
|
||||
local res, code = http.request(api..text)
|
||||
if code ~= 200 then return nil end
|
||||
local google = json:decode(res)
|
||||
|
||||
if google.responseStatus ~= 200 then
|
||||
return nil
|
||||
end
|
||||
|
||||
local data = google.responseData
|
||||
|
||||
if not data or not data.results then
|
||||
return nil
|
||||
end
|
||||
|
||||
if #data.results == 0 then
|
||||
return nil
|
||||
end
|
||||
|
||||
return data.results
|
||||
end
|
||||
|
||||
local function is_blacklisted(msg)
|
||||
local var = false
|
||||
for v,word in pairs(_blacklist) do
|
||||
if string.find(string.lower(msg), string.lower(word)) then
|
||||
print("Wort steht auf der Blacklist!")
|
||||
var = true
|
||||
break
|
||||
end
|
||||
end
|
||||
return var
|
||||
end
|
||||
|
||||
local function show_blacklist()
|
||||
if not _blacklist[1] then
|
||||
return "Keine Wörter geblacklisted!\nBlackliste welche mit /imgblacklist add [Wort]"
|
||||
else
|
||||
local sort_alph = function( a,b ) return a < b end
|
||||
table.sort( _blacklist, sort_alph )
|
||||
local blacklist = "Folgende Wörter stehen auf der Blacklist:\n"
|
||||
for v,word in pairs(_blacklist) do
|
||||
blacklist = blacklist..'- '..word..'\n'
|
||||
end
|
||||
return blacklist
|
||||
end
|
||||
end
|
||||
|
||||
local function add_blacklist()
|
||||
print('Blacklisting '..word..' - saving to redis set telegram:img_blacklist')
|
||||
if redis:sismember("telegram:img_blacklist", word) == true then
|
||||
return '"'..word..'" steht schon auf der Blacklist.'
|
||||
else
|
||||
redis:sadd("telegram:img_blacklist", word)
|
||||
return '"'..word..'" blacklisted!'
|
||||
end
|
||||
end
|
||||
|
||||
local function remove_blacklist()
|
||||
print('De-blacklisting '..word..' - removing from redis set telegram:img_blacklist')
|
||||
if redis:sismember("telegram:img_blacklist", word) == true then
|
||||
redis:srem("telegram:img_blacklist", word)
|
||||
return '"'..word..'" erfolgreich von der Blacklist gelöscht!'
|
||||
else
|
||||
return '"'..word..'" steht nicht auf der Blacklist.'
|
||||
end
|
||||
end
|
||||
|
||||
local function run(msg, matches)
|
||||
local receiver = get_receiver(msg)
|
||||
local text = matches[1]
|
||||
if matches[2] then word = string.lower(matches[2]) end
|
||||
|
||||
_blacklist = redis:smembers("telegram:img_blacklist")
|
||||
|
||||
if text == "/imgblacklist show" then
|
||||
if is_sudo(msg) then
|
||||
return show_blacklist()
|
||||
else
|
||||
return "Du bist kein Superuser. Dieser Vorfall wird gemeldet!"
|
||||
end
|
||||
end
|
||||
|
||||
if text == "/imgblacklist add" and word == nil then
|
||||
return "Benutzung: /imgblacklist add [Wort]"
|
||||
elseif text == "/imgblacklist add" and word then
|
||||
if is_sudo(msg) then
|
||||
return add_blacklist()
|
||||
else
|
||||
return "Du bist kein Superuser. Dieser Vorfall wird gemeldet!"
|
||||
end
|
||||
end
|
||||
|
||||
if text == "/imgblacklist del" and word == nil then
|
||||
return "Benutzung: /imgblacklist del [Wort]"
|
||||
elseif text == "/imgblacklist del" and word then
|
||||
if is_sudo(msg) then
|
||||
return remove_blacklist()
|
||||
else
|
||||
return "Du bist kein Superuser. Dieser Vorfall wird gemeldet!"
|
||||
end
|
||||
end
|
||||
|
||||
print ('Checking if search contains blacklisted words: '..text)
|
||||
if is_blacklisted(text) then
|
||||
return "Vergiss es ._."
|
||||
end
|
||||
|
||||
local results = getNSFWImage(text)
|
||||
if not results then
|
||||
return "Kein Bild gefunden!"
|
||||
end
|
||||
|
||||
-- Random image from table
|
||||
local i = math.random(#results)
|
||||
local url = nil;
|
||||
|
||||
local failed = true
|
||||
local nofTries = 0
|
||||
while failed and nofTries < #results do
|
||||
url = results[i].url;
|
||||
print("Bilder-URL: ", url)
|
||||
|
||||
if string.ends(url, ".gif") then
|
||||
failed = not send_document_from_url(receiver, url, nil, nil, true)
|
||||
elseif string.ends(url, ".jpg") or string.ends(url, ".jpeg") or string.ends(url, ".png") then
|
||||
failed = not send_photo_from_url(receiver, url, nil, nil, true)
|
||||
end
|
||||
|
||||
nofTries = nofTries + 1
|
||||
i = i+1
|
||||
if i > #results then
|
||||
i = 1
|
||||
end
|
||||
end
|
||||
|
||||
if failed then
|
||||
return "Fehler beim Herunterladen eines Bildes."
|
||||
else
|
||||
return "Source: "..url
|
||||
end
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sucht Bild mit Google-API und versendet es [NSFW]",
|
||||
usage = {"/img2 [Suchbegriff]","/nsfwimg [Suchbegriff]"},
|
||||
patterns = {"^/img2 (.*)$",
|
||||
"^/nsfwimg (.*)$"--[[,
|
||||
"^(/imgblacklist show)$",
|
||||
"^(/imgblacklist add) (.*)$",
|
||||
"^(/imgblacklist del) (.*)$"]]
|
||||
},
|
||||
run = run
|
||||
}
|
||||
end
|
||||
39
plugins/pluginsold/pornhub.lua
Normal file
39
plugins/pluginsold/pornhub.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
local function googlethat(query)
|
||||
query = "site:pornhub.com" .. query
|
||||
local api = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&"
|
||||
local parameters = "q=".. (URL.escape(query))
|
||||
|
||||
-- Do the request
|
||||
local res, code = https.request(api..parameters)
|
||||
if code ~=200 then return nil end
|
||||
local data = json:decode(res)
|
||||
|
||||
local results = {}
|
||||
for key,result in ipairs(data.responseData.results) do
|
||||
table.insert(results, {
|
||||
result.titleNoFormatting,
|
||||
result.unescapedUrl or result.url
|
||||
})
|
||||
end
|
||||
return results
|
||||
end
|
||||
|
||||
local function stringlinks(results)
|
||||
local stringresults=""
|
||||
for key,val in ipairs(results) do
|
||||
stringresults=stringresults..val[1].." - "..val[2].."\n"
|
||||
end
|
||||
return stringresults
|
||||
end
|
||||
|
||||
local function run(msg, matches)
|
||||
local results = googlethat(matches[1])
|
||||
return stringlinks(results)
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sendet ein PornHub Video",
|
||||
usage = {"/pornhub [Begriff]","/ph [Begriff]"},
|
||||
patterns = {"^/pornhub(.*)$","^/ph(.*)$"},
|
||||
run = run
|
||||
}
|
||||
50
plugins/pluginsold/wallpaper.lua
Normal file
50
plugins/pluginsold/wallpaper.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
do
|
||||
|
||||
function getWallpaper(text)
|
||||
local text = URL.escape(text)
|
||||
local api = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=8&safe=active&tbs=isz:l&tbm=isch&q=wallpaper+"
|
||||
local res, code = http.request(api..text)
|
||||
if code ~= 200 then return nil end
|
||||
local google = json:decode(res)
|
||||
|
||||
if google.responseStatus ~= 200 then
|
||||
return nil
|
||||
end
|
||||
|
||||
local data = google.responseData
|
||||
|
||||
if not data or not data.results then
|
||||
return nil
|
||||
end
|
||||
|
||||
if #data.results == 0 then
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Random image from table
|
||||
local i = math.random(#data.results)
|
||||
return data.results[i].url
|
||||
end
|
||||
|
||||
function run(msg, matches)
|
||||
local receiver = get_receiver(msg)
|
||||
local text = matches[1]
|
||||
local url = getWallpaper(text)
|
||||
|
||||
if not url then
|
||||
return "Kein Wallpaper gefunden."
|
||||
end
|
||||
|
||||
print("Bilder-URL: ", url)
|
||||
send_photo_from_url(receiver, url)
|
||||
return "Source: "..url
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sucht Wallpaper mit Google und versendet es (SafeSearch aktiv)",
|
||||
usage = {"/wallpaper [Suchbegriff]","/wp [Suchbegriff]"},
|
||||
patterns = {"^/wallpaper (.*)$","^/wp (.*)$"},
|
||||
run = run
|
||||
}
|
||||
end
|
||||
-- Original by yagop ; Modified by Akamaru [https://ponywave.de]
|
||||
50
plugins/pluginsold/wallpaper_nsfw.lua
Normal file
50
plugins/pluginsold/wallpaper_nsfw.lua
Normal file
@@ -0,0 +1,50 @@
|
||||
do
|
||||
|
||||
function getWallpaper2(text)
|
||||
local text = URL.escape(text)
|
||||
local api = "https://ajax.googleapis.com/ajax/services/search/images?v=1.0&rsz=8&tbs=isz:l&tbm=isch&q=wallpaper+"
|
||||
local res, code = http.request(api..text)
|
||||
if code ~= 200 then return nil end
|
||||
local google = json:decode(res)
|
||||
|
||||
if google.responseStatus ~= 200 then
|
||||
return nil
|
||||
end
|
||||
|
||||
local data = google.responseData
|
||||
|
||||
if not data or not data.results then
|
||||
return nil
|
||||
end
|
||||
|
||||
if #data.results == 0 then
|
||||
return nil
|
||||
end
|
||||
|
||||
-- Random image from table
|
||||
local i = math.random(#data.results)
|
||||
return data.results[i].url
|
||||
end
|
||||
|
||||
function run(msg, matches)
|
||||
local receiver = get_receiver(msg)
|
||||
local text = matches[1]
|
||||
local url = getWallpaper2(text)
|
||||
|
||||
if not url then
|
||||
return "Kein Wallpaper gefunden."
|
||||
end
|
||||
|
||||
print("Bilder-URL: ", url)
|
||||
send_photo_from_url(receiver, url)
|
||||
return "Source: "..url
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sucht Wallpaper mit Google und versendet es [NSFW]",
|
||||
usage = {"/wallpaper2 [Suchbegriff]","/wp2 [Suchbegriff]"},
|
||||
patterns = {"^/wallpaper2 (.*)$","^/wp2 (.*)$"},
|
||||
run = run
|
||||
}
|
||||
end
|
||||
-- Original by yagop ; Modified by Akamaru [https://ponywave.de]
|
||||
39
plugins/pluginsold/youporn.lua
Normal file
39
plugins/pluginsold/youporn.lua
Normal file
@@ -0,0 +1,39 @@
|
||||
local function googlethat(query)
|
||||
query = "site:youporn.com" .. query
|
||||
local api = "http://ajax.googleapis.com/ajax/services/search/web?v=1.0&"
|
||||
local parameters = "q=".. (URL.escape(query))
|
||||
|
||||
-- Do the request
|
||||
local res, code = https.request(api..parameters)
|
||||
if code ~=200 then return nil end
|
||||
local data = json:decode(res)
|
||||
|
||||
local results = {}
|
||||
for key,result in ipairs(data.responseData.results) do
|
||||
table.insert(results, {
|
||||
result.titleNoFormatting,
|
||||
result.unescapedUrl or result.url
|
||||
})
|
||||
end
|
||||
return results
|
||||
end
|
||||
|
||||
local function stringlinks(results)
|
||||
local stringresults=""
|
||||
for key,val in ipairs(results) do
|
||||
stringresults=stringresults..val[1].." - "..val[2].."\n"
|
||||
end
|
||||
return stringresults
|
||||
end
|
||||
|
||||
local function run(msg, matches)
|
||||
local results = googlethat(matches[1])
|
||||
return stringlinks(results)
|
||||
end
|
||||
|
||||
return {
|
||||
description = "Sendet ein YouPorn Video",
|
||||
usage = {"/youporn [Begriff]","/yp [Begriff]"},
|
||||
patterns = {"^/youporn(.*)$","^/yp(.*)$"},
|
||||
run = run
|
||||
}
|
||||
Reference in New Issue
Block a user