Compare commits

...
4 Commits
Author SHA1 Message Date
YoursFunny 566c17a855 fix pixiv url 2024-07-19 19:34:18 +08:00
YoursFunny 87f0d16028 fix regex https pattern 2024-07-16 14:28:49 +08:00
YoursFunny 197993e522 bump version 2024-07-16 14:27:15 +08:00
YoursFunny 02abcd899e update pixiv regex 2024-07-16 14:21:43 +08:00
3 changed files with 6 additions and 5 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
python-telegram-bot[webhooks]~=21.3 python-telegram-bot[webhooks]~=21.4
httpx[http2]~=0.27 httpx[http2]~=0.27
uvloop~=0.19.0; sys_platform != 'win32' uvloop~=0.19.0; sys_platform != 'win32'
async-pixiv @ git+https://github.com/TheFunny/async-pixiv@main async-pixiv @ git+https://github.com/TheFunny/async-pixiv@main
+2 -1
View File
@@ -165,8 +165,9 @@ class TelegramPixiv:
async def __aexit__(self, exc_type, exc_val, exc_tb): async def __aexit__(self, exc_type, exc_val, exc_tb):
pass pass
@property
def url(self) -> str: def url(self) -> str:
return self._url return self._pixiv.url
@property @property
def message_text(self) -> str: def message_text(self) -> str:
+3 -3
View File
@@ -1,8 +1,8 @@
import re import re
x_url = re.compile(r"^(?:https?://)?(?:www\.|mobile\.)?(?:x|twitter|fixvx|vxtwitter)\.com/(.+)/status/(\d+)") x_url = re.compile(r"^(?:https?://)?(?:www\.|mobile\.)?(?:x|twitter|fixvx|vxtwitter)\.com/(.+)/status/(\d+)")
x_media_url = re.compile(r"^(?:https?://)(pbs|video)\.twimg\.com/(.*)") x_media_url = re.compile(r"^(?:https?://)?(pbs|video)\.twimg\.com/(.*)")
x_tco_url = re.compile(r"(?:https?://)t\.co/.+$", re.M) x_tco_url = re.compile(r"(?:https?://)?t\.co/.+$", re.M)
message_url = re.compile(r"\[.+]", re.S) message_url = re.compile(r"\[.+]", re.S)
pixiv_url = re.compile(r"^(?:https?://)?(?:www\.)?pixiv\.net/(?:en/)?artworks/(\d+)") pixiv_url = re.compile(r"^(?:https?://)?(?:www\.)?pixiv\.net/(?:en/)?(?:artworks/|i/)(\d+)")