mirror of
https://github.com/MichaByte/OnBoard-Live.git
synced 2025-12-06 08:13:41 -05:00
Initial commit
This commit is contained in:
commit
5ad56fac3f
21 changed files with 808 additions and 0 deletions
30
stream/keygen/main.py
Normal file
30
stream/keygen/main.py
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
import secrets
|
||||
import requests
|
||||
import pickle
|
||||
|
||||
users = {}
|
||||
|
||||
with open('users.dat', 'rb') as f:
|
||||
users = pickle.load(f)
|
||||
|
||||
def add_stream(stream):
|
||||
requests.post('http://127.0.0.1:9997/v3/config/paths/add/' + stream, json={'name': stream})
|
||||
|
||||
def main():
|
||||
print(users)
|
||||
for user in users.values():
|
||||
add_stream(user)
|
||||
while True:
|
||||
new_user = input('Enter new user\'s Slack ID: ')
|
||||
if new_user in users:
|
||||
print('User already exists.')
|
||||
continue
|
||||
users[new_user] = secrets.token_hex(32)
|
||||
print(users[new_user])
|
||||
add_stream(users[new_user])
|
||||
with open('users.dat', 'wb') as f:
|
||||
pickle.dump(users, f)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
Loading…
Add table
Add a link
Reference in a new issue