forked from pili-engineering/pili-sdk-python
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexample.py
31 lines (21 loc) · 786 Bytes
/
example.py
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
import pili, time
mac = pili.Mac("AccessKey", "SecretKey")
print pili.rtmp_publish_url("publish-rtmp.test.com", "PiliTest", "streamkey", mac, 60)
print pili.rtmp_play_url("live-rtmp.test.com", "PiliTest", "streamkey")
print pili.hls_play_url("live-rtmp.test.com", "PiliTest", "streamkey")
print pili.hdl_play_url("live-rtmp.test.com", "PiliTest", "streamkey")
print pili.snapshot_play_url("live-rtmp.test.com", "PiliTest", "streamkey")
client = pili.Client(mac)
hub = client.hub("PiliTest")
ss = hub.list(liveonly=True)
for i in ss["items"]:
print i.key
stream = hub.get("test1234")
print stream.to_json()
stream.disable()
print stream.refresh().to_json()
stream.enable()
print stream.refresh().to_json()
print stream.status()
print stream.history()
print stream.saveas()