]>
jfr.im git - yt-dlp.git/blob - youtube_dl/extractor/izlesene.py
2 from __future__
import unicode_literals
6 from .common
import InfoExtractor
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': 're:^http://.*\.jpg',
31 'uploader_id': 'pelikzzle',
32 'timestamp': 1404298698,
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 'description': 'Tarkan Dortmund 2006 Konseri',
46 'thumbnail': 're:^http://.*\.jpg',
47 'uploader_id': 'parlayankiz',
48 'timestamp': 1163318593,
49 'upload_date': '20061112',
56 def _real_extract(self
, url
):
57 mobj
= re
.match(self
._VALID
_URL
, url
)
58 video_id
= mobj
.group('id')
59 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
)
65 thumbnail
= self
._og
_search
_thumbnail
(webpage
)
67 uploader
= self
._html
_search
_regex
(
68 r
"adduserUsername\s*=\s*'([^']+)';",
69 webpage
, 'uploader', fatal
=False, default
='')
70 timestamp
= parse_iso8601(self
._html
_search
_meta
(
71 'uploadDate', webpage
, 'upload date', fatal
=False))
73 duration
= int_or_none(self
._html
_search
_regex
(
74 r
'"videoduration"\s*:\s*"([^"]+)"',
75 webpage
, 'duration', fatal
=False))
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 family_friendly = self._html_search_meta(
85 'isFamilyFriendly
', webpage, 'age limit
', fatal=False)
87 content_url = self._html_search_meta(
88 'contentURL
', webpage, 'content URL
', fatal=False)
89 ext = determine_ext(content_url, 'mp4
')
91 # Might be empty for some videos.
92 streams = self._html_search_regex(
93 r'"qualitylevel"\s
*:\s
*"([^"]+)"',
94 webpage, 'streams', fatal=False, default='')
98 for stream in streams.split('|'):
99 quality, url = re.search(r'\[(\w+)\](.+)', stream).groups()
101 'format_id': '%sp' % quality if quality else 'sd',
106 stream_url = self._search_regex(
107 r'"streamurl
"\s?:\s?"([^
"]+)"', webpage, 'stream URL
')
117 'description
': description,
118 'thumbnail
': thumbnail,
119 'uploader_id
': uploader,
120 'timestamp
': timestamp,
121 'duration
': duration,
122 'view_count
': int_or_none(view_count),
123 'comment_count
': int_or_none(comment_count),
124 'age_limit
': 18 if family_friendly == 'False' else 0,