aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl
diff options
context:
space:
mode:
authorfiocfun <fiocfun@gmail.com>2017-05-27 13:28:08 +0300
committerSergey M․ <dstftw@gmail.com>2017-05-28 07:55:07 +0700
commit78e210dea554144c8c1890c617808b0acdab9bfc (patch)
tree85e0faded0fb3f8c65c22abb75df8655856cb2bd /youtube_dl
parent855520427458f68076143c4079b038f4d15e5a13 (diff)
[xhamster] Fix author and like/dislike count extraction
Diffstat (limited to 'youtube_dl')
-rw-r--r--youtube_dl/extractor/xhamster.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/youtube_dl/extractor/xhamster.py b/youtube_dl/extractor/xhamster.py
index 7cf0629e7..ae0c167c4 100644
--- a/youtube_dl/extractor/xhamster.py
+++ b/youtube_dl/extractor/xhamster.py
@@ -108,7 +108,7 @@ class XHamsterIE(InfoExtractor):
webpage, 'upload date', fatal=False))
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')
thumbnail = self._search_regex(
@@ -124,7 +124,7 @@ class XHamsterIE(InfoExtractor):
r'content=["\']User(?:View|Play)s:(\d+)',
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)
mobj = re.search(r'</label>Comments \((?P<commentcount>\d+)\)</div>', webpage)