mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-22 13:35:38 +00:00
ytdl fix a bug
This commit is contained in:
parent
57c234eb7d
commit
fb62e4d654
@ -82,13 +82,14 @@ async def start_download(message: Message, url: str):
|
|||||||
except Exception as e:
|
except Exception as e:
|
||||||
result["status"] = False
|
result["status"] = False
|
||||||
result["error"] = str(e)
|
result["error"] = str(e)
|
||||||
if not result["status"]:
|
else:
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(Exception):
|
||||||
await message.edit(f"下载/发送文件失败,发生错误:{result['error']}")
|
await message.edit(f"下载/发送文件失败,发生错误:{result['error']}")
|
||||||
ytdl_is_downloading = False
|
ytdl_is_downloading = False
|
||||||
with contextlib.suppress(Exception):
|
with contextlib.suppress(Exception):
|
||||||
shutil.rmtree("data/ytdl")
|
shutil.rmtree("data/ytdl")
|
||||||
await message.safe_delete()
|
if result["status"]:
|
||||||
|
await message.safe_delete()
|
||||||
|
|
||||||
|
|
||||||
@listener(command="ytdl",
|
@listener(command="ytdl",
|
||||||
|
Loading…
Reference in New Issue
Block a user