3 from .common
import InfoExtractor
14 class IzleseneIE(InfoExtractor
):
16 https?://(?:(?:www|m)\.)?izlesene\.com/
17 (?:video|embedplayer)/(?:[^/]+/)?(?P<id>[0-9]+)
21 'url': 'http://www.izlesene.com/video/sevincten-cildirtan-dogum-gunu-hediyesi/7599694',
22 'md5': '4384f9f0ea65086734b881085ee05ac2',
26 'title': 'Sevinçten Çıldırtan Doğum Günü Hediyesi',
27 'description': 'md5:253753e2655dde93f59f74b572454f6d',
28 'thumbnail': r
're:^https?://.*\.jpg',
29 'uploader_id': 'pelikzzle',
31 'upload_date': '20140702',
37 'url': 'http://www.izlesene.com/video/tarkan-dortmund-2006-konseri/17997',
38 'md5': '97f09b6872bffa284cb7fa4f6910cb72',
42 'title': 'Tarkan Dortmund 2006 Konseri',
43 'thumbnail': r
're:^https://.*\.jpg',
44 'uploader_id': 'parlayankiz',
46 'upload_date': '20061112',
53 def _real_extract(self
, url
):
54 video_id
= self
._match
_id
(url
)
56 webpage
= self
._download
_webpage
(f
'http://www.izlesene.com/video/{video_id}', video_id
)
58 video
= self
._parse
_json
(
60 r
'videoObj\s*=\s*({.+?})\s*;\s*\n', webpage
, 'streams'),
63 title
= video
.get('videoTitle') or self
._og
_search
_title
(webpage
)
66 for stream
in video
['media']['level']:
67 source_url
= stream
.get('source')
68 if not source_url
or not isinstance(source_url
, str):
70 ext
= determine_ext(url
, 'mp4')
71 quality
= stream
.get('value')
72 height
= int_or_none(quality
)
74 'format_id': f
'{quality}p' if quality
else 'sd',
75 'url': urllib
.parse
.unquote(source_url
),
80 description
= self
._og
_search
_description
(webpage
, default
=None)
81 thumbnail
= video
.get('posterURL') or self
._proto
_relative
_url
(
82 self
._og
_search
_thumbnail
(webpage
), scheme
='http:')
84 uploader
= self
._html
_search
_regex
(
85 r
"adduserUsername\s*=\s*'([^']+)';",
86 webpage
, 'uploader', fatal
=False)
87 timestamp
= parse_iso8601(self
._html
_search
_meta
(
88 'uploadDate', webpage
, 'upload date'))
90 duration
= float_or_none(video
.get('duration') or self
._html
_search
_regex
(
91 r
'videoduration["\']?\s
*=\s
*(["\'])(?P<value>(?:(?!\1).)+)\1',
92 webpage, 'duration', fatal=False, group='value'), scale=1000)
94 view_count = str_to_int(get_element_by_id('videoViewCount', webpage))
95 comment_count = self._html_search_regex(
96 r'comment_count\s*=\s*\'([^\']+)\';',
97 webpage, 'comment_count', fatal=False)
102 'description': description,
103 'thumbnail': thumbnail,
104 'uploader_id': uploader,
105 'timestamp': timestamp,
106 'duration': duration,
107 'view_count': int_or_none(view_count),
108 'comment_count': int_or_none(comment_count),
109 'age_limit': self._family_friendly_search(webpage),