aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/bilibili.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2015-10-25 20:04:55 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2015-10-25 20:13:16 +0100
commit36e6f62cd0883f0f486d1666d010e5d9e6d515bd (patch)
tree16d8824f9a82d33276350799f89a9dcb40d58b64 /youtube_dl/extractor/bilibili.py
parent755ff8d22ca5607400c1232b194e20a004e4e9eb (diff)
Use a wrapper around xml.etree.ElementTree.fromstring in python 2.x (#7178)
Attributes aren't unicode objects, so they couldn't be directly used in info_dict fields (for example '--write-description' doesn't work with bytes).
Diffstat (limited to 'youtube_dl/extractor/bilibili.py')
-rw-r--r--youtube_dl/extractor/bilibili.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/youtube_dl/extractor/bilibili.py b/youtube_dl/extractor/bilibili.py
index ecc17ebeb..6c66a1236 100644
--- a/youtube_dl/extractor/bilibili.py
+++ b/youtube_dl/extractor/bilibili.py
@@ -4,9 +4,11 @@ from __future__ import unicode_literals
import re
import itertools
import json
-import xml.etree.ElementTree as ET
from .common import InfoExtractor
+from ..compat import (
+ compat_etree_fromstring,
+)
from ..utils import (
int_or_none,
unified_strdate,
@@ -88,7 +90,7 @@ class BiliBiliIE(InfoExtractor):
except ValueError:
pass
- lq_doc = ET.fromstring(lq_page)
+ lq_doc = compat_etree_fromstring(lq_page)
lq_durls = lq_doc.findall('./durl')
hq_doc = self._download_xml(