2 from __future__
import unicode_literals
4 from .common
import InfoExtractor
5 from ..compat
import compat_urllib_parse_urlparse
6 from ..utils
import remove_end
9 class IwaraIE(InfoExtractor
):
10 _VALID_URL
= r
'https?://(?:www\.|ecchi\.)?iwara\.tv/videos/(?P<id>[a-zA-Z0-9]+)'
12 'url': 'http://iwara.tv/videos/amVwUl1EHpAD9RD',
13 'md5': '1d53866b2c514b23ed69e4352fdc9839',
15 'id': 'amVwUl1EHpAD9RD',
17 'title': '【MMD R-18】ガールフレンド carry_me_off',
21 'url': 'http://ecchi.iwara.tv/videos/Vb4yf2yZspkzkBO',
22 'md5': '7e5f1f359cd51a027ba4a7b7710a50f0',
24 'id': '0B1LvuHnL-sRFNXB1WHNqbGw4SXc',
26 'title': '[3D Hentai] Kyonyu Ã\x97 Genkai Ã\x97 Emaki Shinobi Girls.mp4',
29 'add_ie': ['GoogleDrive'],
31 'url': 'http://www.iwara.tv/videos/nawkaumd6ilezzgq',
32 'md5': '1d85f1e5217d2791626cff5ec83bb189',
37 'title': '[MMD] Do It Again Ver.2 [1080p 60FPS] (Motion,Camera,Wav+DL)',
38 'description': 'md5:590c12c0df1443d833fbebe05da8c47a',
39 'upload_date': '20160910',
40 'uploader': 'aMMDsork',
41 'uploader_id': 'UCVOFyOSCyFkXTYYHITtqB7A',
43 'add_ie': ['Youtube'],
46 def _real_extract(self
, url
):
47 video_id
= self
._match
_id
(url
)
49 webpage
, urlh
= self
._download
_webpage
_handle
(url
, video_id
)
51 hostname
= compat_urllib_parse_urlparse(urlh
.geturl()).hostname
52 # ecchi is 'sexy' in Japanese
53 age_limit
= 18 if hostname
.split('.')[0] == 'ecchi' else 0
55 entries
= self
._parse
_html
5_media
_entries
(url
, webpage
, video_id
)
58 iframe_url
= self
._html
_search
_regex
(
59 r
'<iframe[^>]+src=([\'"])(?P<url>[^\'"]+)\
1',
60 webpage, 'iframe URL
', group='url
')
62 '_type
': 'url_transparent
',
64 'age_limit
': age_limit,
67 title = remove_end(self._html_search_regex(
68 r'<title
>([^
<]+)</title
>', webpage, 'title
'), ' | Iwara
')
70 info_dict = entries[0]
74 'age_limit
': age_limit,