Skip to content

Commit

Permalink
Sync with upstream API change
Browse files Browse the repository at this point in the history
  • Loading branch information
xb2016 committed Nov 1, 2023
1 parent f3aefce commit 1293b48
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ object GalleryPageApiParser {
private val PATTERN_IMAGE_URL = Pattern.compile("<img[^>]*src=\"([^\"]+)\" style")
private val PATTERN_SKIP_HATH_KEY = Pattern.compile("onclick=\"return nl\\('([^)]+)'\\)")
private val PATTERN_ORIGIN_IMAGE_URL =
Pattern.compile("<a href=\"([^\"]+)fullimg.php([^\"]+)\">")
Pattern.compile("<a href=\"([^\"]+)fullimg([^\"]+)\">")

fun parse(body: String): Result {
return try {
Expand All @@ -51,7 +51,7 @@ object GalleryPageApiParser {
}
m = PATTERN_ORIGIN_IMAGE_URL.matcher(i6)
val originImageUrl = if (m.find()) {
StringUtils.unescapeXml(m.group(1)) + "fullimg.php" +
StringUtils.unescapeXml(m.group(1)) + "fullimg" +
StringUtils.unescapeXml(m.group(2))
} else {
null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object GalleryPageParser {
private val PATTERN_IMAGE_URL = Pattern.compile("<img[^>]*src=\"([^\"]+)\" style")
private val PATTERN_SKIP_HATH_KEY = Pattern.compile("onclick=\"return nl\\('([^)]+)'\\)")
private val PATTERN_ORIGIN_IMAGE_URL =
Pattern.compile("<a href=\"([^\"]+)fullimg.php([^\"]+)\">")
Pattern.compile("<a href=\"([^\"]+)fullimg([^\"]+)\">")

// TODO Not sure about the size of show keys
private val PATTERN_SHOW_KEY = Pattern.compile("var showkey=\"([0-9a-z]+)\";")
Expand All @@ -43,7 +43,7 @@ object GalleryPageParser {
}
m = PATTERN_ORIGIN_IMAGE_URL.matcher(body)
val originImageUrl = if (m.find()) {
StringUtils.unescapeXml(m.group(1)) + "fullimg.php" +
StringUtils.unescapeXml(m.group(1)) + "fullimg" +
StringUtils.unescapeXml(m.group(2))
} else {
null
Expand Down

0 comments on commit 1293b48

Please sign in to comment.