YT Mp3 Extraction fixes and 128 -> 192 KBPS

This commit is contained in:
shabinder 2021-07-10 12:38:25 +05:30
parent 9881cc55aa
commit baac818d5a

View File

@ -22,6 +22,7 @@ import com.shabinder.common.models.event.coroutines.SuspendableEvent
import com.shabinder.common.models.event.coroutines.flatMap import com.shabinder.common.models.event.coroutines.flatMap
import com.shabinder.common.models.event.coroutines.map import com.shabinder.common.models.event.coroutines.map
import com.shabinder.common.requireNotNull import com.shabinder.common.requireNotNull
import io.github.shabinder.utils.getJsonObject
import io.ktor.client.* import io.ktor.client.*
import io.ktor.client.request.* import io.ktor.client.request.*
import io.ktor.client.request.forms.* import io.ktor.client.request.forms.*
@ -62,7 +63,10 @@ interface Yt1sMp3 {
) )
} }
response["kc"].requireNotNull().jsonPrimitive.content response.getJsonObject("links")
.getJsonObject("mp3")
.getJsonObject("192")
?.get("k").requireNotNull().jsonPrimitive.content
} }
private suspend fun getConvertedMp3Link(videoID: String, key: String): SuspendableEvent<JsonObject,Throwable> = SuspendableEvent { private suspend fun getConvertedMp3Link(videoID: String, key: String): SuspendableEvent<JsonObject,Throwable> = SuspendableEvent {