forked from j62/ctbrec
1
0
Fork 0

Remove query part from segment file name

This commit is contained in:
0xb00bface 2020-12-27 13:28:13 +01:00
parent 1c8758ef52
commit e08cf998d5
1 changed files with 6 additions and 1 deletions

View File

@ -124,7 +124,12 @@ public class HlsDownload extends AbstractHlsDownload2 {
@Override @Override
protected OutputStream getSegmentOutputStream(String prefix, String fileName) throws FileNotFoundException { protected OutputStream getSegmentOutputStream(String prefix, String fileName) throws FileNotFoundException {
File file = FileSystems.getDefault().getPath(downloadDir.toAbsolutePath().toString(), prefix + '_' + fileName).toFile(); String prefixedFileName = prefix + '_' + fileName;
int questionMarkPosition = prefixedFileName.indexOf('?');
if (questionMarkPosition > 0) {
prefixedFileName = prefixedFileName.substring(0, questionMarkPosition);
}
File file = FileSystems.getDefault().getPath(downloadDir.toAbsolutePath().toString(), prefixedFileName).toFile();
return new FileOutputStream(file); return new FileOutputStream(file);
} }