mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-11-10 09:07:58 +01:00
[xhamster] Fix view count extraction
This commit is contained in:
parent
44731e308c
commit
6a16fd4a1a
1 changed files with 3 additions and 3 deletions
|
@ -89,9 +89,9 @@ def is_hd(webpage):
|
||||||
r'(["\'])duration\1\s*:\s*(["\'])(?P<duration>.+?)\2',
|
r'(["\'])duration\1\s*:\s*(["\'])(?P<duration>.+?)\2',
|
||||||
webpage, 'duration', fatal=False, group='duration'))
|
webpage, 'duration', fatal=False, group='duration'))
|
||||||
|
|
||||||
view_count = self._html_search_regex(r'<span>Views:</span> ([^<]+)</div>', webpage, 'view count', fatal=False)
|
view_count = int_or_none(self._search_regex(
|
||||||
if view_count:
|
r'content=["\']User(?:View|Play)s:(\d+)',
|
||||||
view_count = str_to_int(view_count)
|
webpage, 'view count', fatal=False))
|
||||||
|
|
||||||
mobj = re.search(r"hint='(?P<likecount>\d+) Likes / (?P<dislikecount>\d+) Dislikes'", webpage)
|
mobj = re.search(r"hint='(?P<likecount>\d+) Likes / (?P<dislikecount>\d+) Dislikes'", webpage)
|
||||||
(like_count, dislike_count) = (mobj.group('likecount'), mobj.group('dislikecount')) if mobj else (None, None)
|
(like_count, dislike_count) = (mobj.group('likecount'), mobj.group('dislikecount')) if mobj else (None, None)
|
||||||
|
|
Loading…
Reference in a new issue