]>
jfr.im git - yt-dlp.git/blob - yt_dlp/downloader/fc2.py
3 from .common
import FileDownloader
4 from .external
import FFmpegFD
7 class FC2LiveFD(FileDownloader
):
9 Downloads FC2 live without being stopped. <br>
10 Note, this is not a part of public API, and will be removed without notice.
14 def real_download(self
, filename
, info_dict
):
17 heartbeat_lock
= threading
.Lock()
18 heartbeat_state
= [None, 1]
22 heartbeat_state
[1] += 1
23 ws
.send('{"name":"heartbeat","arguments":{},"id":%d}' % heartbeat_state
[1])
25 self
.to_screen('[fc2:live] Heartbeat failed')
28 heartbeat_state
[0] = threading
.Timer(30, heartbeat
)
29 heartbeat_state
[0]._daemonic
= True
30 heartbeat_state
[0].start()
34 new_info_dict
= info_dict
.copy()
35 new_info_dict
.update({
37 'protocol': 'live_ffmpeg',
39 return FFmpegFD(self
.ydl
, self
.params
or {}).download(filename
, new_info_dict
)