File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
import asyncio
2
2
import threading
3
+ from collections import defaultdict
3
4
from datetime import datetime , timedelta
4
5
5
6
from ..messages .message_pusher import MessagePusher
@@ -27,6 +28,7 @@ def __init__(self, app):
27
28
self ._ = {}
28
29
self .load ()
29
30
self .initialize_dynamic_state ()
31
+ self .platform_semaphores = defaultdict (lambda : asyncio .Semaphore (3 ))
30
32
31
33
@property
32
34
def recordings (self ):
@@ -248,9 +250,11 @@ async def check_if_live(self, recording: Recording):
248
250
"quality" : recording .quality ,
249
251
}
250
252
253
+ semaphore = self .platform_semaphores [platform_key ]
251
254
recorder = LiveStreamRecorder (self .app , recording , recording_info )
252
- stream_info = await recorder .fetch_stream ()
253
- logger .info (f"Stream Data: { stream_info } " )
255
+ async with semaphore :
256
+ stream_info = await recorder .fetch_stream ()
257
+ logger .info (f"Stream Data: { stream_info } " )
254
258
if not stream_info or not stream_info .anchor_name :
255
259
logger .error (f"Fetch stream data failed: { recording .url } " )
256
260
recording .is_checking = False
You can’t perform that action at this time.
0 commit comments