Skip to content

Commit

Permalink
fix: try fix for #433
Browse files Browse the repository at this point in the history
  • Loading branch information
Malopieds committed Dec 23, 2024
1 parent 10c09bf commit 42a003e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions innertube/src/main/java/com/malopieds/innertube/YouTube.kt
Original file line number Diff line number Diff line change
Expand Up @@ -888,23 +888,23 @@ object YouTube {
): Result<PlayerResponse> =
runCatching {
var playerResponse: PlayerResponse
if (this.cookie != null) { // if logged in: try ANDROID_MUSIC client first because IOS client does not play age restricted songs
if (this.cookie != null && false) { // if logged in: try ANDROID_MUSIC client first because IOS client does not play age restricted songs
playerResponse = innerTube.player(ANDROID_MUSIC, videoId, playlistId).body<PlayerResponse>()
if (playerResponse.playabilityStatus.status == "OK") {
println("there")
return@runCatching playerResponse
}
}
try {
val safePlayerResponse = innerTube.player(WEB_REMIX, videoId, playlistId).body<PlayerResponse>()
if (safePlayerResponse.isValid) {
return@runCatching safePlayerResponse
}
} catch (e: Exception) {
error(e)
}
playerResponse =
innerTube.player(IOS, videoId, playlistId).body<PlayerResponse>()
// try {
// val safePlayerResponse = innerTube.player(WEB_REMIX, videoId, playlistId).body<PlayerResponse>()
// if (safePlayerResponse.isValid) {
// return@runCatching safePlayerResponse
// }
// } catch (e: Exception) {
// error(e)
// }

playerResponse = innerTube.player(IOS, videoId, playlistId).body<PlayerResponse>()
if (playerResponse.playabilityStatus.status == "OK") {
return@runCatching playerResponse
}
Expand Down

0 comments on commit 42a003e

Please sign in to comment.