Skip to content

Commit

Permalink
YouTubeTest: use IOS client
Browse files Browse the repository at this point in the history
  • Loading branch information
gechoto authored Jan 5, 2025
1 parent a81c1df commit 850f16c
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import com.zionhuang.innertube.YouTube.SearchFilter.Companion.FILTER_FEATURED_PL
import com.zionhuang.innertube.YouTube.SearchFilter.Companion.FILTER_SONG
import com.zionhuang.innertube.YouTube.SearchFilter.Companion.FILTER_VIDEO
import com.zionhuang.innertube.models.WatchEndpoint
import com.zionhuang.innertube.models.YouTubeClient
import io.ktor.client.HttpClient
import io.ktor.client.engine.okhttp.OkHttp
import io.ktor.client.request.get
Expand All @@ -24,15 +25,15 @@ class YouTubeTest {
@Test
fun `Check 'player' endpoint`() = runBlocking {
VIDEO_IDS.forEach { videoId ->
val playerResponse = youTube.player(videoId).getOrThrow()
val playerResponse = youTube.player(videoId, client = YouTubeClient.IOS).getOrThrow()
assertTrue(playerResponse.playabilityStatus.status == "OK")
}
}

@Test
fun `Check playable stream`() = runBlocking {
VIDEO_IDS.forEach { videoId ->
val playerResponse = youTube.player(videoId).getOrThrow()
val playerResponse = youTube.player(videoId, client = YouTubeClient.IOS).getOrThrow()
val format = playerResponse.streamingData!!.adaptiveFormats[0]
val url = format.url!!
println(url)
Expand Down

0 comments on commit 850f16c

Please sign in to comment.