aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor/karrierevideos.py
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2016-04-14 14:06:05 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2016-04-14 14:06:05 +0800
commitf141fefab73d96a6dd2c927f56d0b86253991c02 (patch)
tree094d7b5cc636528d0ebac55acece70fdd4eab6d1 /youtube_dl/extractor/karrierevideos.py
parent8334637f4ac4a1aeddc6f05131be1c42ea6761e1 (diff)
downloadyoutube-dl-f141fefab73d96a6dd2c927f56d0b86253991c02.tar.xz
[karrierevideos] Fix extraction
The server serves malformed header "Content Type: text/xml" for the XML request (it should be Content-Type but not Content Type). Python 3.x, which uses email.feedparser rejects such headers. As a result, Content-Encoding header is not parsed, so the returned content is kept not decompressed, and thus XML parsing error.
Diffstat (limited to 'youtube_dl/extractor/karrierevideos.py')
-rw-r--r--youtube_dl/extractor/karrierevideos.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/youtube_dl/extractor/karrierevideos.py b/youtube_dl/extractor/karrierevideos.py
index 2cb04e533..c05263e61 100644
--- a/youtube_dl/extractor/karrierevideos.py
+++ b/youtube_dl/extractor/karrierevideos.py
@@ -52,9 +52,12 @@ class KarriereVideosIE(InfoExtractor):
video_id = self._search_regex(
r'/config/video/(.+?)\.xml', webpage, 'video id')
+ # Server returns malformed headers
+ # Force Accept-Encoding: * to prevent gzipped results
playlist = self._download_xml(
'http://www.karrierevideos.at/player-playlist.xml.php?p=%s' % video_id,
- video_id, transform_source=fix_xml_ampersands)
+ video_id, transform_source=fix_xml_ampersands,
+ headers={'Accept-Encoding': '*'})
NS_MAP = {
'jwplayer': 'http://developer.longtailvideo.com/trac/wiki/FlashFormats'