View Single Post
  #1  
Old 08.06.2021, 23:04
damo damo is offline
JD Alpha
 
Join Date: Jan 2020
Posts: 23
Default Hitomi.la updated gallery code

Hitomi.la changed the gallery code so I've updated the relevant function:

Code:
  String subdomain_from_url(String url, String base) {
    String retval = "b";
    if (base != null) {
      retval = base;
    }

    int number_of_frontends = 3;

    Matcher m = SUBDOMAIN_FROM_URL_PATTERN.matcher(url);
    if (!m.find()) {
      return "a";
    }

    try {
      int g = Integer.parseInt(m.group(1), 16);
      if (g < 0x80) {
        number_of_frontends = 2;
      }
      if (g < 0x59) {
        g = 1;
      }
      retval = subdomain_from_galleryid(g, number_of_frontends) + retval;
    } catch (NumberFormatException ignore) {}

    return retval;
  }
They changed the if-clauses for g, it was:
Code:
      if (g < 0x30) {
        number_of_frontends = 2;
      }
      if (g < 0x09) {
        g = 1;
      }
Reply With Quote