Webtoons - add locale cookie (#2692)

Webtoons - add locale cookie
This commit is contained in:
Mike 2020-04-16 23:34:36 -04:00 committed by GitHub
parent a5a1405186
commit b535f2765b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 14 additions and 4 deletions

View File

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

View File

@ -9,7 +9,11 @@ import org.jsoup.nodes.Document
import org.jsoup.nodes.Element import org.jsoup.nodes.Element
import java.util.Calendar import java.util.Calendar
abstract class Webtoons(override val lang: String, open val langCode: String = lang) : ParsedHttpSource() { abstract class Webtoons(
override val lang: String,
open val langCode: String = lang,
open val localeForCookie: String = lang
) : ParsedHttpSource() {
override val name = "Webtoons.com" override val name = "Webtoons.com"
@ -27,6 +31,8 @@ abstract class Webtoons(override val lang: String, open val langCode: String = l
.path("/") .path("/")
.name("ageGatePass") .name("ageGatePass")
.value("true") .value("true")
.name("locale")
.value(localeForCookie)
.build() .build()
) )
} }

View File

@ -9,7 +9,11 @@ import org.jsoup.nodes.Element
import java.text.SimpleDateFormat import java.text.SimpleDateFormat
import java.util.* import java.util.*
open class WebtoonsDefault(override val lang: String, override val langCode: String = lang) : Webtoons(lang, langCode) { open class WebtoonsDefault(
override val lang: String,
override val langCode: String = lang,
override val localeForCookie: String = lang
) : Webtoons(lang, langCode, lang) {
override fun chapterListSelector() = "ul#_episodeList > li[id*=episode]" override fun chapterListSelector() = "ul#_episodeList > li[id*=episode]"

View File

@ -73,7 +73,7 @@ class WebtoonsThai: WebtoonsDefault("th") {
} }
} }
class WebtoonsChineseTraditional: WebtoonsDefault("zh", "zh-hant") { class WebtoonsChineseTraditional: WebtoonsDefault("zh", "zh-hant", "zh_TW") {
override fun chapterParseDate(date: String): Long { override fun chapterParseDate(date: String): Long {
return SimpleDateFormat("yyyy/MM/dd", Locale.TRADITIONAL_CHINESE).parse(date).time return SimpleDateFormat("yyyy/MM/dd", Locale.TRADITIONAL_CHINESE).parse(date).time
} }