Distinguish between performer_id and display_name for LiveJasmin models
This commit is contained in:
parent
b6e4bad837
commit
ee302e49a4
11
CHANGELOG.md
11
CHANGELOG.md
|
@ -1,3 +1,14 @@
|
|||
3.8.5
|
||||
========================
|
||||
* Fixed Stripchat followed tab. It didn't work, if you have many favorited
|
||||
models
|
||||
* Fixed: Some Stripchat models didn't get recorded
|
||||
* Fixed: Some LiveJasmin models didn't get recorded
|
||||
* Added support for temporary recordings. On the recording tab you can now set
|
||||
a date, when to stop recording a model and what to do afterwards
|
||||
(pause or remove remove the model)
|
||||
* Changed the look of the of the model table in the web interface a bit
|
||||
|
||||
3.8.4
|
||||
========================
|
||||
* Added support for xHamsterLive (go to Settings -> Sites -> Stripchat,
|
||||
|
|
|
@ -141,8 +141,6 @@ public class CamrecApplication extends Application {
|
|||
}
|
||||
|
||||
private void startOnlineMonitor() {
|
||||
onlineMonitor = new OnlineMonitor(recorder);
|
||||
onlineMonitor.start();
|
||||
for (Site site : sites) {
|
||||
if(site.isEnabled()) {
|
||||
try {
|
||||
|
@ -153,6 +151,8 @@ public class CamrecApplication extends Application {
|
|||
}
|
||||
}
|
||||
}
|
||||
onlineMonitor = new OnlineMonitor(recorder);
|
||||
onlineMonitor.start();
|
||||
}
|
||||
|
||||
private void logEnvironment() {
|
||||
|
|
|
@ -5,6 +5,7 @@ import static ctbrec.io.HttpConstants.*;
|
|||
import java.io.IOException;
|
||||
import java.net.URLEncoder;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.regex.Matcher;
|
||||
|
@ -13,6 +14,8 @@ import java.util.regex.Pattern;
|
|||
import org.json.JSONObject;
|
||||
import org.jsoup.nodes.Element;
|
||||
import org.jsoup.select.Elements;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import ctbrec.Config;
|
||||
import ctbrec.Model;
|
||||
|
@ -27,6 +30,7 @@ import okhttp3.Response;
|
|||
|
||||
public class LiveJasmin extends AbstractSite {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(LiveJasmin.class);
|
||||
public static String baseUrl = "";
|
||||
public static String baseDomain = "";
|
||||
private HttpClient httpClient;
|
||||
|
@ -169,7 +173,8 @@ public class LiveJasmin extends AbstractSite {
|
|||
}
|
||||
return models;
|
||||
} else {
|
||||
throw new IOException("Response was not successful: " + url + "\n" + body);
|
||||
LOG.debug("Response was not successful: {}\n{}", url, body);
|
||||
return Collections.emptyList();
|
||||
}
|
||||
} else {
|
||||
throw new HttpException(response.code(), response.message());
|
||||
|
@ -198,7 +203,7 @@ public class LiveJasmin extends AbstractSite {
|
|||
String name = m.group(1);
|
||||
return createModel(name);
|
||||
}
|
||||
m = Pattern.compile("http.*?livejasmin\\.com.*?/chat-html5/(.*)").matcher(url);
|
||||
m = Pattern.compile("http.*?livejasmin\\.com.*?/chat(?:-html5)?/(.*)").matcher(url);
|
||||
if(m.find()) {
|
||||
String name = m.group(1);
|
||||
return createModel(name);
|
||||
|
|
|
@ -72,6 +72,8 @@ public class LiveJasminModel extends AbstractModel {
|
|||
JSONObject config = data.getJSONObject("config");
|
||||
JSONObject chatRoom = config.getJSONObject("chatRoom");
|
||||
setId(chatRoom.getString("p_id"));
|
||||
setName(chatRoom.getString("performer_id"));
|
||||
setDisplayName(chatRoom.getString("display_name"));
|
||||
if (chatRoom.has("profile_picture_url")) {
|
||||
setPreview(chatRoom.getString("profile_picture_url"));
|
||||
}
|
||||
|
@ -80,11 +82,14 @@ public class LiveJasminModel extends AbstractModel {
|
|||
if (chatRoom.optInt("is_on_private", 0) == 1) {
|
||||
onlineState = State.PRIVATE;
|
||||
}
|
||||
if (chatRoom.optInt("is_video_call_enabled", 0) == 1) {
|
||||
onlineState = State.PRIVATE;
|
||||
}
|
||||
resolution = new int[2];
|
||||
resolution[0] = config.optInt("streamWidth");
|
||||
resolution[1] = config.optInt("streamHeight");
|
||||
online = onlineState == State.ONLINE;
|
||||
LOG.trace("{} - status:{} {} {} {}", getName(), online, onlineState, Arrays.toString(resolution), getUrl());
|
||||
LOG.trace("{} - status:{} {} {} {} {}", getName(), online, onlineState, Arrays.toString(resolution), getUrl(), id);
|
||||
} else {
|
||||
throw new IOException("Response was not successful: " + body);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue