mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-07 12:24:51 +00:00
Fix
This commit is contained in:
parent
c3902d0c9f
commit
222c4889ea
1 changed files with 2 additions and 9 deletions
|
|
@ -24,14 +24,8 @@ async def ddl_mediainfo(_, message, url):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
try:
|
try:
|
||||||
filename = re.search(".+/(.+)", url).group(1)
|
|
||||||
reply_msg = await kirimPesan(message, "Generating Mediainfo, Please wait..", quote=True)
|
reply_msg = await kirimPesan(message, "Generating Mediainfo, Please wait..", quote=True)
|
||||||
|
output_ = await runcmd(f'mediainfo "{url}"')
|
||||||
with requests.get(url, stream=True) as r:
|
|
||||||
with open(filename, 'wb') as f:
|
|
||||||
for chunk in r.iter_content(50000000): f.write(chunk); break
|
|
||||||
|
|
||||||
output_ = await runcmd(f'mediainfo "{filename}"')
|
|
||||||
out = output_[0] if len(output_) != 0 else None
|
out = output_[0] if len(output_) != 0 else None
|
||||||
content = f"""
|
content = f"""
|
||||||
MissKatyBot MediaInfo
|
MissKatyBot MediaInfo
|
||||||
|
|
@ -41,8 +35,7 @@ DETAILS
|
||||||
"""
|
"""
|
||||||
output = await post_to_telegraph(False, "MissKaty MediaInfo", content)
|
output = await post_to_telegraph(False, "MissKaty MediaInfo", content)
|
||||||
|
|
||||||
await editPesan(reply_msg, f"**File Name :** `{unquote(filename)}`\n\n**Mediainfo :** {output}", disable_web_page_preview=True)
|
await editPesan(reply_msg, f"**Link :** `{url}`\n\n**Mediainfo :** {output}", disable_web_page_preview=True)
|
||||||
os.remove(filename)
|
|
||||||
|
|
||||||
except Exception as err:
|
except Exception as err:
|
||||||
await hapusPesan(reply_msg)
|
await hapusPesan(reply_msg)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue