3 from .common import InfoExtractor
5 class MojvideoIE(InfoExtractor):
6 _VALID_URL = r'https?://(?:www\.)?mojvideo\.com/video-.*/(?P<id>[a-f0-9]+)'
8 'url': 'http://www.mojvideo.com/video-v-avtu-pred-mano-rdecelaska-alfi-nipic/3d1ed4497707730b2906',
9 'md5': 'f7fd662cc8ce2be107b0d4f2c0483ae7',
11 'id': '3d1ed4497707730b2906',
13 'title': 'V avtu pred mano rdečelaska - Alfi Nipič',
14 'description':'Video: V avtu pred mano rdečelaska - Alfi Nipič',
17 # TODO more properties, either as:
19 # * MD5 checksum; start the string with md5:
20 # * A regular expression; start the string with re:
21 # * Any Python type (for example int or float)
25 def _real_extract(self, url):
26 mobj = re.match(self._VALID_URL, url)
27 video_id = mobj.group('id')
29 # TODO more code goes here, for example ...
30 webpage = self._download_webpage(url, video_id)
31 title = self._html_search_regex(r'<title>(.*?)</title>', webpage, 'title')
32 description = self._search_regex(r'<meta name="description" content="(.*)" />', webpage, 'video description')
33 final_url = self._html_search_regex(r'mp4: \'(.*)\'', webpage, 'video url')
34 height=int(self._search_regex(r'<meta name="video_height" content="([0-9]*)" />',webpage,"video height"))
35 width=int(self._search_regex(r'<meta name="video_width" content="([0-9]*)" />',webpage,"video width"))
40 'description': description,
45 # TODO more properties (see youtube_dl/extractor/common.py)