From 1f5a962ddbd591d8d0038b2eda6cd3e0b271386c Mon Sep 17 00:00:00 2001 From: shabinder Date: Fri, 16 Apr 2021 22:44:02 +0530 Subject: [PATCH] Migrating to youtube-api-dl --- .../com/shabinder/common/di/AndroidActual.kt | 21 +------------------ 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/common/dependency-injection/src/androidMain/kotlin/com/shabinder/common/di/AndroidActual.kt b/common/dependency-injection/src/androidMain/kotlin/com/shabinder/common/di/AndroidActual.kt index 3ec239c7..8ea44d9e 100644 --- a/common/dependency-injection/src/androidMain/kotlin/com/shabinder/common/di/AndroidActual.kt +++ b/common/dependency-injection/src/androidMain/kotlin/com/shabinder/common/di/AndroidActual.kt @@ -21,9 +21,6 @@ import android.content.Intent import android.content.pm.PackageManager import android.net.Uri import androidx.core.content.ContextCompat -import com.github.kiulian.downloader.model.YoutubeVideo -import com.github.kiulian.downloader.model.formats.Format -import com.github.kiulian.downloader.model.quality.AudioQuality import com.razorpay.Checkout import com.shabinder.common.database.activityContext import com.shabinder.common.di.worker.ForegroundService @@ -110,20 +107,4 @@ actual suspend fun downloadTracks( serviceIntent.putParcelableArrayListExtra("object", ArrayList(list)) activityContext.let { ContextCompat.startForegroundService(it, serviceIntent) } } -} - -fun YoutubeVideo.getData(): Format? { - return try { - findAudioWithQuality(AudioQuality.medium)?.get(0) as Format - } catch (e: java.lang.IndexOutOfBoundsException) { - try { - findAudioWithQuality(AudioQuality.high)?.get(0) as Format - } catch (e: java.lang.IndexOutOfBoundsException) { - try { - findAudioWithQuality(AudioQuality.low)?.get(0) as Format - } catch (e: java.lang.IndexOutOfBoundsException) { - null - } - } - } -} +} \ No newline at end of file