2 from __future__ import unicode_literals
6 from .common import InfoExtractor
7 from ..compat import compat_urllib_parse_unquote
18 class IzleseneIE(InfoExtractor):
20 https?://(?:(?:www|m)\.)?izlesene\.com/
21 (?:video|embedplayer)/(?:[^/]+/)?(?P<id>[0-9]+)
25 'url': 'http://www.izlesene.com/video/sevincten-cildirtan-dogum-gunu-hediyesi/7599694',
26 'md5': '4384f9f0ea65086734b881085ee05ac2',
30 'title': 'Sevinçten Çıldırtan Doğum Günü Hediyesi',
31 'description': 'md5:253753e2655dde93f59f74b572454f6d',
32 'thumbnail': 're:^https?://.*\.jpg',
33 'uploader_id': 'pelikzzle',
35 'upload_date': '20140702',
41 'url': 'http://www.izlesene.com/video/tarkan-dortmund-2006-konseri/17997',
42 'md5': '97f09b6872bffa284cb7fa4f6910cb72',
46 'title': 'Tarkan Dortmund 2006 Konseri',
47 'thumbnail': 're:^https://.*\.jpg',
48 'uploader_id': 'parlayankiz',
50 'upload_date': '20061112',
57 def _real_extract(self, url):
58 video_id = self._match_id(url)
60 url = 'http://www.izlesene.com/video/%s' % video_id
61 webpage = self._download_webpage(url, video_id)
63 title = self._og_search_title(webpage)
64 description = self._og_search_description(webpage, default=None)
65 thumbnail = self._proto_relative_url(
66 self._og_search_thumbnail(webpage), scheme='http:')
68 uploader = self._html_search_regex(
69 r"adduserUsername\s*=\s*'([^']+)';",
70 webpage, 'uploader', fatal=False)
71 timestamp = parse_iso8601(self._html_search_meta(
72 'uploadDate', webpage, 'upload date'))
74 duration = float_or_none(self._html_search_regex(
75 r'"videoduration"\s*:\s*"([^"]+)"',
76 webpage, 'duration', fatal=False), scale=1000)
78 view_count = str_to_int(get_element_by_id('videoViewCount', webpage))
79 comment_count = self._html_search_regex(
80 r'comment_count\s*=\s*\'([^\']+)\';',
81 webpage, 'comment_count', fatal=False)
83 content_url = self._html_search_meta(
84 'contentURL', webpage, 'content URL', fatal=False)
85 ext = determine_ext(content_url, 'mp4')
87 # Might be empty for some videos.
88 streams = self._html_search_regex(
89 r'"qualitylevel"\s*:\s*"([^"]+)"', webpage, 'streams', default='')
93 for stream in streams.split('|'):
94 quality, url = re.search(r'\[(\w+)\](.+)', stream).groups()
96 'format_id': '%sp' % quality if quality else 'sd',
97 'url': compat_urllib_parse_unquote(url),
101 stream_url = self._search_regex(
102 r'"streamurl"\s*:\s*"([^"]+)"', webpage, 'stream URL')
105 'url': compat_urllib_parse_unquote(stream_url),
112 'description': description,
113 'thumbnail': thumbnail,
114 'uploader_id': uploader,
115 'timestamp': timestamp,
116 'duration': duration,
117 'view_count': int_or_none(view_count),
118 'comment_count': int_or_none(comment_count),
119 'age_limit': self._family_friendly_search(webpage),