feat(greader): compatible with Miniflux login
This commit is contained in:
parent
193ed198a9
commit
3a645006b6
@ -62,11 +62,15 @@ class GoogleReaderAPI private constructor(
|
||||
}
|
||||
}
|
||||
|
||||
authData.clientLoginToken = clBody
|
||||
.split("\n")
|
||||
.find { it.startsWith("Auth=") }
|
||||
?.substring(5)
|
||||
?: throw Exception("body format error for CL Token:\n$clBody")
|
||||
authData.clientLoginToken = try {
|
||||
toDTO<GoogleReaderDTO.MinifluxAuthData>(clBody).Auth
|
||||
} catch (ignore: Exception) {
|
||||
clBody
|
||||
.split("\n")
|
||||
.find { it.startsWith("Auth=") }
|
||||
?.substring(5)
|
||||
?: throw Exception("body format error for CL Token:\n$clBody")
|
||||
}
|
||||
|
||||
// Get action token
|
||||
val actResponse = client.newCall(
|
||||
|
@ -8,6 +8,20 @@ object GoogleReaderDTO {
|
||||
@SerializedName("errors") val errors: List<String>,
|
||||
)
|
||||
|
||||
/**
|
||||
* @sample
|
||||
*{
|
||||
* "SID": "demo/718*********************************7fa",
|
||||
* "LSID": "demo/718*********************************7fa",
|
||||
* "Auth": "demo/718*********************************7fa"
|
||||
* }
|
||||
*/
|
||||
data class MinifluxAuthData(
|
||||
val SID: String?,
|
||||
val LSID: String?,
|
||||
val Auth: String?,
|
||||
)
|
||||
|
||||
/**
|
||||
* @link reader/api/0/user-info?output=json
|
||||
* @sample
|
||||
|
Loading…
x
Reference in New Issue
Block a user