forked from j62/ctbrec
Improve logging
This commit is contained in:
parent
e0f494d6da
commit
b37178170b
|
@ -241,7 +241,7 @@ public class NextGenLocalRecorder implements Recorder {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG.debug("Starting recording for model {}", model.getName());
|
LOG.info("Starting recording for model {}", model.getName());
|
||||||
Download download = model.createDownload();
|
Download download = model.createDownload();
|
||||||
download.init(config, model, Instant.now());
|
download.init(config, model, Instant.now());
|
||||||
Objects.requireNonNull(download.getStartTime(),
|
Objects.requireNonNull(download.getStartTime(),
|
||||||
|
|
|
@ -125,7 +125,7 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
|
||||||
throw new InvalidPlaylistException("Playlist has no media playlist");
|
throw new InvalidPlaylistException("Playlist has no media playlist");
|
||||||
} else {
|
} else {
|
||||||
// update playlist url in case the streaming server has switched or something
|
// update playlist url in case the streaming server has switched or something
|
||||||
LOG.debug("Loading segment playlist failed - trying to get a playlist URL");
|
LOG.debug("Loading segment playlist failed - trying to get a fresh playlist URL");
|
||||||
segmentsURL = getSegmentPlaylistUrl(getModel());
|
segmentsURL = getSegmentPlaylistUrl(getModel());
|
||||||
throw new HttpException(response.code(), response.message());
|
throw new HttpException(response.code(), response.message());
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,10 +154,22 @@ public class HlsDownload extends AbstractHlsDownload {
|
||||||
LOG.debug("Reached end of playlist for model {}", model);
|
LOG.debug("Reached end of playlist for model {}", model);
|
||||||
} catch (HttpException e) {
|
} catch (HttpException e) {
|
||||||
if (e.getResponseCode() == 404) {
|
if (e.getResponseCode() == 404) {
|
||||||
LOG.debug("Playlist not found (404). Model {} probably went offline", model);
|
ctbrec.Model.State modelState;
|
||||||
|
try {
|
||||||
|
modelState = model.getOnlineState(false);
|
||||||
|
} catch (ExecutionException e1) {
|
||||||
|
modelState = ctbrec.Model.State.UNKNOWN;
|
||||||
|
}
|
||||||
|
LOG.info("Playlist not found (404). Model {} probably went offline. Model state: {}", model, modelState);
|
||||||
waitSomeTime(10_000);
|
waitSomeTime(10_000);
|
||||||
} else if (e.getResponseCode() == 403) {
|
} else if (e.getResponseCode() == 403) {
|
||||||
LOG.debug("Playlist access forbidden (403). Model {} probably went private or offline", model);
|
ctbrec.Model.State modelState;
|
||||||
|
try {
|
||||||
|
modelState = model.getOnlineState(false);
|
||||||
|
} catch (ExecutionException e1) {
|
||||||
|
modelState = ctbrec.Model.State.UNKNOWN;
|
||||||
|
}
|
||||||
|
LOG.info("Playlist access forbidden (403). Model {} probably went private or offline. Model state: {}", model, modelState);
|
||||||
waitSomeTime(10_000);
|
waitSomeTime(10_000);
|
||||||
} else {
|
} else {
|
||||||
throw e;
|
throw e;
|
||||||
|
|
Loading…
Reference in New Issue