From 3b8f8043fb48bbed6f9452ffab032ead8409e7e6 Mon Sep 17 00:00:00 2001 From: levina <82658782+levina-lab@users.noreply.github.com> Date: Sat, 11 Dec 2021 15:42:51 +0700 Subject: [PATCH] some fixes --- driver/utils.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/driver/utils.py b/driver/utils.py index c31c532..5d6ce33 100644 --- a/driver/utils.py +++ b/driver/utils.py @@ -1,8 +1,7 @@ -from driver.queues import QUEUE, clear_queue, get_queue, pop_an_item from driver.veez import bot, call_py -from config import IMG_4 from pytgcalls.types import Update from pytgcalls.types.input_stream import AudioPiped, AudioVideoPiped +from driver.queues import QUEUE, clear_queue, get_queue, pop_an_item from pytgcalls.types.input_stream.quality import ( HighQualityAudio, HighQualityVideo, @@ -117,3 +116,15 @@ async def stream_end_handler(_, u: Update): await bot.send_message(chat_id, f"šŸ’” **Streaming next track**\n\nšŸ· **Name:** [{op[0]}]({op[1]}) | `{op[2]}`\nšŸ’­ **Chat:** `{chat_id}`", disable_web_page_preview=True, reply_markup=keyboard) else: pass + + +async def bash(cmd): + process = await asyncio.create_subprocess_shell( + cmd, + stdout=asyncio.subprocess.PIPE, + stderr=asyncio.subprocess.PIPE, + ) + stdout, stderr = await process.communicate() + err = stderr.decode().strip() + out = stdout.decode().strip() + return out, err