webtoon age gate fix (#2280)

webtoon age gate fix
This commit is contained in:
E3FxGaming 2020-02-22 15:35:46 +01:00 committed by GitHub
parent 955ef683ac
commit e7ec260b70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 19 additions and 5 deletions

View File

@ -5,7 +5,7 @@ ext {
appName = 'Tachiyomi: Webtoons'
pkgNameSuffix = 'all.webtoons'
extClass = '.WebtoonsFactory'
extVersionCode = 13
extVersionCode = 14
libVersion = '1.2'
}

View File

@ -4,10 +4,7 @@ import eu.kanade.tachiyomi.network.GET
import eu.kanade.tachiyomi.source.model.*
import eu.kanade.tachiyomi.source.online.ParsedHttpSource
import eu.kanade.tachiyomi.util.asJsoup
import okhttp3.Headers
import okhttp3.Request
import okhttp3.Response
import okhttp3.HttpUrl
import okhttp3.*
import org.jsoup.nodes.Document
import org.jsoup.nodes.Element
import java.util.Calendar
@ -20,6 +17,23 @@ abstract class Webtoons(override val lang: String, open val langCode: String = l
override val supportsLatest = true
override val client = super.client.newBuilder()
.cookieJar(object : CookieJar {
override fun saveFromResponse(url: HttpUrl, cookies: List<Cookie>) {}
override fun loadForRequest(url: HttpUrl): List<Cookie> {
return listOf<Cookie>(
Cookie.Builder()
.domain("www.webtoons.com")
.path("/")
.name("ageGatePass")
.value("true")
.build()
)
}
})
.build()
private val day: String
get() {
return when (Calendar.getInstance().get(Calendar.DAY_OF_WEEK)) {