Skip to content

Commit

Permalink
fix: ffmpeg not downloading all tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
rebelonion committed Apr 30, 2024
1 parent 08c3806 commit 85835b5
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ class AnimeDownloaderService : Service() {
) ?: throw Exception("Failed to create output directory")

outputDir.findFile("${task.getTaskName()}.mp4")?.delete()
val outputFile = outputDir.createFile("video/mp4", "${task.getTaskName()}.mp4")
val outputFile = outputDir.createFile("video/x-matroska", "${task.getTaskName()}.mkv")
?: throw Exception("Failed to create output file")

var percent = 0
Expand Down Expand Up @@ -256,7 +256,10 @@ class AnimeDownloaderService : Service() {

val headers = headersStringBuilder.toString()
var request = "-headers $headers "
request += "-i ${task.video.file.url} -c copy -bsf:a aac_adtstoasc -tls_verify 0 $path -v trace"
request += "-i ${task.video.file.url} -c copy -map 0:v -map 0:a -map 0:s?" +
" -f matroska -timeout 600 -reconnect 1" +
" -reconnect_streamed 1 -allowed_extensions ALL " +
"-tls_verify 0 $path -v trace"
Logger.log("Request: $request")
val ffTask =
ffExtension.executeFFMpeg(request) {
Expand Down

0 comments on commit 85835b5

Please sign in to comment.