mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2025-12-31 18:24:50 +00:00
Tes rewrite ytdl
This commit is contained in:
parent
436201e130
commit
bc59c04657
1 changed files with 4 additions and 2 deletions
|
|
@ -1,14 +1,16 @@
|
|||
from re import compile as recompile
|
||||
from logging import getLogger
|
||||
from misskaty import app
|
||||
from misskaty.vars import COMMAND_HANDLER, LOG_CHANNEL
|
||||
from misskaty.core.decorator.errors import capture_err
|
||||
from misskaty.helper.http import http
|
||||
from pyrogram import filters
|
||||
from iytdl import main
|
||||
from uuid import uuid4
|
||||
|
||||
LOGGER = getLogger(__name__)
|
||||
ytdl = main.iYTDL(LOG_CHANNEL, download_path="iytdl/", silent=True)
|
||||
regex = re.compile(
|
||||
regex = recompile(
|
||||
r"(https?://)?(www\.)?(youtube|youtu|youtube-nocookie)\.(com|be)/(watch\?v=|embed/|v/|.+\?v=)?(?P<id>[A-Za-z0-9\-=_]{11})"
|
||||
)
|
||||
YT_DB = {}
|
||||
|
|
@ -41,7 +43,7 @@ async def get_ytthumb(videoid: str):
|
|||
thumb_link = "https://i.imgur.com/4LwPLai.png"
|
||||
for qualiy in thumb_quality:
|
||||
link = f"https://i.ytimg.com/vi/{videoid}/{qualiy}"
|
||||
if await get_response.status(link) == 200:
|
||||
if await http.get(link).status_code == 200:
|
||||
thumb_link = link
|
||||
break
|
||||
return thumb_link
|
||||
|
|
|
|||
Loading…
Reference in a new issue