diff --git a/src/scripts/services/aria2TaskService.js b/src/scripts/services/aria2TaskService.js index 27de3be..5ca1030 100644 --- a/src/scripts/services/aria2TaskService.js +++ b/src/scripts/services/aria2TaskService.js @@ -20,7 +20,14 @@ return path; } - return path.substring(index + 1); + var fileNameAndQueryString = path.substring(index + 1); + var queryStringStartPos = fileNameAndQueryString.indexOf('?'); + + if (queryStringStartPos <= 0) { + return fileNameAndQueryString; + } + + return fileNameAndQueryString.substring(0, queryStringStartPos); }; var calculateDownloadRemainTime = function (remainBytes, downloadSpeed) {