|
|
|
|
@ -105,15 +105,15 @@ public class Util { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public static int getDigit(String text) { |
|
|
|
|
public static int getNumber(String text) { |
|
|
|
|
try { |
|
|
|
|
text = text.replaceAll("\\[.*?\\]|\\(.*?\\)", ""); |
|
|
|
|
text = text.replaceAll("\\b(19|20)\\d{2}\\b", ""); |
|
|
|
|
text = text.toLowerCase().replaceAll("2160p|1080p|720p|480p|4k|h26[45]|x26[45]|mp4", ""); |
|
|
|
|
Matcher matcher = EPISODE.matcher(text); |
|
|
|
|
if (matcher.find()) return Integer.parseInt(matcher.group(1)); |
|
|
|
|
String digit = text.replaceAll("\\D+", ""); |
|
|
|
|
return digit.isEmpty() ? -1 : Integer.parseInt(digit); |
|
|
|
|
String number = text.replaceAll("\\D+", ""); |
|
|
|
|
return number.isEmpty() ? -1 : Integer.parseInt(number); |
|
|
|
|
} catch (Exception e) { |
|
|
|
|
return -1; |
|
|
|
|
} |
|
|
|
|
|