mirror of
https://github.com/spaam/svtplay-dl.git
synced 2024-11-27 13:44:14 +01:00
dash: absolute url support
This commit is contained in:
parent
5d77d4c8ca
commit
5919935d50
@ -101,6 +101,9 @@ def templateelemt(attributes, element, filename, idnumber):
|
||||
segments.append({"number": number, "duration": int(attributes.get("duration") / attributes.get("timescale"))})
|
||||
|
||||
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"))))
|
||||
for segment in segments:
|
||||
if "$Time$" in media:
|
||||
@ -112,6 +115,9 @@ def templateelemt(attributes, element, filename, idnumber):
|
||||
else:
|
||||
new = name.replace("$Number$", str(segment["number"]))
|
||||
|
||||
if new[:4] == "http":
|
||||
files.append(new)
|
||||
else:
|
||||
files.append(urljoin(filename, new))
|
||||
|
||||
return files
|
||||
|
Loading…
Reference in New Issue
Block a user