deleted hiyobi support

This commit is contained in:
tom5079
2019-06-06 02:02:20 +09:00
parent 57e08d2208
commit 01c1537ae8
8 changed files with 28 additions and 31 deletions

View File

@@ -13,6 +13,12 @@ const val hiyobi = "xn--9w3b15m8vo.asia"
const val user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/74.0.3729.131 Safari/537.36"
var cookie: String = ""
get() {
if (field.isEmpty())
field = renewCookie()
return field
}
fun renewCookie() : String {
val url = "https://$hiyobi/"
@@ -32,9 +38,6 @@ fun renewCookie() : String {
fun getReader(galleryId: Int) : Reader {
val url = "https://$hiyobi/data/json/${galleryId}_list.json"
if (cookie.isEmpty())
cookie = renewCookie()
try {
val json = Json(JsonConfiguration.Stable).parseJson(
with(URL(url).openConnection() as HttpsURLConnection) {

View File

@@ -14,8 +14,7 @@ class UnitTest {
fun test_nozomi() {
val nozomi = fetchNozomi(start = 0, count = 5)
for (n in nozomi)
println(n)
nozomi.first
}
@Test
@@ -62,6 +61,8 @@ class UnitTest {
@Test
fun test_hiyobi() {
print(xyz.quaver.hiyobi.getReader(1415416).size)
xyz.quaver.hiyobi.getReader(1415416).forEach {
println(it.url)
}
}
}