Browse Source

[xhamster] Fix author and like/dislike count extraction

master-ytdl-org
fiocfun 8 years ago
committed by Sergey M․
parent
commit
78e210dea5
No known key found for this signature in database GPG Key ID: 2C393E0F18A9236D
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      youtube_dl/extractor/xhamster.py

+ 2
- 2
youtube_dl/extractor/xhamster.py View File

@ -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)


Loading…
Cancel
Save