diff --git a/lib/v2/telegram/channel.js b/lib/v2/telegram/channel.js
index 06bf33e17d..8280411834 100644
--- a/lib/v2/telegram/channel.js
+++ b/lib/v2/telegram/channel.js
@@ -1,6 +1,8 @@
const got = require('@/utils/got');
const cheerio = require('cheerio');
const { parseDate } = require('@/utils/parse-date');
+const { art } = require('@/utils/render');
+const path = require('path');
module.exports = async (ctx) => {
const username = ctx.params.username;
@@ -127,15 +129,17 @@ module.exports = async (ctx) => {
let messageVideos = '';
if (item.find('.tgme_widget_message_video_player').length) {
item.find('.tgme_widget_message_video_player').each(function () {
- messageVideos += ``;
+ const source = $(this).find('.tgme_widget_message_video').attr('src');
+ if (source) {
+ const poster = $(this)
+ .find('.tgme_widget_message_video_thumb')
+ .css('background-image')
+ .match(/url\('(.*)'\)/)[1];
+ messageVideos += art(path.join(__dirname, 'templates/video.art'), {
+ source,
+ poster,
+ });
+ }
});
}
return messageVideos;
diff --git a/lib/v2/telegram/templates/video.art b/lib/v2/telegram/templates/video.art
new file mode 100644
index 0000000000..9fc08e5561
--- /dev/null
+++ b/lib/v2/telegram/templates/video.art
@@ -0,0 +1,5 @@
+{{ if source }}
+`
+{{ else }}
+Media is too big
+{{ /if }}
\ No newline at end of file