forked from j62/ctbrec
1
0
Fork 0

Improve logging

This commit is contained in:
0xboobface 2019-12-29 20:50:34 +01:00
parent e0f494d6da
commit b37178170b
3 changed files with 16 additions and 4 deletions

View File

@ -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(),

View File

@ -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());
} }

View File

@ -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;