1 from __future__ import unicode_literals
6 from .common import InfoExtractor
13 class MotherlessIE(InfoExtractor):
14 _VALID_URL = r'http://(?:www\.)?motherless\.com/(?:g/[a-z0-9_]+/)?(?P<id>[A-Z0-9]+)'
17 'url': 'http://motherless.com/AC3FFE1',
18 'md5': '310f62e325a9fafe64f68c0bccb6e75f',
22 'title': 'Fucked in the ass while playing PS3',
23 'categories': ['Gaming', 'anal', 'reluctant', 'rough', 'Wife'],
24 'upload_date': '20100913',
25 'uploader_id': 'famouslyfuckedup',
26 'thumbnail': 're:http://.*\.jpg',
31 'url': 'http://motherless.com/532291B',
32 'md5': 'bc59a6b47d1f958e61fbd38a4d31b131',
36 'title': 'Amazing girl playing the omegle game, PERFECT!',
37 'categories': ['Amateur', 'webcam', 'omegle', 'pink', 'young', 'masturbate', 'teen', 'game', 'hairy'],
38 'upload_date': '20140622',
39 'uploader_id': 'Sulivana7x',
40 'thumbnail': 're:http://.*\.jpg',
45 'url': 'http://motherless.com/g/cosplay/633979F',
46 'md5': '0b2a43f447a49c3e649c93ad1fafa4a0',
51 'categories': ['superheroine heroine superher'],
52 'upload_date': '20140827',
53 'uploader_id': 'shade0230',
54 'thumbnail': 're:http://.*\.jpg',
60 def _real_extract(self,url):
61 mobj = re.match(self._VALID_URL, url)
62 video_id = mobj.group('id')
64 webpage = self._download_webpage(url, video_id)
66 title = self._html_search_regex(r'id="view-upload-title">\s+([^<]+)<', webpage, 'title')
68 video_url = self._html_search_regex(r'setup\(\{\s+"file".+: "([^"]+)",', webpage, 'video_url')
69 age_limit = self._rta_search(webpage)
71 view_count = self._html_search_regex(r'<strong>Views</strong>\s+([^<]+)<', webpage, 'view_count')
73 upload_date = self._html_search_regex(r'<strong>Uploaded</strong>\s+([^<]+)<', webpage, 'upload_date')
74 if 'Ago' in upload_date:
75 days = int(re.search(r'([0-9]+)', upload_date).group(1))
76 upload_date = (datetime.datetime.now() - datetime.timedelta(days=days)).strftime('%Y%m%d')
78 upload_date = unified_strdate(upload_date)
80 like_count = self._html_search_regex(r'<strong>Favorited</strong>\s+([^<]+)<', webpage, 'like_count')
82 comment_count = webpage.count('class="media-comment-contents"')
83 uploader_id = self._html_search_regex(r'"thumb-member-username">\s+<a href="/m/([^"]+)"', webpage, 'uploader_id')
85 categories = self._html_search_meta('keywords', webpage)
87 categories = [cat.strip() for cat in categories.split(',')]
92 'upload_date': upload_date,
93 'uploader_id': uploader_id,
94 'thumbnail': self._og_search_thumbnail(webpage),
95 'categories': categories,
96 'view_count': int_or_none(view_count.replace(',', '')),
97 'like_count': int_or_none(like_count.replace(',', '')),
98 'comment_count': comment_count,
99 'age_limit': age_limit,