projects
/
youtube-dl
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Use the new '_download_xml' helper in more extractors
[youtube-dl]
/
youtube_dl
/
extractor
/
comedycentral.py
diff --git
a/youtube_dl/extractor/comedycentral.py
b/youtube_dl/extractor/comedycentral.py
index 725849d2e98c89c2548778e6c37f73ce395d1c4a..23647f99eec075af82c9b099d52323c38814bf4c 100644
(file)
--- a/
youtube_dl/extractor/comedycentral.py
+++ b/
youtube_dl/extractor/comedycentral.py
@@
-1,5
+1,4
@@
import re
import re
-import xml.etree.ElementTree
from .common import InfoExtractor
from .mtv import MTVIE, _media_xml_tag
from .common import InfoExtractor
from .mtv import MTVIE, _media_xml_tag
@@
-158,13
+157,12
@@
class ComedyCentralShowsIE(InfoExtractor):
uri = mMovieParams[0][1]
indexUrl = 'http://shadow.comedycentral.com/feeds/video_player/mrss/?' + compat_urllib_parse.urlencode({'uri': uri})
uri = mMovieParams[0][1]
indexUrl = 'http://shadow.comedycentral.com/feeds/video_player/mrss/?' + compat_urllib_parse.urlencode({'uri': uri})
- i
ndexXml = self._download_webpage
(indexUrl, epTitle,
+ i
doc = self._download_xml
(indexUrl, epTitle,
u'Downloading show index',
u'unable to download episode index')
results = []
u'Downloading show index',
u'unable to download episode index')
results = []
- idoc = xml.etree.ElementTree.fromstring(indexXml)
itemEls = idoc.findall('.//item')
for partNum,itemEl in enumerate(itemEls):
mediaId = itemEl.findall('./guid')[0].text
itemEls = idoc.findall('.//item')
for partNum,itemEl in enumerate(itemEls):
mediaId = itemEl.findall('./guid')[0].text
@@
-175,10
+173,9
@@
class ComedyCentralShowsIE(InfoExtractor):
configUrl = ('http://www.comedycentral.com/global/feeds/entertainment/media/mediaGenEntertainment.jhtml?' +
compat_urllib_parse.urlencode({'uri': mediaId}))
configUrl = ('http://www.comedycentral.com/global/feeds/entertainment/media/mediaGenEntertainment.jhtml?' +
compat_urllib_parse.urlencode({'uri': mediaId}))
- c
onfigXml = self._download_webpage
(configUrl, epTitle,
+ c
doc = self._download_xml
(configUrl, epTitle,
u'Downloading configuration for %s' % shortMediaId)
u'Downloading configuration for %s' % shortMediaId)
- cdoc = xml.etree.ElementTree.fromstring(configXml)
turls = []
for rendition in cdoc.findall('.//rendition'):
finfo = (rendition.attrib['bitrate'], rendition.findall('./src')[0].text)
turls = []
for rendition in cdoc.findall('.//rendition'):
finfo = (rendition.attrib['bitrate'], rendition.findall('./src')[0].text)