mirror of
https://github.com/mofeng-git/One-KVM.git
synced 2026-01-31 18:11:54 +08:00
show streamer version
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import os
|
||||
import asyncio
|
||||
import asyncio.subprocess
|
||||
|
||||
@@ -64,6 +65,18 @@ class Streamer: # pylint: disable=too-many-instance-attributes
|
||||
"quality": self.__quality,
|
||||
}
|
||||
|
||||
def get_app(self) -> str:
|
||||
return os.path.basename(self.__cmd[0])
|
||||
|
||||
async def get_version(self) -> str:
|
||||
proc = await asyncio.create_subprocess_exec(
|
||||
*[self.__cmd[0], "--version"],
|
||||
stdout=asyncio.subprocess.PIPE,
|
||||
stderr=asyncio.subprocess.DEVNULL,
|
||||
)
|
||||
(stdout, _) = await proc.communicate()
|
||||
return stdout.decode(errors="ignore").strip()
|
||||
|
||||
async def cleanup(self) -> None:
|
||||
if self.is_running():
|
||||
await self.stop()
|
||||
|
||||
Reference in New Issue
Block a user