Fix MVLive tabs

This commit is contained in:
0xb00bface 2022-05-07 18:30:31 +02:00
parent be225a1613
commit 36e5772dd5
2 changed files with 9 additions and 6 deletions

View File

@ -1,11 +1,12 @@
4.7.6
========================
* Save config in a sub-directory for each version.
* 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
freezes
* Fix Stripchat recordings
* Fix Stripchat thumbsnails
* Fix MVLive tabs
4.7.5
========================

View File

@ -28,13 +28,14 @@ import static java.nio.charset.StandardCharsets.UTF_8;
public class MVLive extends AbstractSite {
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 BASE_URL = "https://www.manyvids.com";
public static final String LIVE_URL = BASE_URL + "/mv-live/";
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 graphQlApiKeyPattern = Pattern.compile("use:\\s*\\[ce\\(\"(.*?)\"\\)].concat\\(ue\\(Object\\(se\\[\"a\"]\\)\\(\\)\\)\\)");
private final Pattern graphQlUrlPattern = Pattern.compile("api:\\s*\"(https://.+?.appsync-api..+?.amazonaws.com/graphql)\",");
private final Pattern graphQlApiKeyPattern = Pattern.compile("apiKey:\\s*\"(.*?)\"");
private String graphqlBaseUri;
private String apiKey;
@ -141,6 +142,7 @@ public class MVLive extends AbstractSite {
.header(ORIGIN, MVLive.BASE_URL)
.header(REFERER, MVLive.BASE_URL)
.build();
LOG.debug("Loading graphql config {}", spaBundleUrl);
try (Response response = getHttpClient().execute(request)) {
if (response.isSuccessful()) {
String content = response.body().string();
@ -277,7 +279,7 @@ public class MVLive extends AbstractSite {
RequestBody body = new FormBody.Builder()
.add("mvtoken", getMvToken())
.add("type", "search")
.add("category", "stars")
.add("category", STARS)
.add("search", q)
.build();
Request request = new Request.Builder()
@ -303,8 +305,8 @@ public class MVLive extends AbstractSite {
private void parseSearchResult(List<Model> result, String responseBody) {
JSONObject json = new JSONObject(responseBody);
if (json.has("stars")) {
JSONArray stars = json.getJSONArray("stars");
if (json.has(STARS)) {
JSONArray stars = json.getJSONArray(STARS);
for (int i = 0; i < stars.length(); i++) {
JSONObject star = stars.getJSONObject(i);
String name = star.getString("label");