]>
Raphaƫl G. Git Repositories - youtubedl/blob - youtube_dl/extractor/motherless.py
6229b21732b70525b832ab2f3370594736cae8df
1 from __future__
import unicode_literals
6 from .common
import InfoExtractor
13 class MotherlessIE(InfoExtractor
):
14 _VALID_URL
= r
'http://(?:www\.)?motherless\.com/(?P<id>[A-Z0-9]+)'
17 'url': 'http://motherless.com/AC3FFE1',
18 'md5': '5527fef81d2e529215dad3c2d744a7d9',
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',
46 def _real_extract(self
,url
):
47 mobj
= re
.match(self
._VALID
_URL
, url
)
48 video_id
= mobj
.group('id')
50 webpage
= self
._download
_webpage
(url
, video_id
)
52 title
= self
._html
_search
_regex
(r
'id="view-upload-title">\s+([^<]+)<', webpage
, 'title')
54 video_url
= self
._html
_search
_regex
(r
'setup\(\{\s+"file".+: "([^"]+)",', webpage
, 'video_url')
55 age_limit
= self
._rta
_search
(webpage
)
57 view_count
= self
._html
_search
_regex
(r
'<strong>Views</strong>\s+([^<]+)<', webpage
, 'view_count')
59 upload_date
= self
._html
_search
_regex
(r
'<strong>Uploaded</strong>\s+([^<]+)<', webpage
, 'upload_date')
60 if 'Ago' in upload_date
:
61 days
= int(re
.search(r
'([0-9]+)', upload_date
).group(1))
62 upload_date
= (datetime
.datetime
.now() - datetime
.timedelta(days
=days
)).strftime('%Y%m%d')
64 upload_date
= unified_strdate(upload_date
)
66 like_count
= self
._html
_search
_regex
(r
'<strong>Favorited</strong>\s+([^<]+)<', webpage
, 'like_count')
68 comment_count
= webpage
.count('class="media-comment-contents"')
69 uploader_id
= self
._html
_search
_regex
(r
'"thumb-member-username">\s+<a href="/m/([^"]+)"', webpage
, 'uploader_id')
71 categories
= self
._html
_search
_meta
('keywords', webpage
)
73 categories
= [cat
.strip() for cat
in categories
.split(',')]
78 'upload_date': upload_date
,
79 'uploader_id': uploader_id
,
80 'thumbnail': self
._og
_search
_thumbnail
(webpage
),
81 'categories': categories
,
82 'view_count': int_or_none(view_count
.replace(',', '')),
83 'like_count': int_or_none(like_count
.replace(',', '')),
84 'comment_count': comment_count
,
85 'age_limit': age_limit
,