1 from .common
import InfoExtractor
4 compat_urllib_parse_unquote
,
16 class IzleseneIE(InfoExtractor
):
18 https?://(?:(?:www|m)\.)?izlesene\.com/
19 (?:video|embedplayer)/(?:[^/]+/)?(?P<id>[0-9]+)
23 'url': 'http://www.izlesene.com/video/sevincten-cildirtan-dogum-gunu-hediyesi/7599694',
24 'md5': '4384f9f0ea65086734b881085ee05ac2',
28 'title': 'Sevinçten Çıldırtan Doğum Günü Hediyesi',
29 'description': 'md5:253753e2655dde93f59f74b572454f6d',
30 'thumbnail': r
're:^https?://.*\.jpg',
31 'uploader_id': 'pelikzzle',
33 'upload_date': '20140702',
39 'url': 'http://www.izlesene.com/video/tarkan-dortmund-2006-konseri/17997',
40 'md5': '97f09b6872bffa284cb7fa4f6910cb72',
44 'title': 'Tarkan Dortmund 2006 Konseri',
45 'thumbnail': r
're:^https://.*\.jpg',
46 'uploader_id': 'parlayankiz',
48 'upload_date': '20061112',
55 def _real_extract(self
, url
):
56 video_id
= self
._match
_id
(url
)
58 webpage
= self
._download
_webpage
('http://www.izlesene.com/video/%s' % video_id
, video_id
)
60 video
= self
._parse
_json
(
62 r
'videoObj\s*=\s*({.+?})\s*;\s*\n', webpage
, 'streams'),
65 title
= video
.get('videoTitle') or self
._og
_search
_title
(webpage
)
68 for stream
in video
['media']['level']:
69 source_url
= stream
.get('source')
70 if not source_url
or not isinstance(source_url
, compat_str
):
72 ext
= determine_ext(url
, 'mp4')
73 quality
= stream
.get('value')
74 height
= int_or_none(quality
)
76 'format_id': '%sp' % quality
if quality
else 'sd',
77 'url': compat_urllib_parse_unquote(source_url
),
81 self
._sort
_formats
(formats
)
83 description
= self
._og
_search
_description
(webpage
, default
=None)
84 thumbnail
= video
.get('posterURL') or self
._proto
_relative
_url
(
85 self
._og
_search
_thumbnail
(webpage
), scheme
='http:')
87 uploader
= self
._html
_search
_regex
(
88 r
"adduserUsername\s*=\s*'([^']+)';",
89 webpage
, 'uploader', fatal
=False)
90 timestamp
= parse_iso8601(self
._html
_search
_meta
(
91 'uploadDate', webpage
, 'upload date'))
93 duration
= float_or_none(video
.get('duration') or self
._html
_search
_regex
(
94 r
'videoduration["\']?\s
*=\s
*(["\'])(?P<value>(?:(?!\1).)+)\1',
95 webpage, 'duration', fatal=False, group='value'), scale=1000)
97 view_count = str_to_int(get_element_by_id('videoViewCount', webpage))
98 comment_count = self._html_search_regex(
99 r'comment_count\s*=\s*\'([^\']+)\';',
100 webpage, 'comment_count', fatal=False)
105 'description': description,
106 'thumbnail': thumbnail,
107 'uploader_id': uploader,
108 'timestamp': timestamp,
109 'duration': duration,
110 'view_count': int_or_none(view_count),
111 'comment_count': int_or_none(comment_count),
112 'age_limit': self._family_friendly_search(webpage),