Skip to content

Commit

Permalink
feat(server): run fallback capture if streamlink has read timeout
Browse files Browse the repository at this point in the history
related to #395
  • Loading branch information
MrBrax committed Dec 22, 2022
1 parent b7cbc13 commit e004b1f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions server/src/Core/Providers/Base/BaseAutomator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -951,6 +951,14 @@ export class BaseAutomator {

if (data.includes("Read timeout, exiting")) {
Log.logAdvanced(Log.Level.ERROR, "automator.captureVideo", `Read timeout, exiting for ${basename}!`);
if (KeyValue.getInstance().getBool(`${this.broadcaster_user_login}.online`)) {
this.fallbackCapture().then(() => {
Log.logAdvanced(Log.Level.INFO, "automator.captureVideo", `Fallback capture finished for ${this.getLogin()}`);
}).catch(error => {
Log.logAdvanced(Log.Level.ERROR, "automator.captureVideo", `Fallback capture failed for ${this.getLogin()}: ${(error as Error).message}`);
console.error(error);
});
}
}

if (data.includes("Stream ended")) {
Expand Down

0 comments on commit e004b1f

Please sign in to comment.