Added support for gallery unregistered in hitomi

This commit is contained in:
Pupil
2020-02-08 20:36:08 +09:00
parent ecaecc1b91
commit a0a989c785
11 changed files with 112 additions and 26 deletions

View File

@@ -18,6 +18,7 @@ package xyz.quaver.hitomi
import kotlinx.serialization.Serializable
import org.jsoup.Jsoup
import xyz.quaver.Code
import java.net.URL
import java.net.URLDecoder
import java.nio.ByteBuffer
@@ -67,6 +68,7 @@ fun fetchNozomi(area: String? = null, tag: String = "index", language: String =
@Serializable
data class GalleryBlock(
val code: Code,
val id: Int,
val galleryUrl: String,
val thumbnails: List<String>,
@@ -102,7 +104,7 @@ fun getGalleryBlock(galleryID: Int) : GalleryBlock? {
href.slice(5 until href.indexOf("-all"))
}
return GalleryBlock(galleryID, galleryUrl, thumbnails, title, artists, series, type, language, relatedTags)
return GalleryBlock(Code.HITOMI, galleryID, galleryUrl, thumbnails, title, artists, series, type, language, relatedTags)
} catch (e: Exception) {
return null
}