3 from .common
import InfoExtractor
12 class DrTuberIE(InfoExtractor
):
13 _VALID_URL
= r
'https?://(?:(?:www|m)\.)?drtuber\.com/(?:video|embed)/(?P<id>\d+)(?:/(?P<display_id>[\w-]+))?'
14 _EMBED_REGEX
= [r
'<iframe[^>]+?src=["\'](?P
<url
>(?
:https?
:)?
//(?
:www\
.)?drtuber\
.com
/embed
/\d
+)']
16 'url
': 'http
://www
.drtuber
.com
/video
/1740434/hot
-perky
-blonde
-naked
-golf
',
17 'md5
': '93e680cf2536ad0dfb7e74d94a89facd
',
20 'display_id
': 'hot
-perky
-blonde
-naked
-golf
',
22 'title
': 'hot perky blonde naked golf
',
25 'categories
': ['Babe
', 'Blonde
', 'Erotic
', 'Outdoor
', 'Softcore
', 'Solo
'],
26 'thumbnail
': r're
:https?
://.*\
.jpg$
',
30 'url
': 'http
://www
.drtuber
.com
/embed
/489939',
31 'only_matching
': True,
33 'url
': 'http
://m
.drtuber
.com
/video
/3893529/lingerie
-blowjob
-from-beautiful
-teen
',
34 'only_matching
': True,
37 def _real_extract(self, url):
38 mobj = self._match_valid_url(url)
39 video_id = mobj.group('id')
40 display_id = mobj.group('display_id
') or video_id
42 webpage = self._download_webpage(
43 f'http
://www
.drtuber
.com
/video
/{video_id}
', display_id)
45 video_data = self._download_json(
46 'http
://www
.drtuber
.com
/player_config_json
/', video_id, query={
54 for format_id, video_url in video_data['files
'].items():
57 'format_id
': format_id,
58 'quality
': 2 if format_id == 'hq
' else 1,
62 duration = int_or_none(video_data.get('duration
')) or parse_duration(
63 video_data.get('duration_format
'))
65 title = self._html_search_regex(
66 (r'<h1
[^
>]+class=["\']title[^>]+>([^<]+)',
67 r'<title>([^<]+)\s*@\s+DrTuber',
68 r'class="title_watch
"[^>]*><(?:p|h\d+)[^>]*>([^<]+)<',
69 r'<p[^>]+class="title_substrate
">([^<]+)</p>',
70 r'<title>([^<]+) - \d+'),
73 thumbnail = self._html_search_regex(
75 webpage, 'thumbnail
', fatal=False)
77 def extract_count(id_, name, default=NO_DEFAULT):
78 return str_to_int(self._html_search_regex(
79 rf'<span
[^
>]+(?
:class|
id)="{id_}"[^
>]*>([\d
,\
.]+)</span
>',
80 webpage, f'{name} count
', default=default, fatal=False))
82 like_count = extract_count('rate_likes
', 'like
')
83 dislike_count = extract_count('rate_dislikes
', 'dislike
', default=None)
84 comment_count = extract_count('comments_count
', 'comment
')
86 cats_str = self._search_regex(
87 r'<div
[^
>]+class="categories_list">(.+?
)</div
>',
88 webpage, 'categories
', fatal=False)
89 categories = [] if not cats_str else re.findall(
90 r'<a title
="([^"]+)"', cats_str)
94 'display_id': display_id,
97 'thumbnail': thumbnail,
98 'like_count': like_count,
99 'dislike_count': dislike_count,
100 'comment_count': comment_count,
101 'categories': categories,
102 'age_limit': self._rta_search(webpage),
103 'duration': duration,