fix hitomi images (#9687)

* fix hitomi images

* Update build.gradle
This commit is contained in:
Basara-Hatake 2021-11-01 12:30:31 +01:00 committed by GitHub
parent e6a9517a44
commit 7a76a2756f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -6,7 +6,7 @@ ext {
extName = 'Hitomi.la' extName = 'Hitomi.la'
pkgNameSuffix = 'all.hitomi' pkgNameSuffix = 'all.hitomi'
extClass = '.HitomiFactory' extClass = '.HitomiFactory'
extVersionCode = 10 extVersionCode = 11
isNsfw = true isNsfw = true
} }

View File

@ -359,7 +359,7 @@ open class Hitomi(override val lang: String, private val nozomiLang: String) : H
// https://ltn.hitomi.la/reader.js // https://ltn.hitomi.la/reader.js
// function make_image_element() // function make_image_element()
val secondSubdomain = if (jsonElement.haswebp == 0 && jsonElement.hasavif == 0) "b" else "a" val secondSubdomain = if (jsonElement.haswebp == 0 && jsonElement.hasavif == 0 || !hitomiAlwaysWebp()) "b" else "a"
Page(i, "", "https://${firstSubdomainFromGalleryId(hashPath2)}$secondSubdomain.hitomi.la/$path/$hashPath1/$hashPath2/$hash.$ext") Page(i, "", "https://${firstSubdomainFromGalleryId(hashPath2)}$secondSubdomain.hitomi.la/$path/$hashPath1/$hashPath2/$hash.$ext")
} }
} }
@ -370,8 +370,7 @@ open class Hitomi(override val lang: String, private val nozomiLang: String) : H
private fun firstSubdomainFromGalleryId(pathSegment: String): Char { private fun firstSubdomainFromGalleryId(pathSegment: String): Char {
var o = 0 var o = 0
val g = pathSegment.toInt(16) val g = pathSegment.toInt(16)
if (g < 0x88) o = 1 if (g < 0x7c) o = 1
if (g < 0x44) o = 2
return (97 + o).toChar() return (97 + o).toChar()
} }