YouTube-Suche: Hacky workaround für Captions
This commit is contained in:
parent
67ecdd68e2
commit
aa41ddd0ff
@ -132,6 +132,19 @@ function send_youtube_data(data, msg, self, link, sendpic)
|
|||||||
if sendpic then
|
if sendpic then
|
||||||
local image_url = get_yt_thumbnail(data)
|
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
|
-- 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'
|
local text = link..'\n'..title..'\n🎥 '..uploader..', 📅 '..upload_date..'\n👁 '..viewCount..' | 🕒 '..duration..likeCount..dislikeCount..commentCount..'\n'
|
||||||
if blocked then
|
if blocked then
|
||||||
text = text..'\nACHTUNG, In Deutschland gesperrt!'
|
text = text..'\nACHTUNG, In Deutschland gesperrt!'
|
||||||
|
Reference in New Issue
Block a user