]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/mofosex.py
1 from .common
import InfoExtractor
7 from .keezmovies
import KeezMoviesIE
10 class MofosexIE(KeezMoviesIE
):
11 _VALID_URL
= r
'https?://(?:www\.)?mofosex\.com/videos/(?P<id>\d+)/(?P<display_id>[^/?#&.]+)\.html'
13 'url': 'http://www.mofosex.com/videos/318131/amateur-teen-playing-and-masturbating-318131.html',
14 'md5': '558fcdafbb63a87c019218d6e49daf8a',
17 'display_id': 'amateur-teen-playing-and-masturbating-318131',
19 'title': 'amateur teen playing and masturbating',
20 'thumbnail': r
're:^https?://.*\.jpg$',
21 'upload_date': '20121114',
28 # This video is no longer available
29 'url': 'http://www.mofosex.com/videos/5018/japanese-teen-music-video.html',
30 'only_matching': True,
33 def _real_extract(self
, url
):
34 webpage
, info
= self
._extract
_info
(url
)
36 view_count
= str_to_int(self
._search
_regex
(
37 r
'VIEWS:</span>\s*([\d,.]+)', webpage
, 'view count', fatal
=False))
38 like_count
= int_or_none(self
._search
_regex
(
39 r
'id=["\']amountLikes
["\'][^>]*>(\d+)', webpage,
40 'like count', fatal=False))
41 dislike_count = int_or_none(self._search_regex(
42 r'id=["\']amountDislikes
["\'][^>]*>(\d+)', webpage,
43 'like count', fatal=False))
44 upload_date = unified_strdate(self._html_search_regex(
45 r'Added:</span>([^<]+)', webpage, 'upload date', fatal=False))
48 'view_count': view_count,
49 'like_count': like_count,
50 'dislike_count': dislike_count,
51 'upload_date': upload_date,
52 'thumbnail': self._og_search_thumbnail(webpage),
58 class MofosexEmbedIE(InfoExtractor):
59 _VALID_URL = r'https?://(?:www\.)?mofosex\.com/embed/?\?.*?\bvideoid=(?P<id>\d+)'
60 _EMBED_REGEX = [r'<iframe[^>]+\bsrc=["\'](?P
<url
>(?
:https?
:)?
//(?
:www\
.)?mofosex\
.com
/embed
/?
\?.*?
\bvideoid
=\d
+)']
62 'url
': 'https
://www
.mofosex
.com
/embed
/?videoid
=318131&referrer
=KM
',
63 'only_matching
': True,
66 def _real_extract(self, url):
67 video_id = self._match_id(url)
68 return self.url_result(
69 'http
://www
.mofosex
.com
/videos
/{0}
/{0}
.html
'.format(video_id),
70 ie=MofosexIE.ie_key(), video_id=video_id)