|
|
@ -54,14 +54,15 @@ data class BookSource( |
|
|
|
fun getHeaderMap() = (HashMap<String, String>().apply { |
|
|
|
fun getHeaderMap() = (HashMap<String, String>().apply { |
|
|
|
this[AppConst.UA_NAME] = App.INSTANCE.getPrefString("user_agent") ?: userAgent |
|
|
|
this[AppConst.UA_NAME] = App.INSTANCE.getPrefString("user_agent") ?: userAgent |
|
|
|
header?.let { |
|
|
|
header?.let { |
|
|
|
val header1 = when { |
|
|
|
GSON.fromJsonObject<Map<String, String>>( |
|
|
|
|
|
|
|
when { |
|
|
|
it.startsWith("@js:", true) -> |
|
|
|
it.startsWith("@js:", true) -> |
|
|
|
evalJS(it.substring(4)).toString() |
|
|
|
evalJS(it.substring(4)).toString() |
|
|
|
it.startsWith("<js>", true) -> |
|
|
|
it.startsWith("<js>", true) -> |
|
|
|
evalJS(it.substring(4, it.lastIndexOf("<"))).toString() |
|
|
|
evalJS(it.substring(4, it.lastIndexOf("<"))).toString() |
|
|
|
else -> it |
|
|
|
else -> it |
|
|
|
} |
|
|
|
} |
|
|
|
GSON.fromJsonObject<Map<String, String>>(header1)?.let { map -> |
|
|
|
)?.let { map -> |
|
|
|
putAll(map) |
|
|
|
putAll(map) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|