YouTube-Suche: Hacky workaround für Captions

This commit is contained in:
Andreas Bielawski 2016-12-04 20:03:03 +01:00
parent 67ecdd68e2
commit aa41ddd0ff
1 changed files with 13 additions and 0 deletions

View File

@ -132,6 +132,19 @@ function send_youtube_data(data, msg, self, link, sendpic)
if sendpic then
local image_url = get_yt_thumbnail(data)
-- need to change text, because Telegram captions can only be 200 characters long and don't support Markdown
-- hacky workaround
if data.statistics.likeCount then
likeCount = ' | 👍 '..comma_value(data.statistics.likeCount)..' |'
dislikeCount = ' 👎 '..comma_value(data.statistics.dislikeCount)
else
likeCount = ''
dislikeCount = ''
end
if data.statistics.commentCount then
commentCount = ' | 🗣 '..comma_value(data.statistics.commentCount)
else
commentCount = ''
end
local text = link..'\n'..title..'\n🎥 '..uploader..', 📅 '..upload_date..'\n👁 '..viewCount..' | 🕒 '..duration..likeCount..dislikeCount..commentCount..'\n'
if blocked then
text = text..'\nACHTUNG, In Deutschland gesperrt!'