mirror of
https://github.com/Shabinder/SpotiFlyer.git
synced 2024-11-24 09:54:33 +01:00
Ktor Parsing Error Fix and Bump to v3.6.1
This commit is contained in:
parent
1b929b7449
commit
c15b70b996
6
.github/workflows/build-release-binaries.yml
vendored
6
.github/workflows/build-release-binaries.yml
vendored
@ -32,7 +32,7 @@ jobs:
|
||||
with:
|
||||
draft: true
|
||||
allowUpdates: true
|
||||
tag: "v3.6.0"
|
||||
tag: "v3.6.1"
|
||||
artifacts: "desktop/build/compose/jars/*.jar,desktop/build/compose/binaries/main/*/*"
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
@ -81,7 +81,7 @@ jobs:
|
||||
with:
|
||||
draft: true
|
||||
allowUpdates: true
|
||||
tag: "v3.6.0"
|
||||
tag: "v3.6.1"
|
||||
artifacts: "desktop/build/compose/jars/*.jar,desktop/build/compose/binaries/main/*/*,android/build/outputs/apk/release/*signed.apk"
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
|
||||
@ -114,6 +114,6 @@ jobs:
|
||||
with:
|
||||
draft: true
|
||||
allowUpdates: true
|
||||
tag: "v3.6.0"
|
||||
tag: "v3.6.1"
|
||||
artifacts: "desktop/build/compose/jars/*.jar,desktop/build/compose/binaries/main/*/*"
|
||||
token: ${{ secrets.GH_TOKEN }}
|
||||
|
@ -26,9 +26,9 @@ import org.gradle.kotlin.dsl.getByType
|
||||
|
||||
object Versions {
|
||||
// App's Version (To be bumped at each update)
|
||||
const val versionName = "3.6.0"
|
||||
const val versionName = "3.6.1"
|
||||
|
||||
const val versionCode = 28
|
||||
const val versionCode = 29
|
||||
|
||||
// Android
|
||||
const val minSdkVersion = 21
|
||||
|
@ -25,6 +25,7 @@ androidxLifecycle = "2.4.0-alpha03"
|
||||
[libraries]
|
||||
kotlin-kotlinGradlePlugin = { group = "org.jetbrains.kotlin", name = "kotlin-gradle-plugin", version.ref = "kotlin" }
|
||||
kotlin-serialization = { group = "org.jetbrains.kotlin", name = "kotlin-serialization", version.ref = "kotlin" }
|
||||
kotlin-reflect = { group = "org.jetbrains.kotlin", name = "kotlin-reflect", version.ref = "kotlin" }
|
||||
kotlin-kotlinTestCommon = { group = "org.jetbrains.kotlin", name = "kotlin-test-common", version.ref = "kotlin" }
|
||||
kotlin-kotlinTestJs = { group = "org.jetbrains.kotlin", name = "kotlin-test-js", version.ref = "kotlin" }
|
||||
kotlin-kotlinTestJunit = { group = "org.jetbrains.kotlin", name = "kotlin-test-junit", version.ref = "kotlin" }
|
||||
|
@ -43,32 +43,30 @@ suspend inline fun HttpClient.getFinalUrl(
|
||||
}
|
||||
}
|
||||
|
||||
fun createHttpClient(enableNetworkLogs: Boolean = false) = HttpClient {
|
||||
buildHttpClient {
|
||||
// https://github.com/Kotlin/kotlinx.serialization/issues/1450
|
||||
install(JsonFeature) {
|
||||
serializer = KotlinxSerializer(globalJson)
|
||||
}
|
||||
install(HttpTimeout) {
|
||||
socketTimeoutMillis = 520_000
|
||||
requestTimeoutMillis = 360_000
|
||||
connectTimeoutMillis = 360_000
|
||||
}
|
||||
// WorkAround for Freezing
|
||||
// Use httpClient.getData / httpClient.postData Extensions
|
||||
/*install(JsonFeature) {
|
||||
serializer = KotlinxSerializer(
|
||||
Json {
|
||||
isLenient = true
|
||||
ignoreUnknownKeys = true
|
||||
}
|
||||
)
|
||||
}*/
|
||||
if (enableNetworkLogs) {
|
||||
install(Logging) {
|
||||
logger = Logger.DEFAULT
|
||||
level = LogLevel.INFO
|
||||
fun createHttpClient(enableNetworkLogs: Boolean = false) = buildHttpClient {
|
||||
// https://github.com/Kotlin/kotlinx.serialization/issues/1450
|
||||
install(JsonFeature) {
|
||||
serializer = KotlinxSerializer(globalJson)
|
||||
}
|
||||
install(HttpTimeout) {
|
||||
socketTimeoutMillis = 520_000
|
||||
requestTimeoutMillis = 360_000
|
||||
connectTimeoutMillis = 360_000
|
||||
}
|
||||
// WorkAround for Freezing
|
||||
// Use httpClient.getData / httpClient.postData Extensions
|
||||
/*install(JsonFeature) {
|
||||
serializer = KotlinxSerializer(
|
||||
Json {
|
||||
isLenient = true
|
||||
ignoreUnknownKeys = true
|
||||
}
|
||||
)
|
||||
}*/
|
||||
if (enableNetworkLogs) {
|
||||
install(Logging) {
|
||||
logger = Logger.DEFAULT
|
||||
level = LogLevel.INFO
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -77,4 +75,4 @@ expect fun buildHttpClient(extraConfig: HttpClientConfig<*>.() -> Unit): HttpCli
|
||||
|
||||
/*Client Active Throughout App's Lifetime*/
|
||||
@SharedImmutable
|
||||
val ktorHttpClient = HttpClient {}
|
||||
private val ktorHttpClient = HttpClient {}
|
@ -152,17 +152,15 @@ interface SoundCloudRequests {
|
||||
suspend inline fun <reified T : Any> SoundCloudRequests.doAuthenticatedRequest(url: String): T {
|
||||
var clientID: String = SoundCloudRequests.CLIENT_ID
|
||||
return try {
|
||||
val data: String = httpClient.get(url) {
|
||||
httpClient.get(url) {
|
||||
parameter("client_id", clientID)
|
||||
}
|
||||
globalJson.decodeFromString(data)
|
||||
} catch (e: ClientRequestException) {
|
||||
if (clientID != SoundCloudRequests.ALT_CLIENT_ID) {
|
||||
clientID = SoundCloudRequests.ALT_CLIENT_ID
|
||||
val data: String = httpClient.get(url) {
|
||||
return httpClient.get(url) {
|
||||
parameter("client_id", clientID)
|
||||
}
|
||||
return globalJson.decodeFromString(data)
|
||||
}
|
||||
throw e
|
||||
}
|
||||
|
@ -34,9 +34,11 @@ import com.shabinder.common.providers.youtube_to_mp3.requests.YoutubeMp3
|
||||
import com.shabinder.common.utils.appendPadded
|
||||
import io.github.shabinder.fuzzywuzzy.diffutils.FuzzySearch
|
||||
import io.ktor.client.HttpClient
|
||||
import io.ktor.client.request.header
|
||||
import io.ktor.client.request.headers
|
||||
import io.ktor.client.request.post
|
||||
import io.ktor.http.ContentType
|
||||
import io.ktor.http.HttpHeaders
|
||||
import io.ktor.http.contentType
|
||||
import kotlinx.serialization.json.Json
|
||||
import kotlinx.serialization.json.JsonArray
|
||||
@ -357,8 +359,8 @@ class YoutubeMusic constructor(
|
||||
private suspend fun getYoutubeMusicResponse(query: String): SuspendableEvent<String, Throwable> =
|
||||
SuspendableEvent {
|
||||
httpClient.post("${corsApi}https://music.youtube.com/youtubei/v1/search?alt=json&key=$apiKey") {
|
||||
contentType(ContentType.Application.Json)
|
||||
headers {
|
||||
append(HttpHeaders.ContentType, ContentType.Application.Json.toString())
|
||||
append("referer", "https://music.youtube.com/search")
|
||||
}
|
||||
body = buildJsonObject {
|
||||
|
1
fastlane/metadata/android/en-US/changelogs/29.txt
Normal file
1
fastlane/metadata/android/en-US/changelogs/29.txt
Normal file
@ -0,0 +1 @@
|
||||
- Fixed Response Parsing Error which leaded download failure.
|
Loading…
Reference in New Issue
Block a user