[VideoIUA] Add new extractor

This commit is contained in:
g00dy22 2017-05-06 01:05:46 +03:00
parent 1f9fefe7f5
commit e16a6150ea
2 changed files with 34 additions and 0 deletions

View File

@ -1134,6 +1134,7 @@ from .viddler import ViddlerIE
from .videa import VideaIE from .videa import VideaIE
from .videodetective import VideoDetectiveIE from .videodetective import VideoDetectiveIE
from .videofyme import VideofyMeIE from .videofyme import VideofyMeIE
from .videoiua import VideoIUAIE
from .videomega import VideoMegaIE from .videomega import VideoMegaIE
from .videomore import ( from .videomore import (
VideomoreIE, VideomoreIE,

View File

@ -0,0 +1,33 @@
# coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class VideoIUAIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?video\.i\.ua/user/(?P<user>[0-9]+)/(?P<folder>[0-9]+)/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://video.i.ua/user/3698736/77516/459718/',
'md5': '7a9b4483dece501b69ac772156d85ce6',
'info_dict': {
'id': '459718',
'ext': 'mp4',
'title': u'Красавица на качелях...',
'thumbnail': r're:^https?://.*\.jpg$'
}
}
def _real_extract(self, url):
video_id = self._match_id(url)
webpage = self._download_webpage(url, video_id)
title = self._html_search_regex(r'<div\s+class="post_title">\s*<h2>(.+?)</h2>', webpage, 'title')
self.report_extraction(video_id)
video_url = self._html_search_regex(r'<video\s*id="video"\s*src="(.+?)"', webpage, u'video URL')
thumb_url = self._html_search_regex(r"poster:\s*'(.+?)'", webpage, u'thumbnail URL')
return {
'id': video_id,
'title': title,
'url': video_url,
'ext': 'mp4',
'thumbnail': thumb_url
}