1
0
mirror of https://github.com/spaam/svtplay-dl.git synced 2024-11-27 21:54:17 +01:00

hds: some cases we need to encode the playlist as str for py2

This commit is contained in:
Johan Andersson 2016-08-17 00:43:24 +02:00
parent 1775793387
commit cd4506be8e

View File

@ -47,7 +47,11 @@ def hdsparse(options, res, manifest):
if res.status_code == 403 or res.status_code == 404:
streams[0] = ServiceError("Can't read HDS playlist.")
return streams
xml = ET.XML(res.text)
data = res.text
if is_py2 and isinstance(data, unicode):
data = data.encode("utf-8")
xml = ET.XML(data)
if is_py2_old:
bootstrapIter = xml.getiterator("{http://ns.adobe.com/f4m/1.0}bootstrapInfo")