X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Flivestream.py;h=1dcd1fb2de42894d80c494185caeb600540b02da;hb=bd3b5b8b10f4924e1fd810c0c1894e75b35a2db8;hp=5f548437cd74d879e06ac4be64adf3a6de93ddef;hpb=71791f414ca93d819b8585882ec1eeb006dbb63b;p=youtube-dl diff --git a/youtube_dl/extractor/livestream.py b/youtube_dl/extractor/livestream.py index 5f548437c..1dcd1fb2d 100644 --- a/youtube_dl/extractor/livestream.py +++ b/youtube_dl/extractor/livestream.py @@ -1,6 +1,5 @@ import re import json -import xml.etree.ElementTree from .common import InfoExtractor from ..utils import ( @@ -12,7 +11,7 @@ from ..utils import ( class LivestreamIE(InfoExtractor): IE_NAME = u'livestream' - _VALID_URL = r'http://new.livestream.com/.*?/(?P.*?)(/videos/(?P\d+))?/?$' + _VALID_URL = r'http://new\.livestream\.com/.*?/(?P.*?)(/videos/(?P\d+))?/?$' _TEST = { u'url': u'http://new.livestream.com/CoheedandCambria/WebsterHall/videos/4719370', u'file': u'4719370.mp4', @@ -80,8 +79,7 @@ class LivestreamOriginalIE(InfoExtractor): user = mobj.group('user') api_url = 'http://x{0}x.api.channel.livestream.com/2.0/clipdetails?extendedInfo=true&id={1}'.format(user, video_id) - api_response = self._download_webpage(api_url, video_id) - info = xml.etree.ElementTree.fromstring(api_response.encode('utf-8')) + info = self._download_xml(api_url, video_id) item = info.find('channel').find('item') ns = {'media': 'http://search.yahoo.com/mrss'} thumbnail_url = item.find(xpath_with_ns('media:thumbnail', ns)).attrib['url']