Yt1s Link Extraction Fixes

This commit is contained in:
shabinder 2021-09-03 12:43:01 +05:30
parent 86e6a9f3a8
commit ab2fea910a
3 changed files with 8 additions and 5 deletions

View File

@ -23,7 +23,7 @@ import org.gradle.kotlin.dsl.accessors.runtime.addDependencyTo
object Versions {
// App's Version (To be bumped at each update)
const val versionName = "3.3"
const val versionName = "3.2.5"
const val versionCode = 24

View File

@ -67,12 +67,15 @@ interface Yt1sMp3 {
val mp3Keys = response.getJsonObject("links")
.getJsonObject("mp3")
// This Site now only gives 128kbps mp3 which is reasonable
val requestedKBPS = when (quality) {
AudioQuality.KBPS128 -> "mp3128"
else -> quality.kbps
else -> "mp3128"//quality.kbps
}
val specificQualityKey = mp3Keys.getJsonObject(requestedKBPS) ?: mp3Keys.getJsonObject("192")
val specificQualityKey = mp3Keys.getJsonObject(requestedKBPS)
?: // Try M4a Link
response.getJsonObject("links").getJsonObject("m4a").getJsonObject("140")
specificQualityKey?.get("k").requireNotNull().jsonPrimitive.content
}

View File

@ -16,8 +16,8 @@ class TestSpotifyTrackMatching {
}
private val spotifyToken: String?
// get() = null
get() = "BQB41HqrLcrh5eRYaL97GvaH6tRe-1EktQ8VGTWUQuFnYVWBEoTcF7T_8ogqVn1GHl9HCcMiQ0HBT-ybC74"
get() = null
// get() = "BQB41HqrLcrh5eRYaL97GvaH6tRe-1EktQ8VGTWUQuFnYVWBEoTcF7T_8ogqVn1GHl9HCcMiQ0HBT-ybC74"
@Test
fun matchVideo() = runBlocking {