Don't check for height as it's not provided
[youtube-dl] / youtube_dl / extractor / videofun.py
1 from __future__ import unicode_literals
2
3 from .common import InfoExtractor
4 from ..utils import (
5     compat_urllib_parse
6 )
7
8
9 class VideoFunIE(InfoExtractor):
10     _VALID_URL = r'http://[w.]*videofun\.me/embed/(?P<id>[0-9a-f]+)'
11
12     _TEST = {
13         'url': 'http://videofun.me/embed/8267659be070860af600fee7deadbcdb?w=600&h=438',
14         'md5': 'e37e99d665f503dd2db952f7c4dba9e6',
15         'info_dict': {
16             'id': 'Mahou-Shoujo-Madoka-Magica-07',
17             'ext': 'flv',
18             'title': 'Mahou-Shoujo-Madoka-Magica-07',
19         }
20     }
21
22     def _real_extract(self, url):
23         video_id = self._match_id(url)
24         webpage = self._download_webpage(
25             url, video_id, 'Downloading video page')
26
27         video_url_encoded = self._html_search_regex(
28             r'url: "(http://gateway\.videofun\.me[^"]+)"', webpage, 'video url')
29         video_url = compat_urllib_parse.unquote(video_url_encoded)
30         title = self._html_search_regex(r'.*/([^.]*)\.', video_url, 'title')
31
32         return {
33             'id': title,
34             'url': video_url,
35             'title': title,
36         }