Add more logging to Cam4Model

This commit is contained in:
0xb00bface 2020-12-20 20:46:01 +01:00
parent 3b8022df87
commit 6875de9b14
1 changed files with 3 additions and 1 deletions

View File

@ -53,7 +53,7 @@ public class Cam4Model extends AbstractModel {
if (ignoreCache || onlineState == UNKNOWN) {
try {
loadModelDetails();
getPlaylistUrl();
LOG.info("Final playlist URL for {} {}", getName(), getPlaylistUrl());
} catch (Exception e) {
onlineState = OFFLINE;
}
@ -123,6 +123,7 @@ public class Cam4Model extends AbstractModel {
if (m.find()) {
playlistUrl = m.group(1);
} else {
LOG.debug("hlsURl not in page");
getPlaylistUrlFromStreamUrl();
}
if (playlistUrl == null) {
@ -134,6 +135,7 @@ public class Cam4Model extends AbstractModel {
private void getPlaylistUrlFromStreamUrl() throws IOException {
String url = getSite().getBaseUrl() + "/_profile/streamURL?username=" + getName();
LOG.debug("Getting playlist url from {}", url);
Request req = new Request.Builder() // @formatter:off
.url(url)
.header(USER_AGENT, Config.getInstance().getSettings().httpUserAgent)