aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/mtv.py
diff options
context:
space:
mode:
authorPhilipp Hagemeister <phihag@phihag.de>2014-01-20 22:11:34 +0100
committerPhilipp Hagemeister <phihag@phihag.de>2014-01-20 22:11:34 +0100
commit5aafe895fce2a7be9595cb2e56b7bd73a748e6b6 (patch)
tree092e8e5663aceb9adb7475b5b2d9c9b7ee7a84e6 /youtube_dl/extractor/mtv.py
parentb853d2e1555dbb4a09fe3d7857c6d2bc044646f4 (diff)
downloadyoutube-dl-5aafe895fce2a7be9595cb2e56b7bd73a748e6b6.tar.xz
Correct XML ampersand fixup
Diffstat (limited to 'youtube_dl/extractor/mtv.py')
-rw-r--r--youtube_dl/extractor/mtv.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/youtube_dl/extractor/mtv.py b/youtube_dl/extractor/mtv.py
index f1cf41e2d..c4fa16fb6 100644
--- a/youtube_dl/extractor/mtv.py
+++ b/youtube_dl/extractor/mtv.py
@@ -5,6 +5,7 @@ from .common import InfoExtractor
from ..utils import (
compat_urllib_parse,
ExtractorError,
+ fix_xml_ampersands,
)
def _media_xml_tag(tag):
@@ -83,12 +84,9 @@ class MTVServicesInfoExtractor(InfoExtractor):
video_id = self._id_from_uri(uri)
data = compat_urllib_parse.urlencode({'uri': uri})
- def fix_ampersand(s):
- """ Fix unencoded ampersand in XML """
- return s.replace(u'& ', '&amp; ')
idoc = self._download_xml(
self._FEED_URL + '?' + data, video_id,
- u'Downloading info', transform_source=fix_ampersand)
+ u'Downloading info', transform_source=fix_xml_ampersands)
return [self._get_video_info(item) for item in idoc.findall('.//item')]