2 from __future__ import unicode_literals
6 from .common import InfoExtractor
17 class IzleseneIE(InfoExtractor):
19 https?://(?:(?:www|m)\.)?izlesene\.com/
20 (?:video|embedplayer)/(?:[^/]+/)?(?P<id>[0-9]+)
24 'url': 'http://www.izlesene.com/video/sevincten-cildirtan-dogum-gunu-hediyesi/7599694',
25 'md5': '4384f9f0ea65086734b881085ee05ac2',
29 'title': 'Sevinçten Çıldırtan Doğum Günü Hediyesi',
30 'description': 'md5:253753e2655dde93f59f74b572454f6d',
31 'thumbnail': 're:^http://.*\.jpg',
32 'uploader_id': 'pelikzzle',
33 'timestamp': 1404298698,
34 'upload_date': '20140702',
40 'url': 'http://www.izlesene.com/video/tarkan-dortmund-2006-konseri/17997',
41 'md5': '97f09b6872bffa284cb7fa4f6910cb72',
45 'title': 'Tarkan Dortmund 2006 Konseri',
46 'description': 'Tarkan Dortmund 2006 Konseri',
47 'thumbnail': 're:^http://.*\.jpg',
48 'uploader_id': 'parlayankiz',
49 'timestamp': 1163318593,
50 'upload_date': '20061112',
57 def _real_extract(self, url):
58 mobj = re.match(self._VALID_URL, url)
59 video_id = mobj.group('id')
60 url = 'http://www.izlesene.com/video/%s' % video_id
62 webpage = self._download_webpage(url, video_id)
64 title = self._og_search_title(webpage)
65 description = self._og_search_description(webpage)
66 thumbnail = self._og_search_thumbnail(webpage)
68 uploader = self._html_search_regex(
69 r"adduserUsername\s*=\s*'([^']+)';",
70 webpage, 'uploader', fatal=False, default='')
71 timestamp = parse_iso8601(self._html_search_meta(
72 'uploadDate', webpage, 'upload date', fatal=False))
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 family_friendly = self._html_search_meta(
84 'isFamilyFriendly', webpage, 'age limit', fatal=False)
86 content_url = self._html_search_meta(
87 'contentURL', webpage, 'content URL', fatal=False)
88 ext = determine_ext(content_url, 'mp4')
90 # Might be empty for some videos.
91 streams = self._html_search_regex(
92 r'"qualitylevel"\s*:\s*"([^"]+)"',
93 webpage, 'streams', fatal=False, default='')
97 for stream in streams.split('|'):
98 quality, url = re.search(r'\[(\w+)\](.+)', stream).groups()
100 'format_id': '%sp' % quality if quality else 'sd',
105 stream_url = self._search_regex(
106 r'"streamurl"\s?:\s?"([^"]+)"', webpage, 'stream URL')
116 'description': description,
117 'thumbnail': thumbnail,
118 'uploader_id': uploader,
119 'timestamp': timestamp,
120 'duration': duration,
121 'view_count': int_or_none(view_count),
122 'comment_count': int_or_none(comment_count),
123 'age_limit': 18 if family_friendly == 'False' else 0,