forked from j62/ctbrec
1
0
Fork 0

Fix download filename

This commit is contained in:
0xboobface 2019-06-01 17:26:33 +02:00
parent c0167155f3
commit d5f2f043e4
1 changed files with 2 additions and 2 deletions

View File

@ -438,7 +438,7 @@ public class RecordingsTab extends Tab implements TabSelectionListener {
}
private void download(Recording recording) throws IOException, ParseException, PlaylistException {
String filename = recording.getPath().replaceAll("/", "-") + ".ts";
String filename = recording.getPath().substring(1).replaceAll("/", "-") + ".ts";
FileChooser chooser = new FileChooser();
chooser.setInitialFileName(filename);
if(config.getSettings().lastDownloadDir != null && !config.getSettings().lastDownloadDir.equals("")) {
@ -452,7 +452,7 @@ public class RecordingsTab extends Tab implements TabSelectionListener {
if(target != null) {
config.getSettings().lastDownloadDir = target.getParent();
String hlsBase = "http://" + config.getSettings().httpServer + ":" + config.getSettings().httpPort + "/hls";
URL url = new URL(hlsBase + "/" + recording.getPath() + "/playlist.m3u8");
URL url = new URL(hlsBase + recording.getPath() + "/playlist.m3u8");
LOG.info("Downloading {}", recording.getPath());
Thread t = new Thread() {