forked from j62/ctbrec
Add setting to change the base URL for LiveJasmin
This setting is for users, which are blocked for the main domain, like users behind the great chinese wall.
This commit is contained in:
parent
a69b0926f0
commit
44bc5d02aa
|
@ -73,20 +73,17 @@ public class LiveJasminConfigUi extends AbstractConfigUI {
|
|||
GridPane.setColumnSpan(password, 2);
|
||||
layout.add(password, 1, row++);
|
||||
|
||||
// layout.add(new Label("LiveJasmin Session ID"), 0, row);
|
||||
// TextField sessionId = new TextField();
|
||||
// sessionId.setText(Config.getInstance().getSettings().livejasminSession);
|
||||
// sessionId.textProperty().addListener((ob, o, n) -> {
|
||||
// if(!n.equals(Config.getInstance().getSettings().livejasminSession)) {
|
||||
// Config.getInstance().getSettings().livejasminSession = n;
|
||||
// save();
|
||||
// }
|
||||
// });
|
||||
// GridPane.setFillWidth(sessionId, true);
|
||||
// GridPane.setHgrow(sessionId, Priority.ALWAYS);
|
||||
// GridPane.setColumnSpan(sessionId, 2);
|
||||
// GridPane.setMargin(sessionId, new Insets(0, 0, 0, SettingsTab.CHECKBOX_MARGIN));
|
||||
// layout.add(sessionId, 1, row++);
|
||||
layout.add(new Label("LiveJasmin Base URL"), 0, row);
|
||||
TextField baseUrl = new TextField();
|
||||
baseUrl.setText(Config.getInstance().getSettings().livejasminBaseUrl);
|
||||
baseUrl.textProperty().addListener((ob, o, n) -> {
|
||||
Config.getInstance().getSettings().livejasminBaseUrl = baseUrl.getText();
|
||||
save();
|
||||
});
|
||||
GridPane.setFillWidth(baseUrl, true);
|
||||
GridPane.setHgrow(baseUrl, Priority.ALWAYS);
|
||||
GridPane.setColumnSpan(baseUrl, 2);
|
||||
layout.add(baseUrl, 1, row++);
|
||||
|
||||
Button createAccount = new Button("Create new Account");
|
||||
createAccount.setOnAction((e) -> DesktopIntegration.open(liveJasmin.getAffiliateLink()));
|
||||
|
@ -94,6 +91,7 @@ public class LiveJasminConfigUi extends AbstractConfigUI {
|
|||
GridPane.setColumnSpan(createAccount, 2);
|
||||
GridPane.setMargin(username, 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));
|
||||
|
||||
username.setPrefWidth(300);
|
||||
|
|
|
@ -20,7 +20,7 @@ import okhttp3.HttpUrl;
|
|||
public class LiveJasminElectronLoginDialog {
|
||||
|
||||
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 ExternalBrowser browser;
|
||||
|
||||
|
@ -77,12 +77,12 @@ public class LiveJasminElectronLoginDialog {
|
|||
JSONObject cookie = _cookies.getJSONObject(i);
|
||||
Builder b = new Cookie.Builder()
|
||||
.path("/")
|
||||
.domain("livejasmin.com")
|
||||
.domain(LiveJasmin.baseDomain)
|
||||
.name(cookie.getString("name"))
|
||||
.value(cookie.getString("value"))
|
||||
.expiresAt(0);
|
||||
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/")) {
|
||||
|
|
|
@ -40,7 +40,7 @@ public class LiveJasminFollowedUpdateService extends PaginatedScheduledService {
|
|||
public List<Model> call() throws IOException {
|
||||
boolean loggedIn = SiteUiFactory.getUi(liveJasmin).login();
|
||||
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
|
||||
//LOG.debug("Fetching page {}", url);
|
||||
|
|
|
@ -4,7 +4,6 @@ import java.io.IOException;
|
|||
|
||||
import ctbrec.Config;
|
||||
import ctbrec.sites.Site;
|
||||
import ctbrec.ui.DesktopIntegration;
|
||||
import ctbrec.ui.PaginatedScheduledService;
|
||||
import ctbrec.ui.ThumbOverviewTab;
|
||||
import javafx.concurrent.WorkerStateEvent;
|
||||
|
@ -17,20 +16,16 @@ import javafx.scene.input.KeyEvent;
|
|||
public class LiveJasminTab extends ThumbOverviewTab {
|
||||
protected Label status;
|
||||
protected Button acknowledge = new Button("That's alright");
|
||||
private Button createAccount = new Button("Create Account");
|
||||
private boolean betaAcknowledged = Config.getInstance().getSettings().livejasminBetaAcknowledged;
|
||||
|
||||
public LiveJasminTab(String title, PaginatedScheduledService updateService, Site site) {
|
||||
super(title, updateService, site);
|
||||
if(!betaAcknowledged) {
|
||||
status = new Label("LiveJasmin is not fully functional. Live previews do not work.\n"
|
||||
+ "Also make sure, that you have an account and that you have entered your credentials.\n"
|
||||
+ "Otherwise you might get errors.");
|
||||
status = new Label("LiveJasmin is not fully functional. Live previews do not work.");
|
||||
grid.getChildren().add(status);
|
||||
grid.getChildren().add(acknowledge);
|
||||
grid.getChildren().add(createAccount);
|
||||
} else {
|
||||
status = new Label("Logging in...");
|
||||
status = new Label("Loading...");
|
||||
grid.getChildren().add(status);
|
||||
}
|
||||
|
||||
|
@ -41,17 +36,14 @@ public class LiveJasminTab extends ThumbOverviewTab {
|
|||
Config.getInstance().save();
|
||||
} catch (IOException e1) {
|
||||
}
|
||||
status.setText("Logging in...");
|
||||
status.setText("Loading...");
|
||||
grid.getChildren().remove(acknowledge);
|
||||
grid.getChildren().remove(createAccount);
|
||||
if(updateService != null) {
|
||||
updateService.cancel();
|
||||
updateService.reset();
|
||||
updateService.restart();
|
||||
}
|
||||
});
|
||||
|
||||
createAccount.setOnAction(e -> DesktopIntegration.open(site.getAffiliateLink()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -64,7 +56,6 @@ public class LiveJasminTab extends ThumbOverviewTab {
|
|||
if(Config.getInstance().getSettings().livejasminBetaAcknowledged) {
|
||||
grid.getChildren().remove(status);
|
||||
grid.getChildren().remove(acknowledge);
|
||||
grid.getChildren().remove(createAccount);
|
||||
super.onSuccess();
|
||||
}
|
||||
}
|
||||
|
@ -72,9 +63,8 @@ public class LiveJasminTab extends ThumbOverviewTab {
|
|||
@Override
|
||||
protected void onFail(WorkerStateEvent event) {
|
||||
if(Config.getInstance().getSettings().livejasminBetaAcknowledged) {
|
||||
status.setText("Login failed");
|
||||
status.setText("Error");
|
||||
grid.getChildren().remove(acknowledge);
|
||||
grid.getChildren().remove(createAccount);
|
||||
super.onFail(event);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,10 +23,10 @@ public class LiveJasminTabProvider extends TabProvider {
|
|||
public List<Tab> getTabs(Scene scene) {
|
||||
List<Tab> tabs = new ArrayList<>();
|
||||
|
||||
tabs.add(createTab("Girls", liveJasmin.getBaseUrl() + "/en/girls/?listPageOrderType=most_popular"));
|
||||
tabs.add(createTab("Girls HD", liveJasmin.getBaseUrl() + "/en/girls/hd/?listPageOrderType=most_popular"));
|
||||
tabs.add(createTab("Boys", liveJasmin.getBaseUrl() + "/en/boys/?listPageOrderType=most_popular"));
|
||||
tabs.add(createTab("Boys HD", liveJasmin.getBaseUrl() + "/en/boys/hd/?listPageOrderType=most_popular"));
|
||||
tabs.add(createTab("Girls", liveJasmin.getBaseUrl() + "/en/girl/?listPageOrderType=most_popular"));
|
||||
tabs.add(createTab("Girls HD", liveJasmin.getBaseUrl() + "/en/girl/hd/?listPageOrderType=most_popular"));
|
||||
tabs.add(createTab("Boys", liveJasmin.getBaseUrl() + "/en/boy/?listPageOrderType=most_popular"));
|
||||
tabs.add(createTab("Boys HD", liveJasmin.getBaseUrl() + "/en/boy/hd/?listPageOrderType=most_popular"));
|
||||
|
||||
followedTab = new LiveJasminFollowedTab(liveJasmin);
|
||||
followedTab.setRecorder(liveJasmin.getRecorder());
|
||||
|
|
|
@ -40,28 +40,24 @@ public class LiveJasminUpdateService extends PaginatedScheduledService {
|
|||
protected Task<List<Model>> createTask() {
|
||||
return new Task<List<Model>>() {
|
||||
@Override
|
||||
public List<Model> call() throws IOException, NotLoggedInExcetion {
|
||||
//String _url = url + ((page-1) * 36); // TODO find out how to switch pages
|
||||
if(!liveJasmin.credentialsAvailable() || !SiteUiFactory.getUi(liveJasmin).login()) {
|
||||
throw new NotLoggedInExcetion();
|
||||
}
|
||||
|
||||
public List<Model> call() throws IOException {
|
||||
// sort by popularity
|
||||
CookieJarImpl cookieJar = liveJasmin.getHttpClient().getCookieJar();
|
||||
Cookie sortCookie = new Cookie.Builder()
|
||||
.domain("livejasmin.com")
|
||||
.domain(LiveJasmin.baseDomain)
|
||||
.name("listPageOrderType")
|
||||
.value("most_popular")
|
||||
.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);
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgent)
|
||||
.addHeader("Accept", "application/json, text/javascript, */*")
|
||||
.addHeader("Accept-Language", "en")
|
||||
.addHeader("Referer", liveJasmin.getBaseUrl() + "/en/girls/")
|
||||
.addHeader("Referer", liveJasmin.getBaseUrl())
|
||||
.addHeader("X-Requested-With", "XMLHttpRequest")
|
||||
.build();
|
||||
try (Response response = liveJasmin.getHttpClient().execute(request)) {
|
||||
|
|
|
@ -65,6 +65,7 @@ public class Settings {
|
|||
public String cam4Password = "";
|
||||
public String livejasminUsername = "";
|
||||
public String livejasminPassword = "";
|
||||
public String livejasminBaseUrl = "https://www.livejasmin.com";
|
||||
public boolean livejasminBetaAcknowledged = false;
|
||||
public String streamateUsername = "";
|
||||
public String streamatePassword = "";
|
||||
|
|
|
@ -27,4 +27,31 @@ public class StringUtil {
|
|||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,12 +18,14 @@ import ctbrec.io.HtmlParser;
|
|||
import ctbrec.io.HttpClient;
|
||||
import ctbrec.io.HttpException;
|
||||
import ctbrec.sites.AbstractSite;
|
||||
import okhttp3.HttpUrl;
|
||||
import okhttp3.Request;
|
||||
import okhttp3.Response;
|
||||
|
||||
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;
|
||||
|
||||
@Override
|
||||
|
@ -33,12 +35,13 @@ public class LiveJasmin extends AbstractSite {
|
|||
|
||||
@Override
|
||||
public String getBaseUrl() {
|
||||
return BASE_URL;
|
||||
return baseUrl;
|
||||
}
|
||||
|
||||
@Override
|
||||
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
|
||||
|
@ -53,22 +56,17 @@ public class LiveJasmin extends AbstractSite {
|
|||
|
||||
@Override
|
||||
public Double getTokenBalance() throws IOException {
|
||||
if(getLiveJasminHttpClient().login()) {
|
||||
if (getLiveJasminHttpClient().login()) {
|
||||
String sessionId = getLiveJasminHttpClient().getSessionId();
|
||||
String url = getBaseUrl() + "/en/offline-surprise/get-member-balance?session=" + sessionId;
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgent)
|
||||
.addHeader("Accept", "*/*")
|
||||
.addHeader("Accept-Language", "en")
|
||||
.addHeader("Referer", getBaseUrl())
|
||||
.addHeader("X-Requested-With", "XMLHttpRequest")
|
||||
.build();
|
||||
Request request = new Request.Builder().url(url).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)) {
|
||||
if(response.isSuccessful()) {
|
||||
if (response.isSuccessful()) {
|
||||
String body = response.body().string();
|
||||
JSONObject json = new JSONObject(body);
|
||||
if(json.optBoolean("success")) {
|
||||
if (json.optBoolean("success")) {
|
||||
return json.optDouble("result");
|
||||
} else {
|
||||
throw new IOException("Response was not successful: " + url + "\n" + body);
|
||||
|
@ -102,6 +100,9 @@ public class LiveJasmin extends AbstractSite {
|
|||
|
||||
@Override
|
||||
public void init() throws IOException {
|
||||
baseUrl = Config.getInstance().getSettings().livejasminBaseUrl;
|
||||
HttpUrl url = HttpUrl.parse(baseUrl);
|
||||
baseDomain = url.topPrivateDomain();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -131,19 +132,13 @@ public class LiveJasmin extends AbstractSite {
|
|||
String query = URLEncoder.encode(q, "utf-8");
|
||||
long ts = System.currentTimeMillis();
|
||||
String url = getBaseUrl() + "/en/auto-suggest-search/auto-suggest?category=girls&searchText=" + query + "&_dc=" + ts + "&appletType=html5";
|
||||
Request request = new Request.Builder()
|
||||
.url(url)
|
||||
.addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgent)
|
||||
.addHeader("Accept", "*/*")
|
||||
.addHeader("Accept-Language", "en")
|
||||
.addHeader("Referer", getBaseUrl())
|
||||
.addHeader("X-Requested-With", "XMLHttpRequest")
|
||||
.build();
|
||||
Request request = new Request.Builder().url(url).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)) {
|
||||
if (response.isSuccessful()) {
|
||||
String body = response.body().string();
|
||||
JSONObject json = new JSONObject(body);
|
||||
if(json.optBoolean("success")) {
|
||||
if (json.optBoolean("success")) {
|
||||
List<Model> models = new ArrayList<>();
|
||||
JSONObject data = json.getJSONObject("data");
|
||||
String html = data.getString("content");
|
||||
|
@ -155,7 +150,7 @@ public class LiveJasmin extends AbstractSite {
|
|||
Element pic = HtmlParser.getTag(itemHtml, "span.pic i");
|
||||
String style = pic.attr("style");
|
||||
Matcher m = Pattern.compile("url\\('(.*?)'\\)").matcher(style);
|
||||
if(m.find()) {
|
||||
if (m.find()) {
|
||||
model.setPreview(m.group(1));
|
||||
}
|
||||
models.add(model);
|
||||
|
|
|
@ -141,7 +141,7 @@ public class LiveJasminChunkedHttpDownload implements Download {
|
|||
|
||||
Request request = new Request.Builder()
|
||||
.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("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")
|
||||
|
@ -154,7 +154,7 @@ public class LiveJasminChunkedHttpDownload implements Download {
|
|||
+ "\",\"connectionData\":{\"jasmin2App\":true,\"isMobileClient\":false,\"platform\":\"desktop\",\"chatID\":\"freechat\","
|
||||
+ "\"sessionID\":\"" + sessionId + "\"," + "\"jsm2SessionId\":\"" + jsm2SessionId + "\",\"userType\":\"user\"," + "\"performerId\":\""
|
||||
+ 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}}");
|
||||
response.close();
|
||||
}
|
||||
|
@ -231,13 +231,13 @@ public class LiveJasminChunkedHttpDownload implements Download {
|
|||
}
|
||||
|
||||
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()
|
||||
.url(url)
|
||||
.header("User-Agent", USER_AGENT)
|
||||
.header("Accept", "application/json,*/*")
|
||||
.header("Accept-Language", "en")
|
||||
.header("Referer", "https://www.livejasmin.com")
|
||||
.header("Referer", LiveJasmin.baseUrl)
|
||||
.header("X-Requested-With", "XMLHttpRequest")
|
||||
.build();
|
||||
try (Response response = client.execute(req)) {
|
||||
|
|
|
@ -44,13 +44,13 @@ public class LiveJasminHttpClient extends HttpClient {
|
|||
.followSslRedirects(false)
|
||||
.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()
|
||||
.url(url)
|
||||
.addHeader("User-Agent", Config.getInstance().getSettings().httpUserAgentMobile)
|
||||
.addHeader("Accept", "application/json, text/javascript, */*")
|
||||
.addHeader("Accept-Language", "en")
|
||||
.addHeader("Referer", LiveJasmin.BASE_URL)
|
||||
.addHeader("Referer", LiveJasmin.baseUrl)
|
||||
.addHeader("X-Requested-With", "XMLHttpRequest")
|
||||
.build();
|
||||
try(Response response = temp.newCall(request).execute()) {
|
||||
|
@ -64,7 +64,7 @@ public class LiveJasminHttpClient extends HttpClient {
|
|||
}
|
||||
|
||||
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) {
|
||||
return sessionCookie.value();
|
||||
} else {
|
||||
|
|
|
@ -51,7 +51,7 @@ public class LiveJasminTippingWebSocket {
|
|||
|
||||
Request request = new Request.Builder()
|
||||
.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("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")
|
||||
|
@ -65,7 +65,7 @@ public class LiveJasminTippingWebSocket {
|
|||
+ "\",\"connectionData\":{\"jasmin2App\":true,\"isMobileClient\":false,\"platform\":\"desktop\",\"chatID\":\"freechat\","
|
||||
+ "\"sessionID\":\"" + sessionId + "\"," + "\"jsm2SessionId\":\"" + jsm2SessionId + "\",\"userType\":\"user\"," + "\"performerId\":\""
|
||||
+ 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}}");
|
||||
response.close();
|
||||
}
|
||||
|
@ -136,13 +136,13 @@ public class LiveJasminTippingWebSocket {
|
|||
}
|
||||
|
||||
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()
|
||||
.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("Accept", "application/json,*/*")
|
||||
.header("Accept-Language", "en")
|
||||
.header("Referer", "https://www.livejasmin.com")
|
||||
.header("Referer", LiveJasmin.baseUrl)
|
||||
.header("X-Requested-With", "XMLHttpRequest")
|
||||
.build();
|
||||
try (Response response = client.execute(req)) {
|
||||
|
|
|
@ -76,7 +76,7 @@ public class LiveJasminWebSocketDownload implements Download {
|
|||
|
||||
Request request = new Request.Builder()
|
||||
.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("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")
|
||||
|
@ -91,7 +91,7 @@ public class LiveJasminWebSocketDownload implements Download {
|
|||
+ "\",\"connectionData\":{\"jasmin2App\":true,\"isMobileClient\":false,\"platform\":\"desktop\",\"chatID\":\"freechat\","
|
||||
+ "\"sessionID\":\"" + sessionId + "\"," + "\"jsm2SessionId\":\"" + jsm2SessionId + "\",\"userType\":\"user\"," + "\"performerId\":\""
|
||||
+ 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}}");
|
||||
response.close();
|
||||
}
|
||||
|
@ -218,13 +218,13 @@ public class LiveJasminWebSocketDownload implements Download {
|
|||
}
|
||||
|
||||
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()
|
||||
.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("Accept", "application/json,*/*")
|
||||
.header("Accept-Language", "en")
|
||||
.header("Referer", "https://www.livejasmin.com")
|
||||
.header("Referer", LiveJasmin.baseUrl)
|
||||
.header("X-Requested-With", "XMLHttpRequest")
|
||||
.build();
|
||||
try (Response response = client.execute(req)) {
|
||||
|
@ -260,7 +260,9 @@ public class LiveJasminWebSocketDownload implements Download {
|
|||
LOG.trace(rtmpUrl);
|
||||
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("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();
|
||||
|
|
Loading…
Reference in New Issue