1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-30 15:14:14 +01:00

dash: absolute url support

This commit is contained in:
Johan Andersson 2024-04-05 22:19:26 +02:00
parent 5d77d4c8ca
commit 5919935d50

View File

@ -101,6 +101,9 @@ def templateelemt(attributes, element, filename, idnumber):
segments.append({"number": number, "duration": int(attributes.get("duration") / attributes.get("timescale"))}) segments.append({"number": number, "duration": int(attributes.get("duration") / attributes.get("timescale"))})
name = media.replace("$RepresentationID$", idnumber).replace("$Bandwidth$", attributes.get("bandwidth")) name = media.replace("$RepresentationID$", idnumber).replace("$Bandwidth$", attributes.get("bandwidth"))
if init[:4] == "http":
files.append(init.replace("$RepresentationID$", idnumber).replace("$Bandwidth$", attributes.get("bandwidth")))
else:
files.append(urljoin(filename, init.replace("$RepresentationID$", idnumber).replace("$Bandwidth$", attributes.get("bandwidth")))) files.append(urljoin(filename, init.replace("$RepresentationID$", idnumber).replace("$Bandwidth$", attributes.get("bandwidth"))))
for segment in segments: for segment in segments:
if "$Time$" in media: if "$Time$" in media:
@ -112,6 +115,9 @@ def templateelemt(attributes, element, filename, idnumber):
else: else:
new = name.replace("$Number$", str(segment["number"])) new = name.replace("$Number$", str(segment["number"]))
if new[:4] == "http":
files.append(new)
else:
files.append(urljoin(filename, new)) files.append(urljoin(filename, new))
return files return files