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

subtitle.tt: return empty string

in some cases the xml is empty
This commit is contained in:
Johan Andersson 2021-12-09 20:38:47 +01:00
parent d9209f843e
commit 14e1e6585c

View File

@ -93,6 +93,8 @@ class subtitle:
subdata = re.sub(' xmlns="[^"]+"', "", subs, count=1)
tree = ET.XML(subdata)
xml = tree.find("body").find("div")
if not xml:
return data
plist = list(xml.findall("p"))
for node in plist:
tag = norm(node.tag)