X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;ds=sidebyside;f=youtube_dl%2Fextractor%2Fxhamster.py;h=8938c0e4561d2c6163158e409106dd2e928e85bf;hb=b6aa99aff8278142fed94e37e500f1cfb62defd1;hp=06fedf840d72d042dbae65afe753a414f7df010d;hpb=3e4852247744b131600ba43275ab321eb1b32bb1;p=youtube-dl diff --git a/youtube_dl/extractor/xhamster.py b/youtube_dl/extractor/xhamster.py index 06fedf840..8938c0e45 100644 --- a/youtube_dl/extractor/xhamster.py +++ b/youtube_dl/extractor/xhamster.py @@ -4,7 +4,6 @@ import re from .common import InfoExtractor from ..utils import ( - ExtractorError, unified_strdate, str_to_int, int_or_none, @@ -64,7 +63,9 @@ class XHamsterIE(InfoExtractor): mrss_url = '%s://xhamster.com/movies/%s/%s.html' % (proto, video_id, seo) webpage = self._download_webpage(mrss_url, video_id) - title = self._html_search_regex(r'(?P<title>.+?) - xHamster\.com', webpage, 'title') + title = self._html_search_regex( + [r'(?P<title>.+?)(?:, (?:[^,]+? )?Porn: xHamster| - xHamster\.com)', + r'

([^<]+)

'], webpage, 'title') # Only a few videos have an description mobj = re.search(r'Description: ([^<]+)', webpage) @@ -82,7 +83,7 @@ class XHamsterIE(InfoExtractor): thumbnail = self._search_regex( [r'''thumb\s*:\s*(?P["'])(?P.+?)(?P=q)''', r''']+poster=(?P["'])(?P.+?)(?P=q)[^>]*>'''], - webpage, 'thumbnail', fatal=False, group='thumbnail') + webpage, 'thumbnail', fatal=False, group='thumbnail') duration = parse_duration(self._html_search_regex(r'Runtime: (\d+:\d+)', webpage, 'duration', fatal=False))