forked from j62/ctbrec
Use random names to load the offline image
This commit is contained in:
parent
81f641b777
commit
71c2d74857
|
@ -38,6 +38,7 @@ public class ChaturbateModel extends AbstractModel {
|
||||||
private int[] resolution = new int[2];
|
private int[] resolution = new int[2];
|
||||||
private transient StreamInfo streamInfo;
|
private transient StreamInfo streamInfo;
|
||||||
private transient Instant lastStreamInfoRequest = Instant.EPOCH;
|
private transient Instant lastStreamInfoRequest = Instant.EPOCH;
|
||||||
|
private static final Random RNG = new Random();
|
||||||
private static int offlineImageSize = 0;
|
private static int offlineImageSize = 0;
|
||||||
private final transient ObjectMapper mapper = ObjectMapperFactory.getMapper();
|
private final transient ObjectMapper mapper = ObjectMapperFactory.getMapper();
|
||||||
|
|
||||||
|
@ -82,7 +83,8 @@ public class ChaturbateModel extends AbstractModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getOfflineImageSize() {
|
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();
|
String previewUrl = "https://roomimg.stream.highwebmedia.com/ri/" + randomName + ".jpg?" + Instant.now().getEpochSecond();
|
||||||
int imageSize = getImageSize(previewUrl);
|
int imageSize = getImageSize(previewUrl);
|
||||||
if (imageSize == 0) {
|
if (imageSize == 0) {
|
||||||
|
|
Loading…
Reference in New Issue