1
0
mirror of https://github.com/l1ving/youtube-dl synced 2020-11-18 19:53:54 -08:00

[xhamster] fix author and like count regexps

This commit is contained in:
fiocfun 2017-05-27 13:28:08 +03:00
parent 20e2c9de04
commit 036decdc88

View File

@ -104,7 +104,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(
@ -120,7 +120,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)