mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-23 23:32:05 +00:00
fix gif media
This commit is contained in:
@@ -4,8 +4,10 @@ from aiohttp import ClientSession
|
|||||||
from telegram import (
|
from telegram import (
|
||||||
InlineQueryResultPhoto,
|
InlineQueryResultPhoto,
|
||||||
InlineQueryResultVideo,
|
InlineQueryResultVideo,
|
||||||
|
InlineQueryResultMpeg4Gif,
|
||||||
InputMediaPhoto,
|
InputMediaPhoto,
|
||||||
InputMediaVideo, InputMediaAnimation, InlineQueryResultMpeg4Gif
|
InputMediaVideo,
|
||||||
|
InputMediaAnimation
|
||||||
)
|
)
|
||||||
|
|
||||||
from common import x_url_regex, x_media_regex, x_tco_regex, logger
|
from common import x_url_regex, x_media_regex, x_tco_regex, logger
|
||||||
@@ -48,6 +50,10 @@ class TweetMedia:
|
|||||||
return f"{twimg_url}{self._uri}?format=jpg&name=4096x4096"
|
return f"{twimg_url}{self._uri}?format=jpg&name=4096x4096"
|
||||||
case "video":
|
case "video":
|
||||||
return self._url
|
return self._url
|
||||||
|
case "gif":
|
||||||
|
return self._url
|
||||||
|
case _:
|
||||||
|
return self._url
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def thumb(self) -> str:
|
def thumb(self) -> str:
|
||||||
@@ -56,6 +62,10 @@ class TweetMedia:
|
|||||||
return f"{twimg_url}{self._uri}?format=jpg&name=thumb"
|
return f"{twimg_url}{self._uri}?format=jpg&name=thumb"
|
||||||
case "video":
|
case "video":
|
||||||
return self._thumb
|
return self._thumb
|
||||||
|
case "gif":
|
||||||
|
return self._thumb
|
||||||
|
case _:
|
||||||
|
return self._thumb
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def type(self) -> str:
|
def type(self) -> str:
|
||||||
|
|||||||
Reference in New Issue
Block a user