diff --git a/app/src/main/java/eu/kanade/tachiyomi/animesource/LocalAnimeSource.kt b/app/src/main/java/eu/kanade/tachiyomi/animesource/LocalAnimeSource.kt index 3290640ac..b4f0ef0f1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/animesource/LocalAnimeSource.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/animesource/LocalAnimeSource.kt @@ -235,7 +235,7 @@ class LocalAnimeSource( val second = duration.toInt() / 2 val coverFilename = coverPath.toFFmpegString(context) - FFmpegKit.execute("-ss $second -i \"${episodeFilename()}\" -frames 1 -q:v 2 \"$coverFilename\"") + FFmpegKit.execute("-ss $second -i \"${episodeFilename()}\" -frames 1 -q:v 2 \"$coverFilename\" -y") if (File(coverPath).exists()) { anime.thumbnail_url = coverPath diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/download/AnimeDownloader.kt b/app/src/main/java/eu/kanade/tachiyomi/data/download/AnimeDownloader.kt index a25ccfd10..03e207696 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/download/AnimeDownloader.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/download/AnimeDownloader.kt @@ -503,7 +503,7 @@ class AnimeDownloader( val videoFile = tmpDir.findFile("$filename.mp4") ?: tmpDir.createFile("$filename.mp4")!! val ffmpegFilename = { videoFile.uri.toFFmpegString(context) } - val ffmpegOptions = FFmpegKitConfig.parseArguments(headerOptions + " -i '${video.videoUrl}' -c copy \"${ffmpegFilename()}\"") + val ffmpegOptions = FFmpegKitConfig.parseArguments(headerOptions + " -i '${video.videoUrl}' -c copy \"${ffmpegFilename()}\" -y") val ffprobeCommand = { file: String, ffprobeHeaders: String? -> FFmpegKitConfig.parseArguments("${ffprobeHeaders?.plus(" ") ?: ""}-v error -show_entries format=duration -of default=noprint_wrappers=1:nokey=1 \"$file\"") } diff --git a/app/src/main/java/eu/kanade/tachiyomi/util/storage/FFmpegUtils.kt b/app/src/main/java/eu/kanade/tachiyomi/util/storage/FFmpegUtils.kt index babec1faf..1acde9075 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/util/storage/FFmpegUtils.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/util/storage/FFmpegUtils.kt @@ -11,7 +11,7 @@ fun String.toFFmpegString(context: Context): String { } fun Uri.toFFmpegString(context: Context): String { - return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) { + return if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N && this.scheme == "content") { FFmpegKitConfig.getSafParameter(context, this, "rw") } else { this.path!!