diff --git a/youtube/src/main/java/com/tiefensuche/soundcrowd/plugins/youtube/Plugin.kt b/youtube/src/main/java/com/tiefensuche/soundcrowd/plugins/youtube/Plugin.kt index 625c87e..fc69a19 100644 --- a/youtube/src/main/java/com/tiefensuche/soundcrowd/plugins/youtube/Plugin.kt +++ b/youtube/src/main/java/com/tiefensuche/soundcrowd/plugins/youtube/Plugin.kt @@ -117,12 +117,7 @@ class Plugin(appContext: Context, context: Context) : IPlugin { private fun getAudioStream(url: String): String { val extractor = YouTube.getStreamExtractor(url) extractor.fetchPage() - for (stream in extractor.audioStreams) { - if (stream.format!!.getName() == "m4a") { - return stream.content.replace("signature", "sig") - } - } - throw IllegalStateException("no audio stream") + return extractor.audioStreams.maxBy { it.averageBitrate }.content } override fun getIcon(): Bitmap = icon