Update ytdl_download_new.py

This commit is contained in:
yasirarism 2022-12-16 09:52:16 +07:00 committed by GitHub
parent 45b9fb1c42
commit 8e8fa0b71f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -68,9 +68,10 @@ async def ytdownv2(_, message):
async with iYTDL( async with iYTDL(
log_group_id=0, cache_path="cache", ffmpeg_location="/usr/bin/mediaextract" log_group_id=0, cache_path="cache", ffmpeg_location="/usr/bin/mediaextract"
) as ytdl: ) as ytdl:
x = await ytdl.parse(url) try:
if x is None: x = await ytdl.parse(url)
return await message.reply("Failed parse URL, check logs..") except Exception err:
return await message.reply(f"<code>{err}</code>")
img = await get_ytthumb(x.key) img = await get_ytthumb(x.key)
caption = x.caption caption = x.caption
markup = x.buttons markup = x.buttons