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:^http://.*\.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 'description': 'Tarkan Dortmund 2006 Konseri',
48 'thumbnail': 're:^http://.*\.jpg',
49 'uploader_id': 'parlayankiz',
51 'upload_date': '20061112',
58 def _real_extract(self
, url
):
59 video_id
= self
._match
_id
(url
)
61 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
._proto
_relative
_url
(
67 self
._og
_search
_thumbnail
(webpage
), scheme
='http:')
69 uploader
= self
._html
_search
_regex
(
70 r
"adduserUsername\s*=\s*'([^']+)';",
71 webpage
, 'uploader', fatal
=False)
72 timestamp
= parse_iso8601(self
._html
_search
_meta
(
73 'uploadDate', webpage
, 'upload date'))
75 duration
= float_or_none(self
._html
_search
_regex
(
76 r
'"videoduration"\s*:\s*"([^"]+)"',
77 webpage
, 'duration', fatal
=False), scale
=1000)
79 view_count
= str_to_int(get_element_by_id('videoViewCount', webpage
))
80 comment_count
= self
._html
_search
_regex
(
81 r
'comment_count\s*=\s*\'([^
\']+)\';',
82 webpage, 'comment_count
', fatal=False)
84 content_url = self._html_search_meta(
85 'contentURL
', webpage, 'content URL
', fatal=False)
86 ext = determine_ext(content_url, 'mp4
')
88 # Might be empty for some videos.
89 streams = self._html_search_regex(
90 r'"qualitylevel"\s
*:\s
*"([^"]+)"', webpage, 'streams', default='')
94 for stream in streams.split('|'):
95 quality, url = re.search(r'\[(\w+)\](.+)', stream).groups()
97 'format_id': '%sp' % quality if quality else 'sd',
98 'url': compat_urllib_parse_unquote(url),
102 stream_url = self._search_regex(
103 r'"streamurl
"\s*:\s*"([^
"]+)"', webpage, 'stream URL
')
106 'url
': compat_urllib_parse_unquote(stream_url),
113 'description
': description,
114 'thumbnail
': thumbnail,
115 'uploader_id
': uploader,
116 'timestamp
': timestamp,
117 'duration
': duration,
118 'view_count
': int_or_none(view_count),
119 'comment_count
': int_or_none(comment_count),
120 'age_limit
': self._family_friendly_search(webpage),