Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[VideoIUA] Add new extractor for video.i.ua #12999

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions youtube_dl/extractor/extractors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,6 +1134,7 @@
from .videa import VideaIE
from .videodetective import VideoDetectiveIE
from .videofyme import VideofyMeIE
from .videoiua import VideoIUAIE
from .videomega import VideoMegaIE
from .videomore import (
VideomoreIE,
Expand Down
33 changes: 33 additions & 0 deletions youtube_dl/extractor/videoiua.py
Original file line number Diff line number Diff line change
@@ -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|channel)/((?P<user>[0-9]+)/(?P<folder>[0-9]+)|(?P<channel>[0-9]+))/(?P<id>[0-9]+)'
_TEST = {
'url': 'http://video.i.ua/channel/528/405379/',
'md5': 'c641d67f0b242f3ef8eebe683dbbce22',
'info_dict': {
'id': '405379',
'ext': 'mp4',
'title': 'Airbats 801 TTS 03 of 07',
'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
}