add pixiv support

This commit is contained in:
2024-06-24 01:25:03 +08:00
parent 4a5aa296ce
commit 1c779e98a8
4 changed files with 214 additions and 5 deletions
+5 -1
View File
@@ -1,7 +1,8 @@
from __future__ import annotations
from .net import NetClient
from .regex import x_url
from .pixiv import TelegramPixiv
from .regex import pixiv_url, x_url
from .tweet import TelegramTweet
@@ -13,6 +14,9 @@ class Telegram(NetClient):
if x_url.match(self._url):
async with TelegramTweet(self._url) as tweet:
return tweet
elif pixiv_url.match(self._url):
async with TelegramPixiv(self._url) as pixiv:
return pixiv
async def __aexit__(self, exc_type, exc_val, exc_tb):
pass