forked from saermart/DouyinLiveWebFetcher
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
31 lines (23 loc) · 656 Bytes
/
Copy pathmain.py
File metadata and controls
31 lines (23 loc) · 656 Bytes
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
#!/usr/bin/python
# coding:utf-8
# @FileName: main.py
# @Time: 2024/1/2 22:27
# @Author: bubu
# @Project: douyinLiveWebFetcher
import signal
from liveMan import DouyinLiveWebFetcher
room: DouyinLiveWebFetcher
def signal_handler(sig, frame):
print("Received signal:", sig)
if room:
room.stop()
if __name__ == '__main__':
signal.signal(signal.SIGINT, signal_handler)
signal.signal(signal.SIGTERM, signal_handler)
try:
live_id = '510200350291'
room = DouyinLiveWebFetcher(live_id)
# room.get_room_status() # 失效
room.start()
except Exception as e:
print(e)