lossless1024 / StreaMonitor

Adult live stream downloader for advanced people. I could have chosen a better name.
GNU General Public License v3.0
198 stars 52 forks source link

Online Check #91

Closed iLeeaal closed 1 year ago

iLeeaal commented 1 year ago

Is it recommended to check every 5 minutes? I mean, if the livestream goes down, can the program identify it and come back quickly or only after those 5 minutes?

DerBunteBall commented 1 year ago

StreaMonitor doesn't check the status while recording.

Every monitored streamer in StreaMonitor is a Thread. This Thread does the following:

  1. Checking status
  2. If getting online start recording
  3. if 2 completes restarting 1

This is done infinitly.

The only possibility for StreaMonitor to getting back into 1 is that ffmpeg as a subprocess exits cleanly. This is often the case but not always.

StreaMonitor has no ability to monitor if an ffmpeg process hangs. If this happens the thread hangs and will never go back to 1. ffmpeg can run further after a stream closes. There are certain situations where it records repeating frames for minutes. The problem gets to wired results when e.g. the model switches on and off in a short time. For example because of internet connection loss. In this cases ffmpeg often stucks and the thread will never return to 1.

So if ffmpeg exits cleanly (model wenting offline) StreaMonitor should resume to normal operation. I'm not sure which time persiod is used then. It could be 5 minutes because StreaMonitor has a knowledge of shortly not seen or longer not seen. Eventually it uses 5 minutes because the thought is that a shortly not seen model has finished it's stream. You will never have a way to find out if a stream is normally ended or just stopped shortly. The problem is also given when switch to and from private shows.

In result you can get problems here definitly.

In my opinion StreaMonitor would need:

  1. A mechanism to monitor ffmpeg
  2. A seperation of status monitoring and stream downloading. So that it can e.g. monitor status switches of recording sessions and clean up ffmpeg proccesses which are stalled and make the reality constant (see 1 e.g. start ffmpeg new or stop stalled stuff when this conflicts with the actual presented status).

I know this is an unsatisfactory answer. But I think StreaMonitor actually hasn't the capabilites to solve the situation you are describing.