diff --git a/.gitignore b/.gitignore index 0e475cf..e8c654d 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,8 @@ +data/* +data_old/* +tmp/* res/ +tg/ .luarocks *.db plugins/test.lua @@ -10,4 +14,6 @@ plugins/pegelf_img.lua plugins/chantalle.lua plugins/wiiu.lua plugins/plex_test.lua -plugins/gravatar.lua \ No newline at end of file +plugins/gravatar.lua +pictures/3uhrmorgens.jpg +plugins/figuya.lua \ No newline at end of file diff --git a/data/credentials.lua b/data/credentials.lua index 6f0b08f..8ad833e 100644 --- a/data/credentials.lua +++ b/data/credentials.lua @@ -52,4 +52,4 @@ do local _ = { yandex_rich_content_apikey = "" } return _ -end +end \ No newline at end of file diff --git a/plugins/nicovideo.lua b/plugins/nicovideo.lua index 44eb9b9..41aeb67 100644 --- a/plugins/nicovideo.lua +++ b/plugins/nicovideo.lua @@ -13,7 +13,7 @@ local makeOurDate = function(dateString) end local function get_vid_info(id) - local url = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D%22http%3A%2F%2Fext.nicovideo.jp%2Fapi%2Fgetthumbinfo%2Fsm'..id..'%22&format=json' + local url = 'https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20xml%20where%20url%3D%22http%3A%2F%2Fext.nicovideo.jp%2Fapi%2Fgetthumbinfo%2F'..id..'%22&format=json' local res,code = https.request(url) local data = json:decode(res).query.results.nicovideo_thumb_response.thumb if code ~= 200 then return "HTTP-Fehler" end @@ -21,7 +21,11 @@ local function get_vid_info(id) local title = data.title local date = makeOurDate(data.first_retrieve) - local user = data.user_nickname + if data.user_nickname then + user = data.user_nickname + elseif data.ch_name then + user = data.ch_name + end local views = comma_value(data.view_counter) local dura = data.length local favs = comma_value(data.mylist_counter) @@ -46,7 +50,8 @@ return { description = "Sendet Infos zu einem nicovideo-Video", usage = "Link zu nicovideo.jp Video", patterns = { - "nicovideo.jp/watch/sm(%d+)$", + "nicovideo.jp/watch/(sm%d+)$", + "nicovideo.jp/watch/(%d+)$", "nico.ms/sm(%d+)$" }, run = run diff --git a/plugins/url_title.lua b/plugins/url_title.lua index d47676e..7c34233 100644 --- a/plugins/url_title.lua +++ b/plugins/url_title.lua @@ -54,7 +54,7 @@ function run(msg, matches) string.match(msg.text, "openings.moe/%?video") or string.match(msg.text, "myfigurecollection.net") or string.match(msg.text, "dropbox.com/s/") or - string.match(msg.text, "nicovideo.jp/watch/sm") or + string.match(msg.text, "nicovideo.jp/watch/") or string.match(msg.text, "nico.ms/sm") or string.match(msg.text, "tumblr.com") or string.match(msg.text, "kickstarter.com/projects") or