Remove recommended tab from CB, because it does not return any recommendations anymore
This commit is contained in:
parent
2b2182354c
commit
cf29439a7f
|
@ -26,7 +26,7 @@ public class ChaturbateTabProvider extends AbstractTabProvider {
|
||||||
tabs.add(createTab("Female", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&genders=f"));
|
tabs.add(createTab("Female", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&genders=f"));
|
||||||
tabs.add(createTab("New Female", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&genders=f&new_cams=true"));
|
tabs.add(createTab("New Female", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&genders=f&new_cams=true"));
|
||||||
tabs.add(createTab("Male", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&genders=m"));
|
tabs.add(createTab("Male", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&genders=m"));
|
||||||
tabs.add(createTab("New Boys", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&genders=m&new_cams=true"));
|
tabs.add(createTab("New Male", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&genders=m&new_cams=true"));
|
||||||
tabs.add(createTab("Couples", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&genders=c"));
|
tabs.add(createTab("Couples", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&genders=c"));
|
||||||
tabs.add(createTab("Trans", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&genders=s"));
|
tabs.add(createTab("Trans", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&genders=s"));
|
||||||
tabs.add(createTab("Private", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&private=true"));
|
tabs.add(createTab("Private", site.getBaseUrl() + "/api/ts/roomlist/room-list/?enable_recommendations=false&private=true"));
|
||||||
|
@ -37,7 +37,6 @@ public class ChaturbateTabProvider extends AbstractTabProvider {
|
||||||
tabs.add(followedTab);
|
tabs.add(followedTab);
|
||||||
tabs.add(createApiTab("Top Rated", site.getBaseUrl() + "/api/ts/discover/carousels/top-rated/"));
|
tabs.add(createApiTab("Top Rated", site.getBaseUrl() + "/api/ts/discover/carousels/top-rated/"));
|
||||||
tabs.add(createApiTab("Trending", site.getBaseUrl() + "/api/ts/discover/carousels/trending/"));
|
tabs.add(createApiTab("Trending", site.getBaseUrl() + "/api/ts/discover/carousels/trending/"));
|
||||||
tabs.add(createApiTab("Recommended", site.getBaseUrl() + "/api/ts/discover/carousels/recommended/"));
|
|
||||||
return tabs;
|
return tabs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,11 @@ import ctbrec.sites.chaturbate.ChaturbateModel;
|
||||||
import ctbrec.ui.SiteUiFactory;
|
import ctbrec.ui.SiteUiFactory;
|
||||||
import ctbrec.ui.tabs.PaginatedScheduledService;
|
import ctbrec.ui.tabs.PaginatedScheduledService;
|
||||||
import javafx.concurrent.Task;
|
import javafx.concurrent.Task;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import okhttp3.Request;
|
import okhttp3.Request;
|
||||||
import org.json.JSONArray;
|
import org.json.JSONArray;
|
||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
import org.jsoup.Jsoup;
|
import org.jsoup.Jsoup;
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
@ -22,9 +21,9 @@ import java.util.Locale;
|
||||||
|
|
||||||
import static ctbrec.io.HttpConstants.*;
|
import static ctbrec.io.HttpConstants.*;
|
||||||
|
|
||||||
|
@Slf4j
|
||||||
public class ChaturbateUpdateService extends PaginatedScheduledService {
|
public class ChaturbateUpdateService extends PaginatedScheduledService {
|
||||||
|
|
||||||
private static final Logger LOG = LoggerFactory.getLogger(ChaturbateUpdateService.class);
|
|
||||||
private String url;
|
private String url;
|
||||||
private final boolean loginRequired;
|
private final boolean loginRequired;
|
||||||
private final Chaturbate chaturbate;
|
private final Chaturbate chaturbate;
|
||||||
|
@ -46,7 +45,7 @@ public class ChaturbateUpdateService extends PaginatedScheduledService {
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
} else {
|
} else {
|
||||||
String pageUrl = ChaturbateUpdateService.this.url + "&limit=" + PAGE_SIZE + "&offset=" + (page - 1) * PAGE_SIZE;
|
String pageUrl = ChaturbateUpdateService.this.url + "&limit=" + PAGE_SIZE + "&offset=" + (page - 1) * PAGE_SIZE;
|
||||||
LOG.debug("Fetching page {}", pageUrl);
|
log.debug("Fetching page {}", pageUrl);
|
||||||
if (loginRequired) {
|
if (loginRequired) {
|
||||||
SiteUiFactory.getUi(chaturbate).login();
|
SiteUiFactory.getUi(chaturbate).login();
|
||||||
}
|
}
|
||||||
|
@ -59,8 +58,9 @@ public class ChaturbateUpdateService extends PaginatedScheduledService {
|
||||||
.build();
|
.build();
|
||||||
try (var response = chaturbate.getHttpClient().execute(request)) {
|
try (var response = chaturbate.getHttpClient().execute(request)) {
|
||||||
if (response.isSuccessful()) {
|
if (response.isSuccessful()) {
|
||||||
|
String body = response.body().string();
|
||||||
List<Model> models = new ArrayList<>();
|
List<Model> models = new ArrayList<>();
|
||||||
JSONObject json = new JSONObject(response.body().string());
|
JSONObject json = new JSONObject(body);
|
||||||
if (json.has("rooms")) {
|
if (json.has("rooms")) {
|
||||||
JSONArray rooms = json.optJSONArray("rooms");
|
JSONArray rooms = json.optJSONArray("rooms");
|
||||||
for (int i = 0; i < rooms.length(); i++) {
|
for (int i = 0; i < rooms.length(); i++) {
|
||||||
|
|
Loading…
Reference in New Issue