1
0
Fork 0
mirror of https://github.com/ytdl-org/youtube-dl.git synced 2024-11-28 21:22:13 +00:00

[xhamster] Fix author and like/dislike count extraction

This commit is contained in:
fiocfun 2017-05-27 13:28:08 +03:00 committed by Sergey M․
parent 8555204274
commit 78e210dea5
No known key found for this signature in database
GPG key ID: 2C393E0F18A9236D

View file

@ -108,7 +108,7 @@ class XHamsterIE(InfoExtractor):
webpage, 'upload date', fatal=False)) webpage, 'upload date', fatal=False))
uploader = self._html_search_regex( uploader = self._html_search_regex(
r'<span[^>]+itemprop=["\']author[^>]+><a[^>]+href=["\'].+?xhamster\.com/user/[^>]+>(?P<uploader>.+?)</a>', r'<span[^>]+?itemprop=["\']author[^>]+?><a[^>]+?href=["\'][^>]+?><span[^>]+?itemprop=["\']name[^>]+?>(.+?)</span',
webpage, 'uploader', default='anonymous') webpage, 'uploader', default='anonymous')
thumbnail = self._search_regex( thumbnail = self._search_regex(
@ -124,7 +124,7 @@ class XHamsterIE(InfoExtractor):
r'content=["\']User(?:View|Play)s:(\d+)', r'content=["\']User(?:View|Play)s:(\d+)',
webpage, 'view count', fatal=False)) 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)
mobj = re.search(r'</label>Comments \((?P<commentcount>\d+)\)</div>', webpage) mobj = re.search(r'</label>Comments \((?P<commentcount>\d+)\)</div>', webpage)