1 from __future__ import unicode_literals
6 from .common import InfoExtractor
7 from ..utils import str_to_int
10 class MotherlessIE(InfoExtractor):
11 """Information Extractor for Motherless"""
12 _VALID_URL = r'http://(?:www\.)?motherless\.com/(?P<id>[A-Z0-9]+)'
15 'url': 'http://motherless.com/AC3FFE1',
16 'md5': '5527fef81d2e529215dad3c2d744a7d9',
20 'title': 'Fucked in the ass while playing PS3',
21 'categories': ['Gaming', 'anal', 'reluctant', 'rough', 'Wife'],
22 'upload_date': '20100913',
23 'uploader_id': 'famouslyfuckedup',
24 'thumbnail': 'http://thumbs.motherlessmedia.com/thumbs/AC3FFE1.jpg',
29 'url': 'http://motherless.com/532291B',
30 'md5': 'bc59a6b47d1f958e61fbd38a4d31b131',
34 'title': 'Amazing girl playing the omegle game, PERFECT!',
35 'categories': ['Amateur', 'webcam', 'omegle', 'pink', 'young', 'masturbate', 'teen', 'game', 'hairy'],
36 'upload_date': '20140622',
37 'uploader_id': 'Sulivana7x',
38 'thumbnail': 'http://thumbs.motherlessmedia.com/thumbs/532291B.jpg',
44 def _real_extract(self,url):
45 mobj = re.match(self._VALID_URL, url)
46 video_id = mobj.group('id')
48 webpage = self._download_webpage(url, video_id)
50 title = self._html_search_regex(r'<title>(?P<title>.+?) - MOTHERLESS.COM</title>', webpage, 'title')
51 video_url = self._search_regex(r"__fileurl = '(?P<video_url>[^']+)'", webpage, 'video_url')
52 thumbnail = self._og_search_thumbnail(webpage)
53 age_limit = self._rta_search(webpage) # Hint: it's 18 ;)
54 view_count = str_to_int(self._html_search_regex(r'<strong>Views</strong>(.+?)</h2>', webpage,
55 'view_count', flags=re.DOTALL))
57 like_count = str_to_int(self._html_search_regex(r'<strong>Favorited</strong>(.+?)</h2>', webpage,
58 'like_count', flags=re.DOTALL))
59 comment_count = webpage.count('class="media-comment-contents"')
60 uploader_id = self._html_search_regex(r'<div class="thumb-member-username">.*?<a [^>]*>(.+?)</a>',
61 webpage, 'uploader_id', flags=re.DOTALL)
63 categories = self._html_search_meta('keywords', webpage)
64 if categories is not None:
65 categories = [cat.strip() for cat in categories.split(',')]
67 upload_date = self._html_search_regex(r'<strong>Uploaded</strong>(.+?)</h2>', webpage,
68 'upload_date', flags=re.DOTALL)
69 mobj = re.search(r'(\d+) days? ago', upload_date, re.I)
71 upload_date = datetime.datetime.now() - datetime.timedelta(days=int(mobj.group(1)))
73 mobj = re.search(r'(\w+) (\d+)\w* (\d+)', upload_date, re.I)
75 upload_date = datetime.datetime.strptime('%s %s %s' % mobj.groups(), '%b %d %Y').date()
78 if upload_date is not None:
79 upload_date = upload_date.strftime('%Y%m%d')
84 'upload_date': upload_date,
85 'uploader_id': uploader_id,
86 'thumbnail': thumbnail,
87 'categories': categories,
88 'view_count': view_count,
89 'like_count': like_count,
90 'comment_count': comment_count,
91 'age_limit': age_limit,