diff --git a/src/main/java/ru/spliterash/vkVideoUnlocker/video/DownloadUrlSupplier.kt b/src/main/java/ru/spliterash/vkVideoUnlocker/video/DownloadUrlSupplier.kt index 167dc24..10ddc5f 100644 --- a/src/main/java/ru/spliterash/vkVideoUnlocker/video/DownloadUrlSupplier.kt +++ b/src/main/java/ru/spliterash/vkVideoUnlocker/video/DownloadUrlSupplier.kt @@ -9,6 +9,6 @@ class DownloadUrlSupplier( @Value("\${vk-unlocker.domain}") private val domain: String, ) { fun downloadUrl(attachmentId: String): URL { - return URL(domain + Routes.DOWNLOAD.replace("{attachmentId}", attachmentId)) + return URL(domain + Routes.DOWNLOAD.replace("{attachmentId}", attachmentId) + ".mp4") } } \ No newline at end of file diff --git a/src/main/java/ru/spliterash/vkVideoUnlocker/video/Routes.kt b/src/main/java/ru/spliterash/vkVideoUnlocker/video/Routes.kt index 9e7e38a..f683025 100644 --- a/src/main/java/ru/spliterash/vkVideoUnlocker/video/Routes.kt +++ b/src/main/java/ru/spliterash/vkVideoUnlocker/video/Routes.kt @@ -2,6 +2,6 @@ package ru.spliterash.vkVideoUnlocker.video object Routes { const val UNLOCK = "/videos/unlock/{attachmentId}" - const val DOWNLOAD = "/videos/download/{attachmentId}.mp4" + const val DOWNLOAD = "/videos/download/{attachmentId}" const val INFO = "/videos/info/{attachmentId}" } \ No newline at end of file diff --git a/src/main/java/ru/spliterash/vkVideoUnlocker/video/controller/VideoController.kt b/src/main/java/ru/spliterash/vkVideoUnlocker/video/controller/VideoController.kt index 4293f5b..7e22cbe 100644 --- a/src/main/java/ru/spliterash/vkVideoUnlocker/video/controller/VideoController.kt +++ b/src/main/java/ru/spliterash/vkVideoUnlocker/video/controller/VideoController.kt @@ -1,7 +1,6 @@ package ru.spliterash.vkVideoUnlocker.video.controller import com.github.benmanes.caffeine.cache.Caffeine -import io.micronaut.context.annotation.Value import io.micronaut.http.HttpResponse import io.micronaut.http.HttpStatus import io.micronaut.http.MediaType @@ -64,7 +63,7 @@ class VideoController( suspend fun info( @PathVariable("attachmentId") attachmentId: String, ): VideoResponse { - val accessor = cache.get(attachmentId).await() + val accessor = cache.get(attachmentId.removeSuffix(".mp4")).await() val url = downloadUrlSupplier.downloadUrl(attachmentId) return VideoResponse(