From f9c3864f286eba6712725b5d3c217ab259f58f46 Mon Sep 17 00:00:00 2001 From: Daniel THIRION Date: Mon, 13 Jul 2020 18:41:14 +0200 Subject: [PATCH] fix(downloader): fix .flac download (#125) Content-Type is actually application/octet-stream for FLAC and binary/octet-stream for WAV --- src/main/xerus/monstercat/downloader/Download.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/xerus/monstercat/downloader/Download.kt b/src/main/xerus/monstercat/downloader/Download.kt index 35fb750..cfa5eee 100644 --- a/src/main/xerus/monstercat/downloader/Download.kt +++ b/src/main/xerus/monstercat/downloader/Download.kt @@ -86,7 +86,7 @@ class ReleaseDownload(private val release: Release, private var tracks: Collecti val contentLength = entity.contentLength if(contentLength == 0L) throw EmptyResponseException(connection.uri.toString()) - if(!entity.contentType.value.let { it.startsWith("audio/") || it == "binary/octet-stream" }) + if(!entity.contentType.value.let { it.startsWith("audio/") || it == "binary/octet-stream" || it == "application/octet-stream" }) throw WrongResponseTypeException(connection.uri.toString(), entity.contentType.value) if(httpResponse.statusLine.statusCode != 200) throw WrongResponseCodeException(connection.uri.toString(), httpResponse.statusLine.toString())