from .common import InfoExtractor
from ..utils import (
- int_or_none,
NO_DEFAULT,
+ int_or_none,
parse_duration,
str_to_int,
)
'categories': ['Babe', 'Blonde', 'Erotic', 'Outdoor', 'Softcore', 'Solo'],
'thumbnail': r're:https?://.*\.jpg$',
'age_limit': 18,
- }
+ },
}, {
'url': 'http://www.drtuber.com/embed/489939',
'only_matching': True,
display_id = mobj.group('display_id') or video_id
webpage = self._download_webpage(
- 'http://www.drtuber.com/video/%s' % video_id, display_id)
+ f'http://www.drtuber.com/video/{video_id}', display_id)
video_data = self._download_json(
'http://www.drtuber.com/player_config_json/', video_id, query={
formats.append({
'format_id': format_id,
'quality': 2 if format_id == 'hq' else 1,
- 'url': video_url
+ 'url': video_url,
})
- self._sort_formats(formats)
duration = int_or_none(video_data.get('duration')) or parse_duration(
video_data.get('duration_format'))
def extract_count(id_, name, default=NO_DEFAULT):
return str_to_int(self._html_search_regex(
- r'<span[^>]+(?:class|id)="%s"[^>]*>([\d,\.]+)</span>' % id_,
- webpage, '%s count' % name, default=default, fatal=False))
+ rf'<span[^>]+(?:class|id)="{id_}"[^>]*>([\d,\.]+)</span>',
+ webpage, f'{name} count', default=default, fatal=False))
like_count = extract_count('rate_likes', 'like')
dislike_count = extract_count('rate_dislikes', 'dislike', default=None)