From aa41ddd0ff98a033013179f29018c3f4a4830afe Mon Sep 17 00:00:00 2001 From: Andreas Bielawski Date: Sun, 4 Dec 2016 20:03:03 +0100 Subject: [PATCH] =?UTF-8?q?YouTube-Suche:=20Hacky=20workaround=20f=C3=BCr?= =?UTF-8?q?=20Captions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- otouto/plugins/youtube.lua | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/otouto/plugins/youtube.lua b/otouto/plugins/youtube.lua index 09570f4..e7afa46 100644 --- a/otouto/plugins/youtube.lua +++ b/otouto/plugins/youtube.lua @@ -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!'