Use random names to load the offline image

This commit is contained in:
0xb00bface 2023-12-30 22:38:07 +01:00
parent 81f641b777
commit 71c2d74857
1 changed files with 3 additions and 1 deletions

View File

@ -38,6 +38,7 @@ public class ChaturbateModel extends AbstractModel {
private int[] resolution = new int[2];
private transient StreamInfo streamInfo;
private transient Instant lastStreamInfoRequest = Instant.EPOCH;
private static final Random RNG = new Random();
private static int offlineImageSize = 0;
private final transient ObjectMapper mapper = ObjectMapperFactory.getMapper();
@ -82,7 +83,8 @@ public class ChaturbateModel extends AbstractModel {
}
private int getOfflineImageSize() {
String randomName = UUID.randomUUID().toString().replace("-", "").substring(0, 10);
String[] names = {"Sophia", "Helena", "Olivia", "Natasha", "Emmy", "Jenny", "Diana", "Teresa", "Julia", "Polly", "Amanda"};
String randomName = names[RNG.nextInt(names.length)] + RNG.nextInt(99);
String previewUrl = "https://roomimg.stream.highwebmedia.com/ri/" + randomName + ".jpg?" + Instant.now().getEpochSecond();
int imageSize = getImageSize(previewUrl);
if (imageSize == 0) {