Try fix #385
This commit is contained in:
@@ -7,3 +7,5 @@ class PlayableFormatNotFoundException : PlaybackException(null, null, ERROR_CODE
|
||||
class UnplayableException : PlaybackException(null, null, ERROR_CODE_REMOTE_ERROR)
|
||||
|
||||
class LoginRequiredException : PlaybackException(null, null, ERROR_CODE_REMOTE_ERROR)
|
||||
|
||||
class VideoIdMismatchException : PlaybackException(null, null, ERROR_CODE_REMOTE_ERROR)
|
||||
|
||||
@@ -650,6 +650,10 @@ class PlayerService : InvincibleService(), Player.Listener, PlaybackStatsListene
|
||||
val urlResult = runBlocking(Dispatchers.IO) {
|
||||
Innertube.player(PlayerBody(videoId = videoId))
|
||||
}?.mapCatching { body ->
|
||||
if (body.videoDetails?.videoId != videoId) {
|
||||
throw VideoIdMismatchException()
|
||||
}
|
||||
|
||||
when (val status = body.playabilityStatus?.status) {
|
||||
"OK" -> body.streamingData?.adaptiveFormats?.findLast { format ->
|
||||
format.itag == 251 || format.itag == 140
|
||||
|
||||
Reference in New Issue
Block a user