mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-14 11:07:56 +01:00
[downloader/fc2] Stop heatbeating once FFmpeg finishes
Authored by: Lesmiscore
This commit is contained in:
parent
acbc642250
commit
69b59b4b4b
@ -18,6 +18,9 @@ def real_download(self, filename, info_dict):
|
|||||||
heartbeat_state = [None, 1]
|
heartbeat_state = [None, 1]
|
||||||
|
|
||||||
def heartbeat():
|
def heartbeat():
|
||||||
|
if heartbeat_state[1] < 0:
|
||||||
|
return
|
||||||
|
|
||||||
try:
|
try:
|
||||||
heartbeat_state[1] += 1
|
heartbeat_state[1] += 1
|
||||||
ws.send('{"name":"heartbeat","arguments":{},"id":%d}' % heartbeat_state[1])
|
ws.send('{"name":"heartbeat","arguments":{},"id":%d}' % heartbeat_state[1])
|
||||||
@ -36,4 +39,8 @@ def heartbeat():
|
|||||||
'ws': None,
|
'ws': None,
|
||||||
'protocol': 'live_ffmpeg',
|
'protocol': 'live_ffmpeg',
|
||||||
})
|
})
|
||||||
|
try:
|
||||||
return FFmpegFD(self.ydl, self.params or {}).download(filename, new_info_dict)
|
return FFmpegFD(self.ydl, self.params or {}).download(filename, new_info_dict)
|
||||||
|
finally:
|
||||||
|
# stop heartbeating
|
||||||
|
heartbeat_state[1] = -1
|
||||||
|
Loading…
Reference in New Issue
Block a user