IDs im nicovideo Plugin gefixt

- Kleinkram
This commit is contained in:
Akamaru 2016-03-08 15:32:38 +01:00
parent 6cd883dd89
commit 2aab706ae3
4 changed files with 17 additions and 6 deletions

6
.gitignore vendored
View File

@ -1,4 +1,8 @@
data/*
data_old/*
tmp/*
res/
tg/
.luarocks
*.db
plugins/test.lua
@ -11,3 +15,5 @@ plugins/chantalle.lua
plugins/wiiu.lua
plugins/plex_test.lua
plugins/gravatar.lua
pictures/3uhrmorgens.jpg
plugins/figuya.lua

View File

@ -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

View File

@ -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