aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/metacritic.py
diff options
context:
space:
mode:
authorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-12-10 21:03:53 +0100
committerJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com>2013-12-10 21:03:53 +0100
commit182583623583c8e71af9b4e24acf8c409fcff197 (patch)
treec049216db457bd6b4592862eab000afb66a4088e /youtube_dl/extractor/metacritic.py
parenta0088bdf9342408a1fc5033a0f4599bae3b9aa0b (diff)
downloadyoutube-dl-182583623583c8e71af9b4e24acf8c409fcff197.tar.xz
Use `_download_xml` in more extractors
Diffstat (limited to 'youtube_dl/extractor/metacritic.py')
-rw-r--r--youtube_dl/extractor/metacritic.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/youtube_dl/extractor/metacritic.py b/youtube_dl/extractor/metacritic.py
index 6b95b4998..e560c1d35 100644
--- a/youtube_dl/extractor/metacritic.py
+++ b/youtube_dl/extractor/metacritic.py
@@ -1,8 +1,10 @@
import re
-import xml.etree.ElementTree
import operator
from .common import InfoExtractor
+from ..utils import (
+ fix_xml_all_ampersand,
+)
class MetacriticIE(InfoExtractor):
@@ -23,9 +25,8 @@ class MetacriticIE(InfoExtractor):
video_id = mobj.group('id')
webpage = self._download_webpage(url, video_id)
# The xml is not well formatted, there are raw '&'
- info_xml = self._download_webpage('http://www.metacritic.com/video_data?video=' + video_id,
- video_id, u'Downloading info xml').replace('&', '&amp;')
- info = xml.etree.ElementTree.fromstring(info_xml.encode('utf-8'))
+ info = self._download_xml('http://www.metacritic.com/video_data?video=' + video_id,
+ video_id, u'Downloading info xml', transform_source=fix_xml_all_ampersand)
clip = next(c for c in info.findall('playList/clip') if c.find('id').text == video_id)
formats = []