| 
									
										
										
										
											2014-05-13 10:10:59 +02:00
										 |  |  | from __future__ import unicode_literals | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-12 03:58:07 -07:00
										 |  |  | from .common import InfoExtractor | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-13 10:10:59 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-12 03:58:07 -07:00
										 |  |  | class HentaiStigmaIE(InfoExtractor): | 
					
						
							| 
									
										
										
										
											2014-05-13 10:10:59 +02:00
										 |  |  |     _VALID_URL = r'^https?://hentai\.animestigma\.com/(?P<id>[^/]+)' | 
					
						
							| 
									
										
										
										
											2014-05-12 03:58:07 -07:00
										 |  |  |     _TEST = { | 
					
						
							| 
									
										
										
										
											2014-05-13 10:10:59 +02:00
										 |  |  |         'url': 'http://hentai.animestigma.com/inyouchuu-etsu-bonus/', | 
					
						
							|  |  |  |         'md5': '4e3d07422a68a4cc363d8f57c8bf0d23', | 
					
						
							|  |  |  |         'info_dict': { | 
					
						
							|  |  |  |             'id': 'inyouchuu-etsu-bonus', | 
					
						
							|  |  |  |             'ext': 'mp4', | 
					
						
							| 
									
										
										
										
											2016-02-14 15:37:17 +06:00
										 |  |  |             'title': 'Inyouchuu Etsu Bonus', | 
					
						
							|  |  |  |             'age_limit': 18, | 
					
						
							| 
									
										
										
										
											2014-05-12 03:58:07 -07:00
										 |  |  |         } | 
					
						
							|  |  |  |     } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def _real_extract(self, url): | 
					
						
							| 
									
										
										
										
											2015-06-29 22:21:09 +06:00
										 |  |  |         video_id = self._match_id(url) | 
					
						
							| 
									
										
										
										
											2014-05-12 03:58:07 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  |         webpage = self._download_webpage(url, video_id) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-13 10:10:59 +02:00
										 |  |  |         title = self._html_search_regex( | 
					
						
							| 
									
										
										
										
											2015-06-29 22:21:09 +06:00
										 |  |  |             r'<h2[^>]+class="posttitle"[^>]*><a[^>]*>([^<]+)</a>', | 
					
						
							| 
									
										
										
										
											2014-05-13 10:10:59 +02:00
										 |  |  |             webpage, 'title') | 
					
						
							|  |  |  |         wrap_url = self._html_search_regex( | 
					
						
							| 
									
										
										
										
											2015-06-29 22:21:09 +06:00
										 |  |  |             r'<iframe[^>]+src="([^"]+mp4)"', webpage, 'wrapper url') | 
					
						
							| 
									
										
										
										
											2014-05-12 03:58:07 -07:00
										 |  |  |         wrap_webpage = self._download_webpage(wrap_url, video_id) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-13 10:10:59 +02:00
										 |  |  |         video_url = self._html_search_regex( | 
					
						
							| 
									
										
										
										
											2015-06-29 22:21:09 +06:00
										 |  |  |             r'file\s*:\s*"([^"]+)"', wrap_webpage, 'video url') | 
					
						
							| 
									
										
										
										
											2014-05-12 03:58:07 -07:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-13 10:10:59 +02:00
										 |  |  |         return { | 
					
						
							|  |  |  |             'id': video_id, | 
					
						
							|  |  |  |             'url': video_url, | 
					
						
							|  |  |  |             'title': title, | 
					
						
							|  |  |  |             'age_limit': 18, | 
					
						
							|  |  |  |         } |