From 10710b3b469a68e0a4be76d78ebd880661e2727b Mon Sep 17 00:00:00 2001 From: Fernando Brito Date: Wed, 29 Oct 2014 09:19:09 -0300 Subject: [PATCH] Corrige o jeito que nomeia os arquivos baixados --- helpers/files.js | 12 ++++++++++++ 1 file changed, 12 insertions(+), 0 deletions(-) diff --git a/helpers/files.js b/helpers/files.js index 82f039e..f8be38b 100644 --- a/helpers/files.js +++ b/helpers/files.js @@ -46,6 +46,12 @@ function downloadAndMoveVideo(folder, req, locals, callback) { // Nome do arquivo var filename = req.body.video_url.substring(req.body.video_url.lastIndexOf('/') + 1); + + // Tira os parĂ¢metros HTTP + if (filename.lastIndexOf("?") !== -1) { + filename = filename.substring(0, filename.lastIndexOf("?")); + } + var path = folder + '/' + filename; // Salva o arquivo em disco @@ -114,6 +120,12 @@ function downloadAndMoveSubtitle(folder, req, locals, callback) { // Nome do arquivo var filename = req.body.legenda_url.substring(req.body.legenda_url.lastIndexOf('/') + 1); + + // Tira os parĂ¢metros HTTP + if (filename.lastIndexOf("?") !== -1) { + filename = filename.substring(0, filename.lastIndexOf("?")); + } + var path = folder + '/' + filename; // Salva o arquivo em disco -- libgit2 0.21.2