X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=blobdiff_plain;f=youtube_dl%2Fextractor%2Fxhamster.py;h=6b37bcbc959a8e8b83fee052da18728ca9a9c298;hb=9e1a5b845586a0a5431fb72467142046d8571e6f;hp=5374495f9b08f4d13fd7552fd612c19339b99e54;hpb=f55a1f0a8815c89b01a7a353cfa0bd5118f75829;p=youtube-dl diff --git a/youtube_dl/extractor/xhamster.py b/youtube_dl/extractor/xhamster.py index 5374495f9..6b37bcbc9 100644 --- a/youtube_dl/extractor/xhamster.py +++ b/youtube_dl/extractor/xhamster.py @@ -14,11 +14,10 @@ from ..utils import ( class XHamsterIE(InfoExtractor): """Information Extractor for xHamster""" - _VALID_URL = r'http://(?:www\.)?xhamster\.com/movies/(?P[0-9]+)/(?P.+?)\.html(?:\?.*)?' + _VALID_URL = r'http://(?:.+?\.)?xhamster\.com/movies/(?P[0-9]+)/(?P.+?)\.html(?:\?.*)?' _TESTS = [ { 'url': 'http://xhamster.com/movies/1509445/femaleagent_shy_beauty_takes_the_bait.html', - 'md5': '8281348b8d3c53d39fffb377d24eac4e', 'info_dict': { 'id': '1509445', 'ext': 'mp4', @@ -31,7 +30,6 @@ class XHamsterIE(InfoExtractor): }, { 'url': 'http://xhamster.com/movies/2221348/britney_spears_sexy_booty.html?hd', - 'md5': '4cbd8d56708ecb4fb4124c23e4acb81a', 'info_dict': { 'id': '2221348', 'ext': 'mp4', @@ -44,7 +42,7 @@ class XHamsterIE(InfoExtractor): } ] - def _real_extract(self,url): + def _real_extract(self, url): def extract_video_url(webpage): mp4 = re.search(r'', webpage) if mp4 is None: @@ -69,17 +67,17 @@ class XHamsterIE(InfoExtractor): description = mobj.group(1) if mobj else None upload_date = self._html_search_regex(r'hint=\'(\d{4}-\d{2}-\d{2}) \d{2}:\d{2}:\d{2} [A-Z]{3,4}\'', - webpage, 'upload date', fatal=False) + webpage, 'upload date', fatal=False) if upload_date: upload_date = unified_strdate(upload_date) uploader_id = self._html_search_regex(r']+>(?P[^<]+)', - webpage, 'uploader id', default='anonymous') + webpage, 'uploader id', default='anonymous') thumbnail = self._html_search_regex(r'', webpage, 'thumbnail', fatal=False) duration = parse_duration(self._html_search_regex(r'Runtime: (\d+:\d+)', - webpage, 'duration', fatal=False)) + webpage, 'duration', fatal=False)) view_count = self._html_search_regex(r'Views: ([^<]+)', webpage, 'view count', fatal=False) if view_count: