mirror of
https://github.com/TeamPGM/PagerMaid_Plugins_Pyro.git
synced 2024-11-22 11:06:37 +00:00
ytdl fix a bug
This commit is contained in:
parent
57c234eb7d
commit
fb62e4d654
@ -82,12 +82,13 @@ 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")
|
||||||
|
if result["status"]:
|
||||||
await message.safe_delete()
|
await message.safe_delete()
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user