forked from j62/ctbrec
Merge branch 'dev'
This commit is contained in:
commit
80f4e53ed2
|
@ -1,3 +1,10 @@
|
||||||
|
1.17.1
|
||||||
|
========================
|
||||||
|
* Improved LiveJasmin recordings. Login is not required anymore (thanks to M1h43ly)
|
||||||
|
HD recordings should also work much better
|
||||||
|
* Added setting for the base URL for LiveJasmin
|
||||||
|
* Fixed CamSoda thumbnail overviews
|
||||||
|
|
||||||
1.17.0
|
1.17.0
|
||||||
========================
|
========================
|
||||||
* Added LiveJasmin
|
* Added LiveJasmin
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ctbrec</groupId>
|
<groupId>ctbrec</groupId>
|
||||||
<artifactId>master</artifactId>
|
<artifactId>master</artifactId>
|
||||||
<version>1.17.0</version>
|
<version>1.17.1</version>
|
||||||
<relativePath>../master</relativePath>
|
<relativePath>../master</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -132,6 +132,7 @@ public class ExternalBrowser implements AutoCloseable {
|
||||||
BufferedReader br = new BufferedReader(new InputStreamReader(in));
|
BufferedReader br = new BufferedReader(new InputStreamReader(in));
|
||||||
String line;
|
String line;
|
||||||
while( !Thread.interrupted() && (line = br.readLine()) != null ) {
|
while( !Thread.interrupted() && (line = br.readLine()) != null ) {
|
||||||
|
LOG.debug("Browser output: {}", line);
|
||||||
if(!line.startsWith("{")) {
|
if(!line.startsWith("{")) {
|
||||||
System.err.println(line);
|
System.err.println(line);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -84,8 +84,6 @@ public class CamsodaUpdateService extends PaginatedScheduledService {
|
||||||
} else {
|
} else {
|
||||||
String name = result.getString("username");
|
String name = result.getString("username");
|
||||||
CamsodaModel model = (CamsodaModel) camsoda.createModel(name);
|
CamsodaModel model = (CamsodaModel) camsoda.createModel(name);
|
||||||
if(result.has("server_prefix")) {
|
|
||||||
String serverPrefix = result.getString("server_prefix");
|
|
||||||
String streamName = result.getString("stream_name");
|
String streamName = result.getString("stream_name");
|
||||||
model.setSortOrder(result.getFloat("sort_value"));
|
model.setSortOrder(result.getFloat("sort_value"));
|
||||||
models.add(model);
|
models.add(model);
|
||||||
|
@ -102,13 +100,9 @@ public class CamsodaUpdateService extends PaginatedScheduledService {
|
||||||
model.setStreamUrl("https://" + edgeServers.getString(0) + "/cam/mp4:" + streamName + "_h264_aac_480p/playlist.m3u8");
|
model.setStreamUrl("https://" + edgeServers.getString(0) + "/cam/mp4:" + streamName + "_h264_aac_480p/playlist.m3u8");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(result.has("tsize")) {
|
if(result.has("thumb")) {
|
||||||
long unixtime = System.currentTimeMillis() / 1000;
|
String previewUrl = "https:" + result.getString("thumb");
|
||||||
String tsize = result.getString("tsize");
|
model.setPreview(previewUrl);
|
||||||
String preview = "https://thumbs-orig.camsoda.com/thumbs/"
|
|
||||||
+ streamName + '/' + serverPrefix + '/' + tsize + '/' + unixtime + '/' + name + ".jpg?cb=" + unixtime;
|
|
||||||
model.setPreview(preview);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -118,6 +112,7 @@ public class CamsodaUpdateService extends PaginatedScheduledService {
|
||||||
.limit(modelsPerPage)
|
.limit(modelsPerPage)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
} else {
|
} else {
|
||||||
|
LOG.debug("Response was not successful: {}", json.toString());
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -73,20 +73,17 @@ public class LiveJasminConfigUi extends AbstractConfigUI {
|
||||||
GridPane.setColumnSpan(password, 2);
|
GridPane.setColumnSpan(password, 2);
|
||||||
layout.add(password, 1, row++);
|
layout.add(password, 1, row++);
|
||||||
|
|
||||||
// layout.add(new Label("LiveJasmin Session ID"), 0, row);
|
layout.add(new Label("LiveJasmin Base URL"), 0, row);
|
||||||
// TextField sessionId = new TextField();
|
TextField baseUrl = new TextField();
|
||||||
// sessionId.setText(Config.getInstance().getSettings().livejasminSession);
|
baseUrl.setText(Config.getInstance().getSettings().livejasminBaseUrl);
|
||||||
// sessionId.textProperty().addListener((ob, o, n) -> {
|
baseUrl.textProperty().addListener((ob, o, n) -> {
|
||||||
// if(!n.equals(Config.getInstance().getSettings().livejasminSession)) {
|
Config.getInstance().getSettings().livejasminBaseUrl = baseUrl.getText();
|
||||||
// Config.getInstance().getSettings().livejasminSession = n;
|
save();
|
||||||
// save();
|
});
|
||||||
// }
|
GridPane.setFillWidth(baseUrl, true);
|
||||||
// });
|
GridPane.setHgrow(baseUrl, Priority.ALWAYS);
|
||||||
// GridPane.setFillWidth(sessionId, true);
|
GridPane.setColumnSpan(baseUrl, 2);
|
||||||
// GridPane.setHgrow(sessionId, Priority.ALWAYS);
|
layout.add(baseUrl, 1, row++);
|
||||||
// GridPane.setColumnSpan(sessionId, 2);
|
|
||||||
// GridPane.setMargin(sessionId, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
|
||||||
// layout.add(sessionId, 1, row++);
|
|
||||||
|
|
||||||
Button createAccount = new Button("Create new Account");
|
Button createAccount = new Button("Create new Account");
|
||||||
createAccount.setOnAction((e) -> DesktopIntegration.open(liveJasmin.getAffiliateLink()));
|
createAccount.setOnAction((e) -> DesktopIntegration.open(liveJasmin.getAffiliateLink()));
|
||||||
|
@ -94,6 +91,7 @@ public class LiveJasminConfigUi extends AbstractConfigUI {
|
||||||
GridPane.setColumnSpan(createAccount, 2);
|
GridPane.setColumnSpan(createAccount, 2);
|
||||||
GridPane.setMargin(username, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
GridPane.setMargin(username, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
||||||
GridPane.setMargin(password, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
GridPane.setMargin(password, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
||||||
|
GridPane.setMargin(baseUrl, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
||||||
GridPane.setMargin(createAccount, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
GridPane.setMargin(createAccount, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
||||||
|
|
||||||
username.setPrefWidth(300);
|
username.setPrefWidth(300);
|
||||||
|
|
|
@ -20,7 +20,7 @@ import okhttp3.HttpUrl;
|
||||||
public class LiveJasminElectronLoginDialog {
|
public class LiveJasminElectronLoginDialog {
|
||||||
|
|
||||||
private static final transient Logger LOG = LoggerFactory.getLogger(LiveJasminElectronLoginDialog.class);
|
private static final transient Logger LOG = LoggerFactory.getLogger(LiveJasminElectronLoginDialog.class);
|
||||||
public static final String URL = LiveJasmin.BASE_URL + "/en/auth/login";
|
public static final String URL = LiveJasmin.baseUrl + "/en/auth/login";
|
||||||
private CookieJar cookieJar;
|
private CookieJar cookieJar;
|
||||||
private ExternalBrowser browser;
|
private ExternalBrowser browser;
|
||||||
|
|
||||||
|
@ -77,12 +77,12 @@ public class LiveJasminElectronLoginDialog {
|
||||||
JSONObject cookie = _cookies.getJSONObject(i);
|
JSONObject cookie = _cookies.getJSONObject(i);
|
||||||
Builder b = new Cookie.Builder()
|
Builder b = new Cookie.Builder()
|
||||||
.path("/")
|
.path("/")
|
||||||
.domain("livejasmin.com")
|
.domain(LiveJasmin.baseDomain)
|
||||||
.name(cookie.getString("name"))
|
.name(cookie.getString("name"))
|
||||||
.value(cookie.getString("value"))
|
.value(cookie.getString("value"))
|
||||||
.expiresAt(0);
|
.expiresAt(0);
|
||||||
Cookie c = b.build();
|
Cookie c = b.build();
|
||||||
cookieJar.saveFromResponse(HttpUrl.parse(LiveJasmin.BASE_URL), Collections.singletonList(c));
|
cookieJar.saveFromResponse(HttpUrl.parse(LiveJasmin.baseUrl), Collections.singletonList(c));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(url.contains("/member/")) {
|
if(url.contains("/member/")) {
|
||||||
|
|
|
@ -38,9 +38,13 @@ public class LiveJasminFollowedUpdateService extends PaginatedScheduledService {
|
||||||
return new Task<List<Model>>() {
|
return new Task<List<Model>>() {
|
||||||
@Override
|
@Override
|
||||||
public List<Model> call() throws IOException {
|
public List<Model> call() throws IOException {
|
||||||
|
if(!liveJasmin.credentialsAvailable()) {
|
||||||
|
throw new RuntimeException("Credentials missing");
|
||||||
|
}
|
||||||
|
|
||||||
boolean loggedIn = SiteUiFactory.getUi(liveJasmin).login();
|
boolean loggedIn = SiteUiFactory.getUi(liveJasmin).login();
|
||||||
if(!loggedIn) {
|
if(!loggedIn) {
|
||||||
throw new RuntimeException("Couldn't login on livejasmin.com");
|
throw new RuntimeException("Couldn't login to livejasmin");
|
||||||
}
|
}
|
||||||
//String _url = url + ((page-1) * 36); // TODO find out how to switch pages
|
//String _url = url + ((page-1) * 36); // TODO find out how to switch pages
|
||||||
//LOG.debug("Fetching page {}", url);
|
//LOG.debug("Fetching page {}", url);
|
||||||
|
|
|
@ -4,7 +4,6 @@ import java.io.IOException;
|
||||||
|
|
||||||
import ctbrec.Config;
|
import ctbrec.Config;
|
||||||
import ctbrec.sites.Site;
|
import ctbrec.sites.Site;
|
||||||
import ctbrec.ui.DesktopIntegration;
|
|
||||||
import ctbrec.ui.PaginatedScheduledService;
|
import ctbrec.ui.PaginatedScheduledService;
|
||||||
import ctbrec.ui.ThumbOverviewTab;
|
import ctbrec.ui.ThumbOverviewTab;
|
||||||
import javafx.concurrent.WorkerStateEvent;
|
import javafx.concurrent.WorkerStateEvent;
|
||||||
|
@ -17,20 +16,16 @@ import javafx.scene.input.KeyEvent;
|
||||||
public class LiveJasminTab extends ThumbOverviewTab {
|
public class LiveJasminTab extends ThumbOverviewTab {
|
||||||
protected Label status;
|
protected Label status;
|
||||||
protected Button acknowledge = new Button("That's alright");
|
protected Button acknowledge = new Button("That's alright");
|
||||||
private Button createAccount = new Button("Create Account");
|
|
||||||
private boolean betaAcknowledged = Config.getInstance().getSettings().livejasminBetaAcknowledged;
|
private boolean betaAcknowledged = Config.getInstance().getSettings().livejasminBetaAcknowledged;
|
||||||
|
|
||||||
public LiveJasminTab(String title, PaginatedScheduledService updateService, Site site) {
|
public LiveJasminTab(String title, PaginatedScheduledService updateService, Site site) {
|
||||||
super(title, updateService, site);
|
super(title, updateService, site);
|
||||||
if(!betaAcknowledged) {
|
if(!betaAcknowledged) {
|
||||||
status = new Label("LiveJasmin is not fully functional. Live previews do not work.\n"
|
status = new Label("LiveJasmin is not fully functional. Live previews do not work.");
|
||||||
+ "Also make sure, that you have an account and that you have entered your credentials.\n"
|
|
||||||
+ "Otherwise you might get errors.");
|
|
||||||
grid.getChildren().add(status);
|
grid.getChildren().add(status);
|
||||||
grid.getChildren().add(acknowledge);
|
grid.getChildren().add(acknowledge);
|
||||||
grid.getChildren().add(createAccount);
|
|
||||||
} else {
|
} else {
|
||||||
status = new Label("Logging in...");
|
status = new Label("Loading...");
|
||||||
grid.getChildren().add(status);
|
grid.getChildren().add(status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -41,17 +36,14 @@ public class LiveJasminTab extends ThumbOverviewTab {
|
||||||
Config.getInstance().save();
|
Config.getInstance().save();
|
||||||
} catch (IOException e1) {
|
} catch (IOException e1) {
|
||||||
}
|
}
|
||||||
status.setText("Logging in...");
|
status.setText("Loading...");
|
||||||
grid.getChildren().remove(acknowledge);
|
grid.getChildren().remove(acknowledge);
|
||||||
grid.getChildren().remove(createAccount);
|
|
||||||
if(updateService != null) {
|
if(updateService != null) {
|
||||||
updateService.cancel();
|
updateService.cancel();
|
||||||
updateService.reset();
|
updateService.reset();
|
||||||
updateService.restart();
|
updateService.restart();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
createAccount.setOnAction(e -> DesktopIntegration.open(site.getAffiliateLink()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -64,7 +56,6 @@ public class LiveJasminTab extends ThumbOverviewTab {
|
||||||
if(Config.getInstance().getSettings().livejasminBetaAcknowledged) {
|
if(Config.getInstance().getSettings().livejasminBetaAcknowledged) {
|
||||||
grid.getChildren().remove(status);
|
grid.getChildren().remove(status);
|
||||||
grid.getChildren().remove(acknowledge);
|
grid.getChildren().remove(acknowledge);
|
||||||
grid.getChildren().remove(createAccount);
|
|
||||||
super.onSuccess();
|
super.onSuccess();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -72,9 +63,8 @@ public class LiveJasminTab extends ThumbOverviewTab {
|
||||||
@Override
|
@Override
|
||||||
protected void onFail(WorkerStateEvent event) {
|
protected void onFail(WorkerStateEvent event) {
|
||||||
if(Config.getInstance().getSettings().livejasminBetaAcknowledged) {
|
if(Config.getInstance().getSettings().livejasminBetaAcknowledged) {
|
||||||
status.setText("Login failed");
|
status.setText("Error");
|
||||||
grid.getChildren().remove(acknowledge);
|
grid.getChildren().remove(acknowledge);
|
||||||
grid.getChildren().remove(createAccount);
|
|
||||||
super.onFail(event);
|
super.onFail(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,10 +23,10 @@ public class LiveJasminTabProvider extends TabProvider {
|
||||||
public List<Tab> getTabs(Scene scene) {
|
public List<Tab> getTabs(Scene scene) {
|
||||||
List<Tab> tabs = new ArrayList<>();
|
List<Tab> tabs = new ArrayList<>();
|
||||||
|
|
||||||
tabs.add(createTab("Girls", liveJasmin.getBaseUrl() + "/en/girls/?listPageOrderType=most_popular"));
|
tabs.add(createTab("Girls", liveJasmin.getBaseUrl() + "/en/girl/?listPageOrderType=most_popular"));
|
||||||
tabs.add(createTab("Girls HD", liveJasmin.getBaseUrl() + "/en/girls/hd/?listPageOrderType=most_popular"));
|
tabs.add(createTab("Girls HD", liveJasmin.getBaseUrl() + "/en/girl/hd/?listPageOrderType=most_popular"));
|
||||||
tabs.add(createTab("Boys", liveJasmin.getBaseUrl() + "/en/boys/?listPageOrderType=most_popular"));
|
tabs.add(createTab("Boys", liveJasmin.getBaseUrl() + "/en/boy/?listPageOrderType=most_popular"));
|
||||||
tabs.add(createTab("Boys HD", liveJasmin.getBaseUrl() + "/en/boys/hd/?listPageOrderType=most_popular"));
|
tabs.add(createTab("Boys HD", liveJasmin.getBaseUrl() + "/en/boy/hd/?listPageOrderType=most_popular"));
|
||||||
|
|
||||||
followedTab = new LiveJasminFollowedTab(liveJasmin);
|
followedTab = new LiveJasminFollowedTab(liveJasmin);
|
||||||
followedTab.setRecorder(liveJasmin.getRecorder());
|
followedTab.setRecorder(liveJasmin.getRecorder());
|
||||||
|
|
|
@ -40,28 +40,24 @@ public class LiveJasminUpdateService extends PaginatedScheduledService {
|
||||||
protected Task<List<Model>> createTask() {
|
protected Task<List<Model>> createTask() {
|
||||||
return new Task<List<Model>>() {
|
return new Task<List<Model>>() {
|
||||||
@Override
|
@Override
|
||||||
public List<Model> call() throws IOException, NotLoggedInExcetion {
|
public List<Model> call() throws IOException {
|
||||||
//String _url = url + ((page-1) * 36); // TODO find out how to switch pages
|
|
||||||
if(!liveJasmin.credentialsAvailable() || !SiteUiFactory.getUi(liveJasmin).login()) {
|
|
||||||
throw new NotLoggedInExcetion();
|
|
||||||
}
|
|
||||||
|
|
||||||
// sort by popularity
|
// sort by popularity
|
||||||
CookieJarImpl cookieJar = liveJasmin.getHttpClient().getCookieJar();
|
CookieJarImpl cookieJar = liveJasmin.getHttpClient().getCookieJar();
|
||||||
Cookie sortCookie = new Cookie.Builder()
|
Cookie sortCookie = new Cookie.Builder()
|
||||||
.domain("livejasmin.com")
|
.domain(LiveJasmin.baseDomain)
|
||||||
.name("listPageOrderType")
|
.name("listPageOrderType")
|
||||||
.value("most_popular")
|
.value("most_popular")
|
||||||
.build();
|
.build();
|
||||||
cookieJar.saveFromResponse(HttpUrl.parse("https://livejasmin.com"), Collections.singletonList(sortCookie));
|
cookieJar.saveFromResponse(HttpUrl.parse("https://" + LiveJasmin.baseDomain), Collections.singletonList(sortCookie));
|
||||||
|
|
||||||
|
// TODO find out how to switch pages
|
||||||
LOG.debug("Fetching page {}", url);
|
LOG.debug("Fetching page {}", url);
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
.addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgent)
|
.addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgent)
|
||||||
.addHeader("Accept", "application/json, text/javascript, */*")
|
.addHeader("Accept", "application/json, text/javascript, */*")
|
||||||
.addHeader("Accept-Language", "en")
|
.addHeader("Accept-Language", "en")
|
||||||
.addHeader("Referer", liveJasmin.getBaseUrl() + "/en/girls/")
|
.addHeader("Referer", liveJasmin.getBaseUrl())
|
||||||
.addHeader("X-Requested-With", "XMLHttpRequest")
|
.addHeader("X-Requested-With", "XMLHttpRequest")
|
||||||
.build();
|
.build();
|
||||||
try (Response response = liveJasmin.getHttpClient().execute(request)) {
|
try (Response response = liveJasmin.getHttpClient().execute(request)) {
|
||||||
|
|
|
@ -1,5 +0,0 @@
|
||||||
package ctbrec.ui.sites.jasmin;
|
|
||||||
|
|
||||||
public class NotLoggedInExcetion extends Exception {
|
|
||||||
|
|
||||||
}
|
|
|
@ -8,7 +8,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ctbrec</groupId>
|
<groupId>ctbrec</groupId>
|
||||||
<artifactId>master</artifactId>
|
<artifactId>master</artifactId>
|
||||||
<version>1.17.0</version>
|
<version>1.17.1</version>
|
||||||
<relativePath>../master</relativePath>
|
<relativePath>../master</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -65,6 +65,7 @@ public class Settings {
|
||||||
public String cam4Password = "";
|
public String cam4Password = "";
|
||||||
public String livejasminUsername = "";
|
public String livejasminUsername = "";
|
||||||
public String livejasminPassword = "";
|
public String livejasminPassword = "";
|
||||||
|
public String livejasminBaseUrl = "https://www.livejasmin.com";
|
||||||
public boolean livejasminBetaAcknowledged = false;
|
public boolean livejasminBetaAcknowledged = false;
|
||||||
public String streamateUsername = "";
|
public String streamateUsername = "";
|
||||||
public String streamatePassword = "";
|
public String streamatePassword = "";
|
||||||
|
@ -103,4 +104,5 @@ public class Settings {
|
||||||
public String recordingsSortColumn = "";
|
public String recordingsSortColumn = "";
|
||||||
public String recordingsSortType = "";
|
public String recordingsSortType = "";
|
||||||
public double[] recordingsColumnWidths = new double[0];
|
public double[] recordingsColumnWidths = new double[0];
|
||||||
|
public boolean generatePlaylist = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,4 +27,31 @@ public class StringUtil {
|
||||||
}
|
}
|
||||||
return df.format(size) + ' ' + unit;
|
return df.format(size) + ' ' + unit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String toHexString(byte[] bytes, int bytesPerRow) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < bytes.length; i += bytesPerRow) {
|
||||||
|
int length = bytes.length - i >= bytesPerRow ? bytesPerRow : bytes.length % bytesPerRow;
|
||||||
|
byte[] row = new byte[bytesPerRow];
|
||||||
|
System.arraycopy(bytes, i, row, 0, length);
|
||||||
|
for (int j = 0; j < length; j++) {
|
||||||
|
sb.append(toHexString(row[j]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts one byte to its hex representation with leading zeros. E.g. 255 -> FF, 12 -> 0C
|
||||||
|
*
|
||||||
|
* @param b
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public static String toHexString(int b) {
|
||||||
|
String hex = Integer.toHexString(b & 0xFF);
|
||||||
|
if (hex.length() < 2) {
|
||||||
|
hex = "0" + hex;
|
||||||
|
}
|
||||||
|
return hex;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class CookieJarImpl implements CookieJar {
|
||||||
String name = oldCookie.name();
|
String name = oldCookie.name();
|
||||||
for (Cookie newCookie : cookies) {
|
for (Cookie newCookie : cookies) {
|
||||||
if(newCookie.name().equalsIgnoreCase(name)) {
|
if(newCookie.name().equalsIgnoreCase(name)) {
|
||||||
LOG.debug("Replacing cookie {} {} -> {} [{}]", oldCookie.name(), oldCookie.value(), newCookie.value(), oldCookie.domain());
|
LOG.trace("Replacing cookie {} {} -> {} [{}]", oldCookie.name(), oldCookie.value(), newCookie.value(), oldCookie.domain());
|
||||||
iterator.remove();
|
iterator.remove();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -42,11 +42,11 @@ public class CookieJarImpl implements CookieJar {
|
||||||
}
|
}
|
||||||
cookiesForUrl.addAll(cookies);
|
cookiesForUrl.addAll(cookies);
|
||||||
cookieStore.put(host, cookiesForUrl);
|
cookieStore.put(host, cookiesForUrl);
|
||||||
LOG.debug("Adding cookie: {} for {}", cookiesForUrl, host);
|
LOG.trace("Adding cookie: {} for {}", cookiesForUrl, host);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
cookieStore.put(host, cookies);
|
cookieStore.put(host, cookies);
|
||||||
LOG.debug("Storing cookie: {} for {}", cookies, host);
|
LOG.trace("Storing cookie: {} for {}", cookies, host);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -54,9 +54,9 @@ public class CookieJarImpl implements CookieJar {
|
||||||
public List<Cookie> loadForRequest(HttpUrl url) {
|
public List<Cookie> loadForRequest(HttpUrl url) {
|
||||||
String host = getDomain(url);
|
String host = getDomain(url);
|
||||||
List<Cookie> cookies = cookieStore.get(host);
|
List<Cookie> cookies = cookieStore.get(host);
|
||||||
LOG.debug("Cookies for {}", url);
|
LOG.trace("Cookies for {}", url);
|
||||||
Optional.ofNullable(cookies).ifPresent(cookiez -> cookiez.forEach(c -> {
|
Optional.ofNullable(cookies).ifPresent(cookiez -> cookiez.forEach(c -> {
|
||||||
LOG.debug(" {} expires on:{}", c, c.expiresAt());
|
LOG.trace(" {} expires on:{}", c, c.expiresAt());
|
||||||
}));
|
}));
|
||||||
//LOG.debug("Cookies for {}: {}", url.host(), cookies);
|
//LOG.debug("Cookies for {}: {}", url.host(), cookies);
|
||||||
return cookies != null ? cookies : new ArrayList<Cookie>();
|
return cookies != null ? cookies : new ArrayList<Cookie>();
|
||||||
|
@ -72,6 +72,19 @@ public class CookieJarImpl implements CookieJar {
|
||||||
throw new NoSuchElementException("No cookie named " + name + " for " + url.host() + " available");
|
throw new NoSuchElementException("No cookie named " + name + " for " + url.host() + " available");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void deleteCookie(HttpUrl url, String name) {
|
||||||
|
List<Cookie> cookies = loadForRequest(url);
|
||||||
|
for (Iterator<Cookie> iterator = cookies.iterator(); iterator.hasNext();) {
|
||||||
|
Cookie cookie = iterator.next();
|
||||||
|
if(Objects.equals(cookie.name(), name)) {
|
||||||
|
iterator.remove();
|
||||||
|
LOG.debug("Removed cookie \"{}\" for {}", name, url.toString());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new NoSuchElementException("No cookie named " + name + " for " + url.host() + " available");
|
||||||
|
}
|
||||||
|
|
||||||
private String getDomain(HttpUrl url) {
|
private String getDomain(HttpUrl url) {
|
||||||
// String host = url.host();
|
// String host = url.host();
|
||||||
// if (host.startsWith("www.")) {
|
// if (host.startsWith("www.")) {
|
||||||
|
|
|
@ -398,6 +398,10 @@ public class LocalRecorder implements Recorder {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void generatePlaylist(File recDir) {
|
private void generatePlaylist(File recDir) {
|
||||||
|
if(!config.getSettings().generatePlaylist) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
PlaylistGenerator playlistGenerator = new PlaylistGenerator();
|
PlaylistGenerator playlistGenerator = new PlaylistGenerator();
|
||||||
playlistGenerators.put(recDir, playlistGenerator);
|
playlistGenerators.put(recDir, playlistGenerator);
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -18,12 +18,14 @@ import ctbrec.io.HtmlParser;
|
||||||
import ctbrec.io.HttpClient;
|
import ctbrec.io.HttpClient;
|
||||||
import ctbrec.io.HttpException;
|
import ctbrec.io.HttpException;
|
||||||
import ctbrec.sites.AbstractSite;
|
import ctbrec.sites.AbstractSite;
|
||||||
|
import okhttp3.HttpUrl;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import okhttp3.Response;
|
import okhttp3.Response;
|
||||||
|
|
||||||
public class LiveJasmin extends AbstractSite {
|
public class LiveJasmin extends AbstractSite {
|
||||||
|
|
||||||
public static final String BASE_URL = "https://www.livejasmin.com";
|
public static String baseUrl = "";
|
||||||
|
public static String baseDomain = "";
|
||||||
private HttpClient httpClient;
|
private HttpClient httpClient;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -33,12 +35,13 @@ public class LiveJasmin extends AbstractSite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getBaseUrl() {
|
public String getBaseUrl() {
|
||||||
return BASE_URL;
|
return baseUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getAffiliateLink() {
|
public String getAffiliateLink() {
|
||||||
return "https://awejmp.com/?siteId=jasmin&categoryName=girl&pageName=listpage&performerName=&prm[psid]=0xb00bface&prm[pstool]=205_1&prm[psprogram]=pps&prm[campaign_id]=&subAffId={SUBAFFID}&filters=";
|
return "https://awejmp.com/?siteId=jasmin&categoryName=girl&pageName=listpage&performerName=&prm[psid]=0xb00bface&prm[pstool]=205_1&prm[psprogram]=revs&prm[campaign_id]=&subAffId={SUBAFFID}&filters=";
|
||||||
|
// return "https://awejmp.com/?siteId=jasmin&categoryName=girl&pageName=listpage&performerName=&prm[psid]=0xb00bface&prm[pstool]=205_1&prm[psprogram]=pps&prm[campaign_id]=&subAffId={SUBAFFID}&filters=";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -56,14 +59,9 @@ public class LiveJasmin extends AbstractSite {
|
||||||
if (getLiveJasminHttpClient().login()) {
|
if (getLiveJasminHttpClient().login()) {
|
||||||
String sessionId = getLiveJasminHttpClient().getSessionId();
|
String sessionId = getLiveJasminHttpClient().getSessionId();
|
||||||
String url = getBaseUrl() + "/en/offline-surprise/get-member-balance?session=" + sessionId;
|
String url = getBaseUrl() + "/en/offline-surprise/get-member-balance?session=" + sessionId;
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder().url(url).addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgent)
|
||||||
.url(url)
|
.addHeader("Accept", "*/*").addHeader("Accept-Language", "en").addHeader("Referer", getBaseUrl())
|
||||||
.addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgent)
|
.addHeader("X-Requested-With", "XMLHttpRequest").build();
|
||||||
.addHeader("Accept", "*/*")
|
|
||||||
.addHeader("Accept-Language", "en")
|
|
||||||
.addHeader("Referer", getBaseUrl())
|
|
||||||
.addHeader("X-Requested-With", "XMLHttpRequest")
|
|
||||||
.build();
|
|
||||||
try (Response response = getHttpClient().execute(request)) {
|
try (Response response = getHttpClient().execute(request)) {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
String body = response.body().string();
|
String body = response.body().string();
|
||||||
|
@ -102,6 +100,9 @@ public class LiveJasmin extends AbstractSite {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init() throws IOException {
|
public void init() throws IOException {
|
||||||
|
baseUrl = Config.getInstance().getSettings().livejasminBaseUrl;
|
||||||
|
HttpUrl url = HttpUrl.parse(baseUrl);
|
||||||
|
baseDomain = url.topPrivateDomain();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -131,14 +132,8 @@ public class LiveJasmin extends AbstractSite {
|
||||||
String query = URLEncoder.encode(q, "utf-8");
|
String query = URLEncoder.encode(q, "utf-8");
|
||||||
long ts = System.currentTimeMillis();
|
long ts = System.currentTimeMillis();
|
||||||
String url = getBaseUrl() + "/en/auto-suggest-search/auto-suggest?category=girls&searchText=" + query + "&_dc=" + ts + "&appletType=html5";
|
String url = getBaseUrl() + "/en/auto-suggest-search/auto-suggest?category=girls&searchText=" + query + "&_dc=" + ts + "&appletType=html5";
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder().url(url).addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgent).addHeader("Accept", "*/*")
|
||||||
.url(url)
|
.addHeader("Accept-Language", "en").addHeader("Referer", getBaseUrl()).addHeader("X-Requested-With", "XMLHttpRequest").build();
|
||||||
.addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgent)
|
|
||||||
.addHeader("Accept", "*/*")
|
|
||||||
.addHeader("Accept-Language", "en")
|
|
||||||
.addHeader("Referer", getBaseUrl())
|
|
||||||
.addHeader("X-Requested-With", "XMLHttpRequest")
|
|
||||||
.build();
|
|
||||||
try (Response response = getHttpClient().execute(request)) {
|
try (Response response = getHttpClient().execute(request)) {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
String body = response.body().string();
|
String body = response.body().string();
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class LiveJasminChunkedHttpDownload implements Download {
|
||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url("https://" + relayHost + "/?random=" + newClientInstanceId())
|
.url("https://" + relayHost + "/?random=" + newClientInstanceId())
|
||||||
.header("Origin", "https://www.livejasmin.com")
|
.header("Origin", LiveJasmin.baseUrl)
|
||||||
.header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0")
|
.header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0")
|
||||||
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
|
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
|
||||||
.header("Accept-Language", "de,en-US;q=0.7,en;q=0.3")
|
.header("Accept-Language", "de,en-US;q=0.7,en;q=0.3")
|
||||||
|
@ -154,7 +154,7 @@ public class LiveJasminChunkedHttpDownload implements Download {
|
||||||
+ "\",\"connectionData\":{\"jasmin2App\":true,\"isMobileClient\":false,\"platform\":\"desktop\",\"chatID\":\"freechat\","
|
+ "\",\"connectionData\":{\"jasmin2App\":true,\"isMobileClient\":false,\"platform\":\"desktop\",\"chatID\":\"freechat\","
|
||||||
+ "\"sessionID\":\"" + sessionId + "\"," + "\"jsm2SessionId\":\"" + jsm2SessionId + "\",\"userType\":\"user\"," + "\"performerId\":\""
|
+ "\"sessionID\":\"" + sessionId + "\"," + "\"jsm2SessionId\":\"" + jsm2SessionId + "\",\"userType\":\"user\"," + "\"performerId\":\""
|
||||||
+ model
|
+ model
|
||||||
+ "\",\"clientRevision\":\"\",\"proxyIP\":\"\",\"playerVer\":\"nanoPlayerVersion: 3.10.3 appCodeName: Mozilla appName: Netscape appVersion: 5.0 (X11) platform: Linux x86_64\",\"livejasminTvmember\":false,\"newApplet\":true,\"livefeedtype\":null,\"gravityCookieId\":\"\",\"passparam\":\"\",\"brandID\":\"jasmin\",\"cobrandId\":\"\",\"subbrand\":\"livejasmin\",\"siteName\":\"LiveJasmin\",\"siteUrl\":\"https://www.livejasmin.com\","
|
+ "\",\"clientRevision\":\"\",\"proxyIP\":\"\",\"playerVer\":\"nanoPlayerVersion: 3.10.3 appCodeName: Mozilla appName: Netscape appVersion: 5.0 (X11) platform: Linux x86_64\",\"livejasminTvmember\":false,\"newApplet\":true,\"livefeedtype\":null,\"gravityCookieId\":\"\",\"passparam\":\"\",\"brandID\":\"jasmin\",\"cobrandId\":\"\",\"subbrand\":\"livejasmin\",\"siteName\":\"LiveJasmin\",\"siteUrl\":\""+LiveJasmin.baseUrl+"\","
|
||||||
+ "\"clientInstanceId\":\"" + clientInstanceId + "\",\"armaVersion\":\"34.10.0\",\"isPassive\":false}}");
|
+ "\"clientInstanceId\":\"" + clientInstanceId + "\",\"armaVersion\":\"34.10.0\",\"isPassive\":false}}");
|
||||||
response.close();
|
response.close();
|
||||||
}
|
}
|
||||||
|
@ -231,13 +231,13 @@ public class LiveJasminChunkedHttpDownload implements Download {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void getPerformerDetails(String name) throws IOException {
|
protected void getPerformerDetails(String name) throws IOException {
|
||||||
String url = "https://m.livejasmin.com/en/chat-html5/" + name;
|
String url = "https://m."+LiveJasmin.baseDomain+"/en/chat-html5/" + name;
|
||||||
Request req = new Request.Builder()
|
Request req = new Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
.header("User-Agent", USER_AGENT)
|
.header("User-Agent", USER_AGENT)
|
||||||
.header("Accept", "application/json,*/*")
|
.header("Accept", "application/json,*/*")
|
||||||
.header("Accept-Language", "en")
|
.header("Accept-Language", "en")
|
||||||
.header("Referer", "https://www.livejasmin.com")
|
.header("Referer", LiveJasmin.baseUrl)
|
||||||
.header("X-Requested-With", "XMLHttpRequest")
|
.header("X-Requested-With", "XMLHttpRequest")
|
||||||
.build();
|
.build();
|
||||||
try (Response response = client.execute(req)) {
|
try (Response response = client.execute(req)) {
|
||||||
|
|
|
@ -20,6 +20,12 @@ public class LiveJasminHttpClient extends HttpClient {
|
||||||
|
|
||||||
protected LiveJasminHttpClient() {
|
protected LiveJasminHttpClient() {
|
||||||
super("livejasmin");
|
super("livejasmin");
|
||||||
|
|
||||||
|
// delete all cookies, if we are guests, because old guest sessions cause
|
||||||
|
// endless redirects
|
||||||
|
if(Config.getInstance().getSettings().livejasminUsername.isEmpty()) {
|
||||||
|
getCookieJar().clear();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -44,13 +50,13 @@ public class LiveJasminHttpClient extends HttpClient {
|
||||||
.followSslRedirects(false)
|
.followSslRedirects(false)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
String url = "https://m.livejasmin.com/en/member/favourite/get-favourite-list?ajax=1";
|
String url = "https://m." + LiveJasmin.baseDomain + "/en/member/favourite/get-favourite-list?ajax=1";
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
.addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgentMobile)
|
.addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgentMobile)
|
||||||
.addHeader("Accept", "application/json, text/javascript, */*")
|
.addHeader("Accept", "application/json, text/javascript, */*")
|
||||||
.addHeader("Accept-Language", "en")
|
.addHeader("Accept-Language", "en")
|
||||||
.addHeader("Referer", LiveJasmin.BASE_URL)
|
.addHeader("Referer", LiveJasmin.baseUrl)
|
||||||
.addHeader("X-Requested-With", "XMLHttpRequest")
|
.addHeader("X-Requested-With", "XMLHttpRequest")
|
||||||
.build();
|
.build();
|
||||||
try(Response response = temp.newCall(request).execute()) {
|
try(Response response = temp.newCall(request).execute()) {
|
||||||
|
@ -64,7 +70,7 @@ public class LiveJasminHttpClient extends HttpClient {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSessionId() {
|
public String getSessionId() {
|
||||||
Cookie sessionCookie = getCookieJar().getCookie(HttpUrl.parse(LiveJasmin.BASE_URL), "session");
|
Cookie sessionCookie = getCookieJar().getCookie(HttpUrl.parse(LiveJasmin.baseUrl), "session");
|
||||||
if(sessionCookie != null) {
|
if(sessionCookie != null) {
|
||||||
return sessionCookie.value();
|
return sessionCookie.value();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.io.InputStream;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Random;
|
||||||
import java.util.concurrent.ExecutionException;
|
import java.util.concurrent.ExecutionException;
|
||||||
|
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
@ -26,6 +27,7 @@ import com.squareup.moshi.JsonWriter;
|
||||||
|
|
||||||
import ctbrec.AbstractModel;
|
import ctbrec.AbstractModel;
|
||||||
import ctbrec.Config;
|
import ctbrec.Config;
|
||||||
|
import ctbrec.StringUtil;
|
||||||
import ctbrec.io.HttpException;
|
import ctbrec.io.HttpException;
|
||||||
import ctbrec.recorder.download.Download;
|
import ctbrec.recorder.download.Download;
|
||||||
import ctbrec.recorder.download.StreamSource;
|
import ctbrec.recorder.download.StreamSource;
|
||||||
|
@ -48,7 +50,7 @@ public class LiveJasminModel extends AbstractModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void loadModelInfo() throws IOException {
|
protected void loadModelInfo() throws IOException {
|
||||||
String url = "https://m.livejasmin.com/en/chat-html5/" + getName();
|
String url = "https://m." + LiveJasmin.baseDomain + "/en/chat-html5/" + getName();
|
||||||
Request req = new Request.Builder().url(url).header("User-Agent",
|
Request req = new Request.Builder().url(url).header("User-Agent",
|
||||||
"Mozilla/5.0 (iPhone; CPU OS 10_14 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Mobile/14E304 Safari/605.1.15")
|
"Mozilla/5.0 (iPhone; CPU OS 10_14 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Mobile/14E304 Safari/605.1.15")
|
||||||
.header("Accept", "application/json,*/*")
|
.header("Accept", "application/json,*/*")
|
||||||
|
@ -148,23 +150,31 @@ public class LiveJasminModel extends AbstractModel {
|
||||||
|
|
||||||
private String getMasterPlaylistUrl() throws IOException {
|
private String getMasterPlaylistUrl() throws IOException {
|
||||||
loadModelInfo();
|
loadModelInfo();
|
||||||
String url = site.getBaseUrl() + "/en/stream/hls/free/" + getName();
|
//String url = site.getBaseUrl() + "/en/stream/hls/free/" + getName();
|
||||||
|
|
||||||
|
// generate a fake guest session ID
|
||||||
|
byte[] sessionIdRandom = new byte[16];
|
||||||
|
new Random().nextBytes(sessionIdRandom);
|
||||||
|
String sessionId = 'g' + StringUtil.toHexString(sessionIdRandom, 32);
|
||||||
|
|
||||||
|
String url = "https://api-gateway.dditsadn.com/v1/stream/performers/" + getName()
|
||||||
|
+ "/streams/free/formats/hls?brandId=jasmin&session=" + sessionId + "&streamName=stream_1280_720_2000";
|
||||||
|
LOG.debug("Getting master playlist URL from {}", url);
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
.addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgent)
|
.addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgentMobile)
|
||||||
.addHeader("Accept", "application/json, text/javascript, */*")
|
.addHeader("Accept", "application/json, text/javascript, */*")
|
||||||
.addHeader("Accept-Language", "en")
|
.addHeader("Accept-Language", "en")
|
||||||
.addHeader("Referer", site.getBaseUrl())
|
.addHeader("Referer", getUrl())
|
||||||
.addHeader("X-Requested-With", "XMLHttpRequest")
|
.addHeader("X-Requested-With", "XMLHttpRequest")
|
||||||
.build();
|
.build();
|
||||||
try (Response response = site.getHttpClient().execute(request)) {
|
try (Response response = site.getHttpClient().execute(request)) {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
String body = response.body().string();
|
String body = response.body().string();
|
||||||
JSONObject json = new JSONObject(body);
|
JSONObject json = new JSONObject(body);
|
||||||
if (json.optBoolean("success")) {
|
if (json.has("data")) {
|
||||||
JSONObject data = json.getJSONObject("data");
|
JSONObject data = json.getJSONObject("data");
|
||||||
JSONObject hlsStream = data.getJSONObject("hls_stream");
|
return data.getString("url");
|
||||||
return hlsStream.getString("url");
|
|
||||||
} else {
|
} else {
|
||||||
throw new IOException("Response was not successful: " + url + "\n" + body);
|
throw new IOException("Response was not successful: " + url + "\n" + body);
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class LiveJasminTippingWebSocket {
|
||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url("https://" + relayHost + "/")
|
.url("https://" + relayHost + "/")
|
||||||
.header("Origin", "https://www.livejasmin.com")
|
.header("Origin", LiveJasmin.baseUrl)
|
||||||
.header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0")
|
.header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0")
|
||||||
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
|
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
|
||||||
.header("Accept-Language", "de,en-US;q=0.7,en;q=0.3")
|
.header("Accept-Language", "de,en-US;q=0.7,en;q=0.3")
|
||||||
|
@ -65,7 +65,7 @@ public class LiveJasminTippingWebSocket {
|
||||||
+ "\",\"connectionData\":{\"jasmin2App\":true,\"isMobileClient\":false,\"platform\":\"desktop\",\"chatID\":\"freechat\","
|
+ "\",\"connectionData\":{\"jasmin2App\":true,\"isMobileClient\":false,\"platform\":\"desktop\",\"chatID\":\"freechat\","
|
||||||
+ "\"sessionID\":\"" + sessionId + "\"," + "\"jsm2SessionId\":\"" + jsm2SessionId + "\",\"userType\":\"user\"," + "\"performerId\":\""
|
+ "\"sessionID\":\"" + sessionId + "\"," + "\"jsm2SessionId\":\"" + jsm2SessionId + "\",\"userType\":\"user\"," + "\"performerId\":\""
|
||||||
+ model
|
+ model
|
||||||
+ "\",\"clientRevision\":\"\",\"proxyIP\":\"\",\"playerVer\":\"nanoPlayerVersion: 3.10.3 appCodeName: Mozilla appName: Netscape appVersion: 5.0 (X11) platform: Linux x86_64\",\"livejasminTvmember\":false,\"newApplet\":true,\"livefeedtype\":null,\"gravityCookieId\":\"\",\"passparam\":\"\",\"brandID\":\"jasmin\",\"cobrandId\":\"\",\"subbrand\":\"livejasmin\",\"siteName\":\"LiveJasmin\",\"siteUrl\":\"https://www.livejasmin.com\","
|
+ "\",\"clientRevision\":\"\",\"proxyIP\":\"\",\"playerVer\":\"nanoPlayerVersion: 3.10.3 appCodeName: Mozilla appName: Netscape appVersion: 5.0 (X11) platform: Linux x86_64\",\"livejasminTvmember\":false,\"newApplet\":true,\"livefeedtype\":null,\"gravityCookieId\":\"\",\"passparam\":\"\",\"brandID\":\"jasmin\",\"cobrandId\":\"\",\"subbrand\":\"livejasmin\",\"siteName\":\"LiveJasmin\",\"siteUrl\":\""+LiveJasmin.baseUrl+"\","
|
||||||
+ "\"clientInstanceId\":\"" + clientInstanceId + "\",\"armaVersion\":\"34.10.0\",\"isPassive\":false}}");
|
+ "\"clientInstanceId\":\"" + clientInstanceId + "\",\"armaVersion\":\"34.10.0\",\"isPassive\":false}}");
|
||||||
response.close();
|
response.close();
|
||||||
}
|
}
|
||||||
|
@ -136,13 +136,13 @@ public class LiveJasminTippingWebSocket {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void getPerformerDetails(String name) throws IOException {
|
protected void getPerformerDetails(String name) throws IOException {
|
||||||
String url = "https://m.livejasmin.com/en/chat-html5/" + name;
|
String url = "https://m." + LiveJasmin.baseDomain + "/en/chat-html5/" + name;
|
||||||
Request req = new Request.Builder()
|
Request req = new Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
.header("User-Agent", "Mozilla/5.0 (iPhone; CPU OS 10_14 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Mobile/14E304 Safari/605.1.15")
|
.header("User-Agent", "Mozilla/5.0 (iPhone; CPU OS 10_14 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Mobile/14E304 Safari/605.1.15")
|
||||||
.header("Accept", "application/json,*/*")
|
.header("Accept", "application/json,*/*")
|
||||||
.header("Accept-Language", "en")
|
.header("Accept-Language", "en")
|
||||||
.header("Referer", "https://www.livejasmin.com")
|
.header("Referer", LiveJasmin.baseUrl)
|
||||||
.header("X-Requested-With", "XMLHttpRequest")
|
.header("X-Requested-With", "XMLHttpRequest")
|
||||||
.build();
|
.build();
|
||||||
try (Response response = client.execute(req)) {
|
try (Response response = client.execute(req)) {
|
||||||
|
|
|
@ -76,7 +76,7 @@ public class LiveJasminWebSocketDownload implements Download {
|
||||||
|
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
.url("https://" + relayHost + "/")
|
.url("https://" + relayHost + "/")
|
||||||
.header("Origin", "https://www.livejasmin.com")
|
.header("Origin", LiveJasmin.baseUrl)
|
||||||
.header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0")
|
.header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0")
|
||||||
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
|
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8")
|
||||||
.header("Accept-Language", "de,en-US;q=0.7,en;q=0.3")
|
.header("Accept-Language", "de,en-US;q=0.7,en;q=0.3")
|
||||||
|
@ -91,7 +91,7 @@ public class LiveJasminWebSocketDownload implements Download {
|
||||||
+ "\",\"connectionData\":{\"jasmin2App\":true,\"isMobileClient\":false,\"platform\":\"desktop\",\"chatID\":\"freechat\","
|
+ "\",\"connectionData\":{\"jasmin2App\":true,\"isMobileClient\":false,\"platform\":\"desktop\",\"chatID\":\"freechat\","
|
||||||
+ "\"sessionID\":\"" + sessionId + "\"," + "\"jsm2SessionId\":\"" + jsm2SessionId + "\",\"userType\":\"user\"," + "\"performerId\":\""
|
+ "\"sessionID\":\"" + sessionId + "\"," + "\"jsm2SessionId\":\"" + jsm2SessionId + "\",\"userType\":\"user\"," + "\"performerId\":\""
|
||||||
+ model
|
+ model
|
||||||
+ "\",\"clientRevision\":\"\",\"proxyIP\":\"\",\"playerVer\":\"nanoPlayerVersion: 3.10.3 appCodeName: Mozilla appName: Netscape appVersion: 5.0 (X11) platform: Linux x86_64\",\"livejasminTvmember\":false,\"newApplet\":true,\"livefeedtype\":null,\"gravityCookieId\":\"\",\"passparam\":\"\",\"brandID\":\"jasmin\",\"cobrandId\":\"\",\"subbrand\":\"livejasmin\",\"siteName\":\"LiveJasmin\",\"siteUrl\":\"https://www.livejasmin.com\","
|
+ "\",\"clientRevision\":\"\",\"proxyIP\":\"\",\"playerVer\":\"nanoPlayerVersion: 3.10.3 appCodeName: Mozilla appName: Netscape appVersion: 5.0 (X11) platform: Linux x86_64\",\"livejasminTvmember\":false,\"newApplet\":true,\"livefeedtype\":null,\"gravityCookieId\":\"\",\"passparam\":\"\",\"brandID\":\"jasmin\",\"cobrandId\":\"\",\"subbrand\":\"livejasmin\",\"siteName\":\"LiveJasmin\",\"siteUrl\":\""+LiveJasmin.baseUrl+"\","
|
||||||
+ "\"clientInstanceId\":\"" + clientInstanceId + "\",\"armaVersion\":\"34.10.0\",\"isPassive\":false}}");
|
+ "\"clientInstanceId\":\"" + clientInstanceId + "\",\"armaVersion\":\"34.10.0\",\"isPassive\":false}}");
|
||||||
response.close();
|
response.close();
|
||||||
}
|
}
|
||||||
|
@ -218,13 +218,13 @@ public class LiveJasminWebSocketDownload implements Download {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void getPerformerDetails(String name) throws IOException {
|
protected void getPerformerDetails(String name) throws IOException {
|
||||||
String url = "https://m.livejasmin.com/en/chat-html5/" + name;
|
String url = "https://m." + LiveJasmin.baseDomain + "/en/chat-html5/" + name;
|
||||||
Request req = new Request.Builder()
|
Request req = new Request.Builder()
|
||||||
.url(url)
|
.url(url)
|
||||||
.header("User-Agent", "Mozilla/5.0 (iPhone; CPU OS 10_14 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Mobile/14E304 Safari/605.1.15")
|
.header("User-Agent", "Mozilla/5.0 (iPhone; CPU OS 10_14 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/11.1.1 Mobile/14E304 Safari/605.1.15")
|
||||||
.header("Accept", "application/json,*/*")
|
.header("Accept", "application/json,*/*")
|
||||||
.header("Accept-Language", "en")
|
.header("Accept-Language", "en")
|
||||||
.header("Referer", "https://www.livejasmin.com")
|
.header("Referer", LiveJasmin.baseUrl)
|
||||||
.header("X-Requested-With", "XMLHttpRequest")
|
.header("X-Requested-With", "XMLHttpRequest")
|
||||||
.build();
|
.build();
|
||||||
try (Response response = client.execute(req)) {
|
try (Response response = client.execute(req)) {
|
||||||
|
@ -260,7 +260,9 @@ public class LiveJasminWebSocketDownload implements Download {
|
||||||
LOG.trace(rtmpUrl);
|
LOG.trace(rtmpUrl);
|
||||||
LOG.trace(url);
|
LOG.trace(url);
|
||||||
|
|
||||||
Request request = new Request.Builder().url(url).header("Origin", "https://www.livejasmin.com")
|
Request request = new Request.Builder()
|
||||||
|
.url(url)
|
||||||
|
.header("Origin", LiveJasmin.baseUrl)
|
||||||
.header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0")
|
.header("User-Agent", "Mozilla/5.0 (X11; Linux x86_64; rv:63.0) Gecko/20100101 Firefox/63.0")
|
||||||
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8").header("Accept-Language", "de,en-US;q=0.7,en;q=0.3")
|
.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8").header("Accept-Language", "de,en-US;q=0.7,en;q=0.3")
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -6,7 +6,7 @@
|
||||||
<groupId>ctbrec</groupId>
|
<groupId>ctbrec</groupId>
|
||||||
<artifactId>master</artifactId>
|
<artifactId>master</artifactId>
|
||||||
<packaging>pom</packaging>
|
<packaging>pom</packaging>
|
||||||
<version>1.17.0</version>
|
<version>1.17.1</version>
|
||||||
|
|
||||||
<modules>
|
<modules>
|
||||||
<module>../common</module>
|
<module>../common</module>
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>ctbrec</groupId>
|
<groupId>ctbrec</groupId>
|
||||||
<artifactId>master</artifactId>
|
<artifactId>master</artifactId>
|
||||||
<version>1.17.0</version>
|
<version>1.17.1</version>
|
||||||
<relativePath>../master</relativePath>
|
<relativePath>../master</relativePath>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
|
|
@ -68,13 +68,13 @@ public class HttpServer {
|
||||||
LOG.info("HMAC authentication is enabled");
|
LOG.info("HMAC authentication is enabled");
|
||||||
}
|
}
|
||||||
recorder = new LocalRecorder(config);
|
recorder = new LocalRecorder(config);
|
||||||
OnlineMonitor monitor = new OnlineMonitor(recorder);
|
|
||||||
monitor.start();
|
|
||||||
for (Site site : sites) {
|
for (Site site : sites) {
|
||||||
if(site.isEnabled()) {
|
if(site.isEnabled()) {
|
||||||
site.init();
|
site.init();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
OnlineMonitor monitor = new OnlineMonitor(recorder);
|
||||||
|
monitor.start();
|
||||||
startHttpServer();
|
startHttpServer();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue