This repository was archived by the owner on Sep 18, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathvsyt.py
More file actions
38 lines (36 loc) · 1.33 KB
/
vsyt.py
File metadata and controls
38 lines (36 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import json
import os
import pytchat
from pytchat import *
import setup
from setup import *
if os.path.exists('customfunc.py'):
import customfunc
from customfunc import *
async def main():
try:
websocket = await websockets.connect('ws://127.0.0.1:8001')
except:
print("Couldn't connect to vtube studio")
input("press enter to quit program")
quit()
cmm = await setup(websocket)
###############################################
# Main loops for yt #
###############################################
op=input("input streamid ")
chat = pytchat.create(video_id=op)
while True:
while chat.is_alive():
for c in chat.get().sync_items():
print(f"{c.datetime} [{c.author.name}]- {c.message}")
for key in cmm['COMMANDS']:
if f"{c.message}" == key:
mdinf = await getmd(websocket)
s = mdinf["data"]["modelPosition"]["size"]
r = mdinf["data"]["modelPosition"]["rotation"]
x = mdinf["data"]["modelPosition"]["positionX"]
y = mdinf["data"]["modelPosition"]["positionY"]
cm = cmm['COMMANDS'][key]
await eval(cm)
asyncio.run(main())