diff --git a/src/lib/telegram/index.js b/src/lib/telegram/index.js index b5c1f46..e25be36 100644 --- a/src/lib/telegram/index.js +++ b/src/lib/telegram/index.js @@ -11,6 +11,32 @@ const cache = new LRUCache({ }, }) +function getVideoStickers($, item, { staticProxy, index, title }) { + return $(item).find('.js-videosticker_video')?.map((_index, video) => { + const url = $(video).attr('src') + const imgurl = $(video).find('img').attr('src') + return ` +
+ +
+ ` + })?.get()?.join('') +} + +function getImageStickers($, item, { staticProxy, index, title }) { + return $(item).find('.tgme_widget_message_sticker')?.map((_index, image) => { + // const bgurl = $(image).attr('style').match(/url\(["'](.*?)["']/)?.[1] + const url = $(image).attr('data-webp') + return ` +
+ ${title} +
+ ` + })?.get()?.join('') +} + function getImages($, item, { staticProxy, id, index, title }) { return $(item).find('.tgme_widget_message_photo_wrap')?.map((_index, photo) => { const url = $(photo).attr('style').match(/url\(["'](.*?)["']/)?.[1] @@ -78,6 +104,8 @@ function getPost($, item, { channel, staticProxy, index = 0 }) { text: content?.text(), content: [ $.html($(item).find('.tgme_widget_message_reply')?.wrapInner('')?.wrapInner('
')), + getImageStickers($, item, { staticProxy, index, title }), + getVideoStickers($, item, { staticProxy, index, title }), getImages($, item, { staticProxy, id, index, title }), getVideo($, item, { staticProxy, id, index, title }), content?.html(),