mirror of
https://github.com/TheFunny/TelegramTwitterMediaBot.git
synced 2026-09-30 00:22:08 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c0e581135
|
||
|
|
494fc50446
|
+4
-1
@@ -158,7 +158,7 @@ class ProcessTweet:
|
|||||||
async def _fetch_tweet(self) -> TweetInfo:
|
async def _fetch_tweet(self) -> TweetInfo:
|
||||||
match = x_url_regex.match(self._url)
|
match = x_url_regex.match(self._url)
|
||||||
assert match, f"Invalid URL: {self._url}"
|
assert match, f"Invalid URL: {self._url}"
|
||||||
auther_id, tweet_id = match.group()
|
auther_id, tweet_id = match.groups()
|
||||||
return await fetch_json(self._httpx_client, vx_api_url.format(auther_id, tweet_id))
|
return await fetch_json(self._httpx_client, vx_api_url.format(auther_id, tweet_id))
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@@ -273,6 +273,9 @@ class Telegram:
|
|||||||
async with TelegramTweet(self._httpx_client, self._url) as tweet:
|
async with TelegramTweet(self._httpx_client, self._url) as tweet:
|
||||||
return tweet
|
return tweet
|
||||||
|
|
||||||
|
async def __aexit__(self, exc_type, exc_val, exc_tb):
|
||||||
|
pass
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
def init_client(cls) -> None:
|
def init_client(cls) -> None:
|
||||||
cls._httpx_client = create_client()
|
cls._httpx_client = create_client()
|
||||||
|
|||||||
Reference in New Issue
Block a user