1
0
mirror of https://codeberg.org/polarisfm/youtube-dl synced 2024-12-24 15:27:55 +01:00

[24video] Fix extraction (Closes #7956)

This commit is contained in:
Sergey M․ 2015-12-23 20:42:36 +06:00
parent 7fe37d8a05
commit 747b028412

View File

@ -64,33 +64,22 @@ class TwentyFourVideoIE(InfoExtractor):
r'<div class="comments-title" id="comments-count">(\d+) комментари', r'<div class="comments-title" id="comments-count">(\d+) комментари',
webpage, 'comment count', fatal=False)) webpage, 'comment count', fatal=False))
formats = [] # Sets some cookies
self._download_xml(
r'http://www.24video.net/video/xml/%s?mode=init' % video_id,
video_id, 'Downloading init XML')
pc_video = self._download_xml( video = 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 PC video URL').find('.//video') video_id, 'Downloading video XML').find('.//video')
formats.append({ formats = [{
'url': pc_video.attrib['url'], 'url': video.attrib['url'],
'format_id': 'pc', }]
'quality': 1,
})
like_count = int_or_none(pc_video.get('ratingPlus')) like_count = int_or_none(video.get('ratingPlus'))
dislike_count = int_or_none(pc_video.get('ratingMinus')) dislike_count = int_or_none(video.get('ratingMinus'))
age_limit = 18 if pc_video.get('adult') == 'true' else 0 age_limit = 18 if video.get('adult') == 'true' else 0
mobile_video = self._download_xml(
'http://www.24video.net/video/xml/%s' % video_id,
video_id, 'Downloading mobile video URL').find('.//video')
formats.append({
'url': mobile_video.attrib['url'],
'format_id': 'mobile',
'quality': 0,
})
self._sort_formats(formats)
return { return {
'id': video_id, 'id': video_id,