mirror of
https://github.com/ytdl-org/youtube-dl.git
synced 2024-09-08 09:35:01 +00:00
[24video] Fix extraction on python 2.6
This commit is contained in:
parent
747b028412
commit
128eb31d90
|
@ -5,6 +5,8 @@ from .common import InfoExtractor
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
parse_iso8601,
|
parse_iso8601,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
|
xpath_attr,
|
||||||
|
xpath_element,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -69,12 +71,14 @@ class TwentyFourVideoIE(InfoExtractor):
|
||||||
r'http://www.24video.net/video/xml/%s?mode=init' % video_id,
|
r'http://www.24video.net/video/xml/%s?mode=init' % video_id,
|
||||||
video_id, 'Downloading init XML')
|
video_id, 'Downloading init XML')
|
||||||
|
|
||||||
video = self._download_xml(
|
video_xml = self._download_xml(
|
||||||
'http://www.24video.net/video/xml/%s?mode=play' % video_id,
|
'http://www.24video.net/video/xml/%s?mode=play' % video_id,
|
||||||
video_id, 'Downloading video XML').find('.//video')
|
video_id, 'Downloading video XML')
|
||||||
|
|
||||||
|
video = xpath_element(video_xml, './/video', 'video', fatal=True)
|
||||||
|
|
||||||
formats = [{
|
formats = [{
|
||||||
'url': video.attrib['url'],
|
'url': xpath_attr(video, '', 'url', 'video URL', fatal=True),
|
||||||
}]
|
}]
|
||||||
|
|
||||||
like_count = int_or_none(video.get('ratingPlus'))
|
like_count = int_or_none(video.get('ratingPlus'))
|
||||||
|
|
Loading…
Reference in a new issue