A feature-rich command-line audio/video downloader
[gameone] Added extraction of description and fixed failing tests
Tobias Bell9e30092361c3
diff --git a/youtube_dl/extractor/gameone.py b/youtube_dl/extractor/gameone.pyindex d5fb19cec5..855df74fb7 100644--- a/youtube_dl/extractor/gameone.py+++ b/youtube_dl/extractor/gameone.py@@ -2,6 +2,7 @@from __future__ import unicode_literalsimport re+import xml.etree.ElementTree as ETfrom .common import InfoExtractorfrom ..utils import xpath_with_ns@@ -16,7 +17,7 @@ RAW_MP4_URL = 'http://cdn.riptide-mtvn.com/'class GameOneIE(InfoExtractor):_VALID_URL = r'https?://(?:www\.)?gameone\.de/tv/(?P<id>\d+)'- _TESTS = {+ _TEST = {'url': 'http://www.gameone.de/tv/288','md5': '136656b7fb4c9cb4a8e2d500651c499b','info_dict': {@@ -25,6 +26,11 @@ class GameOneIE(InfoExtractor):'title': 'Game One - Folge 288','duration': 1238,'thumbnail': 'http://s3.gameone.de/gameone/assets/video_metas/teaser_images/000/643/636/big/640x360.jpg',+ 'description': 'Puh, das ist ja wieder eine volle Packung! Erst begleiten wir Nils zum '+ 'FIFA-Pressepokal 2014, den er nach 2010 nun zum zweiten Mal gewinnen will.\n'+ 'Danach gibt’s eine Vorschau auf die drei kommenden Hits “Star Citizen”, “Kingdom Come: Deliverance” und “Project Cars”.\n'+ 'Und dann geht’s auch schon weiter mit der nächsten Folge vom Nerdquiz! Der schöne Trant foltert seine Kandidaten wieder '+ 'mit fiesen Fragen. Hier gibt’s die erste Hälfte, in Folge 289 geht’s weiter.'}}@@ -39,6 +45,7 @@ class GameOneIE(InfoExtractor):mrss = self._download_xml(mrss_url, video_id, 'Downloading mrss')title = mrss.find('.//item/title').textthumbnail = mrss.find('.//item/image').get('url')+ description = self._extract_description(mrss)content = mrss.find(xpath_with_ns('.//media:content', NAMESPACE_MAP))content_url = content.get('url')@@ -61,4 +68,9 @@ class GameOneIE(InfoExtractor):'thumbnail': thumbnail,'duration': duration,'formats': formats,+ 'description': description,}++ def _extract_description(self, mrss):+ description = mrss.find('.//item/description')+ return u''.join(t for t in description.itertext())