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
|
authData.clientLoginToken = try {
|
||||||
.split("\n")
|
toDTO<GoogleReaderDTO.MinifluxAuthData>(clBody).Auth
|
||||||
.find { it.startsWith("Auth=") }
|
} catch (ignore: Exception) {
|
||||||
?.substring(5)
|
clBody
|
||||||
?: throw Exception("body format error for CL Token:\n$clBody")
|
.split("\n")
|
||||||
|
.find { it.startsWith("Auth=") }
|
||||||
|
?.substring(5)
|
||||||
|
?: throw Exception("body format error for CL Token:\n$clBody")
|
||||||
|
}
|
||||||
|
|
||||||
// Get action token
|
// Get action token
|
||||||
val actResponse = client.newCall(
|
val actResponse = client.newCall(
|
||||||
|
@ -8,6 +8,20 @@ object GoogleReaderDTO {
|
|||||||
@SerializedName("errors") val errors: List<String>,
|
@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
|
* @link reader/api/0/user-info?output=json
|
||||||
* @sample
|
* @sample
|
||||||
|
Loading…
x
Reference in New Issue
Block a user