Fix MVLive tabs
This commit is contained in:
parent
be225a1613
commit
36e5772dd5
|
@ -1,11 +1,12 @@
|
||||||
4.7.6
|
4.7.6
|
||||||
========================
|
========================
|
||||||
|
* Save config in a sub-directory for each version.
|
||||||
* Fix minimize to tray
|
* Fix minimize to tray
|
||||||
* Save coonfig in a sub-directory for each version.
|
|
||||||
* Add setting to disable tab dragging, because that might be the cause for tab
|
* Add setting to disable tab dragging, because that might be the cause for tab
|
||||||
freezes
|
freezes
|
||||||
* Fix Stripchat recordings
|
* Fix Stripchat recordings
|
||||||
* Fix Stripchat thumbsnails
|
* Fix Stripchat thumbsnails
|
||||||
|
* Fix MVLive tabs
|
||||||
|
|
||||||
4.7.5
|
4.7.5
|
||||||
========================
|
========================
|
||||||
|
|
|
@ -28,13 +28,14 @@ import static java.nio.charset.StandardCharsets.UTF_8;
|
||||||
public class MVLive extends AbstractSite {
|
public class MVLive extends AbstractSite {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(MVLive.class);
|
private static final Logger LOG = LoggerFactory.getLogger(MVLive.class);
|
||||||
|
private static final String STARS = "stars";
|
||||||
|
|
||||||
public static final String WS_ORIGIN = "https://live.manyvids.com";
|
public static final String WS_ORIGIN = "https://live.manyvids.com";
|
||||||
public static final String BASE_URL = "https://www.manyvids.com";
|
public static final String BASE_URL = "https://www.manyvids.com";
|
||||||
public static final String LIVE_URL = BASE_URL + "/mv-live/";
|
public static final String LIVE_URL = BASE_URL + "/mv-live/";
|
||||||
private final Pattern configPattern = Pattern.compile("<script type=\"combinativ-config\">(.*?)</script>");
|
private final Pattern configPattern = Pattern.compile("<script type=\"combinativ-config\">(.*?)</script>");
|
||||||
private final Pattern graphQlUrlPattern = Pattern.compile("url:\\s*\"(https://.+?.appsync-api..+?.amazonaws.com/graphql)\",");
|
private final Pattern graphQlUrlPattern = Pattern.compile("api:\\s*\"(https://.+?.appsync-api..+?.amazonaws.com/graphql)\",");
|
||||||
private final Pattern graphQlApiKeyPattern = Pattern.compile("use:\\s*\\[ce\\(\"(.*?)\"\\)].concat\\(ue\\(Object\\(se\\[\"a\"]\\)\\(\\)\\)\\)");
|
private final Pattern graphQlApiKeyPattern = Pattern.compile("apiKey:\\s*\"(.*?)\"");
|
||||||
private String graphqlBaseUri;
|
private String graphqlBaseUri;
|
||||||
private String apiKey;
|
private String apiKey;
|
||||||
|
|
||||||
|
@ -141,6 +142,7 @@ public class MVLive extends AbstractSite {
|
||||||
.header(ORIGIN, MVLive.BASE_URL)
|
.header(ORIGIN, MVLive.BASE_URL)
|
||||||
.header(REFERER, MVLive.BASE_URL)
|
.header(REFERER, MVLive.BASE_URL)
|
||||||
.build();
|
.build();
|
||||||
|
LOG.debug("Loading graphql config {}", spaBundleUrl);
|
||||||
try (Response response = getHttpClient().execute(request)) {
|
try (Response response = getHttpClient().execute(request)) {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
String content = response.body().string();
|
String content = response.body().string();
|
||||||
|
@ -277,7 +279,7 @@ public class MVLive extends AbstractSite {
|
||||||
RequestBody body = new FormBody.Builder()
|
RequestBody body = new FormBody.Builder()
|
||||||
.add("mvtoken", getMvToken())
|
.add("mvtoken", getMvToken())
|
||||||
.add("type", "search")
|
.add("type", "search")
|
||||||
.add("category", "stars")
|
.add("category", STARS)
|
||||||
.add("search", q)
|
.add("search", q)
|
||||||
.build();
|
.build();
|
||||||
Request request = new Request.Builder()
|
Request request = new Request.Builder()
|
||||||
|
@ -303,8 +305,8 @@ public class MVLive extends AbstractSite {
|
||||||
|
|
||||||
private void parseSearchResult(List<Model> result, String responseBody) {
|
private void parseSearchResult(List<Model> result, String responseBody) {
|
||||||
JSONObject json = new JSONObject(responseBody);
|
JSONObject json = new JSONObject(responseBody);
|
||||||
if (json.has("stars")) {
|
if (json.has(STARS)) {
|
||||||
JSONArray stars = json.getJSONArray("stars");
|
JSONArray stars = json.getJSONArray(STARS);
|
||||||
for (int i = 0; i < stars.length(); i++) {
|
for (int i = 0; i < stars.length(); i++) {
|
||||||
JSONObject star = stars.getJSONObject(i);
|
JSONObject star = stars.getJSONObject(i);
|
||||||
String name = star.getString("label");
|
String name = star.getString("label");
|
||||||
|
|
Loading…
Reference in New Issue