forked from j62/ctbrec
1
0
Fork 0

Improve creation of segment URLs

This commit is contained in:
0xb00bface 2020-09-27 00:51:53 +02:00
parent 413afa1a65
commit f29ae0eb69
1 changed files with 2 additions and 3 deletions

View File

@ -112,9 +112,8 @@ public abstract class AbstractHlsDownload extends AbstractDownload {
for (TrackData trackData : tracks) {
String uri = trackData.getUri();
if (!uri.startsWith("http")) {
String tmpurl = segmentsUrl.toString();
tmpurl = tmpurl.substring(0, tmpurl.lastIndexOf('/') + 1);
uri = tmpurl + uri;
URL context = new URL(segmentsURL);
uri = new URL(context, uri).toExternalForm();
}
lsp.totalDuration += trackData.getTrackInfo().duration;
lsp.lastSegDuration = trackData.getTrackInfo().duration;