]>
jfr.im git - yt-dlp.git/blob - yt_dlp/extractor/drtuber.py
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-]+))?'
15 'url': 'http://www.drtuber.com/video/1740434/hot-perky-blonde-naked-golf',
16 'md5': '93e680cf2536ad0dfb7e74d94a89facd',
19 'display_id': 'hot-perky-blonde-naked-golf',
21 'title': 'hot perky blonde naked golf',
24 'categories': ['Babe', 'Blonde', 'Erotic', 'Outdoor', 'Softcore', 'Solo'],
25 'thumbnail': r
're:https?://.*\.jpg$',
29 'url': 'http://www.drtuber.com/embed/489939',
30 'only_matching': True,
32 'url': 'http://m.drtuber.com/video/3893529/lingerie-blowjob-from-beautiful-teen',
33 'only_matching': True,
37 def _extract_urls(webpage
):
39 r
'<iframe[^>]+?src=["\'](?P
<url
>(?
:https?
:)?
//(?
:www\
.)?drtuber\
.com
/embed
/\d
+)',
42 def _real_extract(self, url):
43 mobj = self._match_valid_url(url)
44 video_id = mobj.group('id')
45 display_id = mobj.group('display_id
') or video_id
47 webpage = self._download_webpage(
48 'http
://www
.drtuber
.com
/video
/%s' % video_id, display_id)
50 video_data = self._download_json(
51 'http
://www
.drtuber
.com
/player_config_json
/', video_id, query={
59 for format_id, video_url in video_data['files
'].items():
62 'format_id
': format_id,
63 'quality
': 2 if format_id == 'hq
' else 1,
66 self._sort_formats(formats)
68 duration = int_or_none(video_data.get('duration
')) or parse_duration(
69 video_data.get('duration_format
'))
71 title = self._html_search_regex(
72 (r'<h1
[^
>]+class=["\']title[^>]+>([^<]+)',
73 r'<title>([^<]+)\s*@\s+DrTuber',
74 r'class="title_watch
"[^>]*><(?:p|h\d+)[^>]*>([^<]+)<',
75 r'<p[^>]+class="title_substrate
">([^<]+)</p>',
76 r'<title>([^<]+) - \d+'),
79 thumbnail = self._html_search_regex(
81 webpage, 'thumbnail
', fatal=False)
83 def extract_count(id_, name, default=NO_DEFAULT):
84 return str_to_int(self._html_search_regex(
85 r'<span
[^
>]+(?
:class|
id)="%s"[^
>]*>([\d
,\
.]+)</span
>' % id_,
86 webpage, '%s count
' % name, default=default, fatal=False))
88 like_count = extract_count('rate_likes
', 'like
')
89 dislike_count = extract_count('rate_dislikes
', 'dislike
', default=None)
90 comment_count = extract_count('comments_count
', 'comment
')
92 cats_str = self._search_regex(
93 r'<div
[^
>]+class="categories_list">(.+?
)</div
>',
94 webpage, 'categories
', fatal=False)
95 categories = [] if not cats_str else re.findall(
96 r'<a title
="([^"]+)"', cats_str)
100 'display_id': display_id,
103 'thumbnail': thumbnail,
104 'like_count': like_count,
105 'dislike_count': dislike_count,
106 'comment_count': comment_count,
107 'categories': categories,
108 'age_limit': self._rta_search(webpage),
109 'duration': duration,