diff options
-rw-r--r-- | youtube_dl/extractor/anysex.py | 1 | ||||
-rw-r--r-- | youtube_dl/extractor/beeg.py | 4 | ||||
-rw-r--r-- | youtube_dl/extractor/eporner.py | 7 | ||||
-rw-r--r-- | youtube_dl/extractor/hornbunny.py | 30 |
4 files changed, 27 insertions, 15 deletions
diff --git a/youtube_dl/extractor/anysex.py b/youtube_dl/extractor/anysex.py index 95f23adf1..bc64423a3 100644 --- a/youtube_dl/extractor/anysex.py +++ b/youtube_dl/extractor/anysex.py @@ -44,7 +44,6 @@ class AnySexIE(InfoExtractor): duration = parse_duration(self._search_regex( r'<b>Duration:</b> (\d+:\d+)', webpage, 'duration', fatal=False)) - view_count = int_or_none(self._html_search_regex( r'<b>Views:</b> (\d+)', webpage, 'view count', fatal=False)) diff --git a/youtube_dl/extractor/beeg.py b/youtube_dl/extractor/beeg.py index 6f9f4433d..d7301fe18 100644 --- a/youtube_dl/extractor/beeg.py +++ b/youtube_dl/extractor/beeg.py @@ -42,7 +42,9 @@ class BeegIE(InfoExtractor): categories_str = self._html_search_regex( r'<meta name="keywords" content="([^"]+)"', webpage, 'categories', fatal=False) - categories = categories_str.split(',') + categories = ( + None if categories_str is None + else categories_str.split(',')) return { 'id': video_id, diff --git a/youtube_dl/extractor/eporner.py b/youtube_dl/extractor/eporner.py index 33f9ab7a9..6926fcda3 100644 --- a/youtube_dl/extractor/eporner.py +++ b/youtube_dl/extractor/eporner.py @@ -36,9 +36,10 @@ class EpornerIE(InfoExtractor): r'<script type="text/javascript" src="/config5/%s/([a-f\d]+)/">' % video_id, webpage, 'redirect_code') redirect_url = 'http://www.eporner.com/config5/%s/%s' % (video_id, redirect_code) - webpage2 = self._download_webpage(redirect_url, video_id) + player_code = self._download_webpage( + redirect_url, video_id, note='Downloading player config') video_url = self._html_search_regex( - r'file: "(.*?)",', webpage2, 'video_url') + r'file: "(.*?)",', player_code, 'video_url') duration = parse_duration(self._search_regex( r'class="mbtim">([0-9:]+)</div>', webpage, 'duration', @@ -53,5 +54,5 @@ class EpornerIE(InfoExtractor): 'title': title, 'duration': duration, 'view_count': view_count, - 'age_limit': 18, + 'age_limit': self._rta_search(webpage), } diff --git a/youtube_dl/extractor/hornbunny.py b/youtube_dl/extractor/hornbunny.py index d07105d66..7e7714438 100644 --- a/youtube_dl/extractor/hornbunny.py +++ b/youtube_dl/extractor/hornbunny.py @@ -4,7 +4,11 @@ from __future__ import unicode_literals import re from .common import InfoExtractor -from ..utils import int_or_none +from ..utils import ( + int_or_none, + parse_duration, +) + class HornBunnyIE(InfoExtractor): _VALID_URL = r'http?://(?:www\.)?hornbunny\.com/videos/(?P<title_dash>[a-z-]+)-(?P<id>\d+)\.html' @@ -24,16 +28,22 @@ class HornBunnyIE(InfoExtractor): mobj = re.match(self._VALID_URL, url) video_id = mobj.group('id') - webpage = self._download_webpage(url, video_id) - title = self._html_search_regex(r'class="title">(.*?)</h2>', webpage, 'title') - redirect_url = self._html_search_regex(r'pg&settings=(.*?)\|0"\);', webpage, 'title') + webpage = self._download_webpage( + url, video_id, note='Downloading initial webpage') + title = self._html_search_regex( + r'class="title">(.*?)</h2>', webpage, 'title') + redirect_url = self._html_search_regex( + r'pg&settings=(.*?)\|0"\);', webpage, 'title') webpage2 = self._download_webpage(redirect_url, video_id) - video_url = self._html_search_regex(r'flvMask:(.*?);', webpage2, 'video_url') + video_url = self._html_search_regex( + r'flvMask:(.*?);', webpage2, 'video_url') - mobj = re.search(r'<strong>Runtime:</strong> (?P<minutes>\d+):(?P<seconds>\d+)</div>', webpage) - duration = int(mobj.group('minutes')) * 60 + int(mobj.group('seconds')) if mobj else None - - view_count = self._html_search_regex(r'<strong>Views:</strong> (\d+)</div>', webpage, 'view count', fatal=False) + duration = parse_duration(self._search_regex( + r'<strong>Runtime:</strong>\s*([0-9:]+)</div>', + webpage, 'duration', fatal=False)) + view_count = int_or_none(self._search_regex( + r'<strong>Views:</strong>\s*(\d+)</div>', + webpage, 'view count', fatal=False)) return { 'id': video_id, @@ -41,6 +51,6 @@ class HornBunnyIE(InfoExtractor): 'title': title, 'ext': 'flv', 'duration': duration, - 'view_count': int_or_none(view_count), + 'view_count': view_count, 'age_limit': 18, } |