add simple system to ignore users
This commit is contained in:
parent
f64f72cf7f
commit
84b7115fc7
1 changed files with 9 additions and 2 deletions
|
@ -54,6 +54,12 @@ def get_parser():
|
||||||
help="Set tokens list",
|
help="Set tokens list",
|
||||||
nargs="*"
|
nargs="*"
|
||||||
)
|
)
|
||||||
|
parser.add_argument(
|
||||||
|
"--ignore",
|
||||||
|
help="List of ignored users",
|
||||||
|
nargs="*",
|
||||||
|
default=[]
|
||||||
|
)
|
||||||
return parser
|
return parser
|
||||||
|
|
||||||
|
|
||||||
|
@ -71,7 +77,8 @@ def main():
|
||||||
tokens = args.tokens
|
tokens = args.tokens
|
||||||
is_streaming = False
|
is_streaming = False
|
||||||
stream_always = args.stream
|
stream_always = args.stream
|
||||||
|
ignored_users = args.ignore
|
||||||
|
|
||||||
# Spin up a client and connect to mumble server
|
# Spin up a client and connect to mumble server
|
||||||
mumble = pymumble.Mumble(server, nick, password=pwd, port=port, tokens=tokens)
|
mumble = pymumble.Mumble(server, nick, password=pwd, port=port, tokens=tokens)
|
||||||
|
|
||||||
|
@ -102,7 +109,7 @@ def main():
|
||||||
|
|
||||||
try:
|
try:
|
||||||
for user in mumble.users.values(): # check the audio queue of each user
|
for user in mumble.users.values(): # check the audio queue of each user
|
||||||
if user.sound.is_sound():
|
if user.sound.is_sound() and user["name"] not in ignored_users:
|
||||||
# available sound is to be treated now and not later
|
# available sound is to be treated now and not later
|
||||||
sound = user.sound.get_sound(FLOAT_RESOLUTION)
|
sound = user.sound.get_sound(FLOAT_RESOLUTION)
|
||||||
stereo_pcm = audioop.tostereo(sound.pcm, 2, 1, 1)
|
stereo_pcm = audioop.tostereo(sound.pcm, 2, 1, 1)
|
||||||
|
|
Loading…
Reference in a new issue