diff options
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r-- | youtube_dl/extractor/anysex.py | 3 | ||||
-rw-r--r-- | youtube_dl/extractor/beeg.py | 6 | ||||
-rw-r--r-- | youtube_dl/extractor/eporner.py | 7 | ||||
-rw-r--r-- | youtube_dl/extractor/hornbunny.py | 34 | ||||
-rw-r--r-- | youtube_dl/extractor/sunporno.py | 2 |
5 files changed, 37 insertions, 15 deletions
diff --git a/youtube_dl/extractor/anysex.py b/youtube_dl/extractor/anysex.py index adeacba01..bc64423a3 100644 --- a/youtube_dl/extractor/anysex.py +++ b/youtube_dl/extractor/anysex.py @@ -21,6 +21,7 @@ class AnySexIE(InfoExtractor): 'description': 'md5:de9e418178e2931c10b62966474e1383', 'categories': ['Erotic'], 'duration': 270, + 'age_limit': 18, } } @@ -43,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)) @@ -57,4 +57,5 @@ class AnySexIE(InfoExtractor): 'categories': categories, 'duration': duration, 'view_count': view_count, + 'age_limit': 18, } diff --git a/youtube_dl/extractor/beeg.py b/youtube_dl/extractor/beeg.py index c2692cfdc..d7301fe18 100644 --- a/youtube_dl/extractor/beeg.py +++ b/youtube_dl/extractor/beeg.py @@ -17,6 +17,7 @@ class BeegIE(InfoExtractor): 'description': 'md5:6db3c6177972822aaba18652ff59c773', 'categories': list, # NSFW 'thumbnail': 're:https?://.*\.jpg$', + 'age_limit': 18, } } @@ -41,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, @@ -50,4 +53,5 @@ class BeegIE(InfoExtractor): 'description': description, 'thumbnail': thumbnail, 'categories': categories, + 'age_limit': 18, } diff --git a/youtube_dl/extractor/eporner.py b/youtube_dl/extractor/eporner.py index 4c2c074cb..6926fcda3 100644 --- a/youtube_dl/extractor/eporner.py +++ b/youtube_dl/extractor/eporner.py @@ -21,6 +21,7 @@ class EpornerIE(InfoExtractor): 'title': 'Infamous Tiffany Teen Strip Tease Video', 'duration': 194, 'view_count': int, + 'age_limit': 18, } } @@ -35,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', @@ -52,4 +54,5 @@ class EpornerIE(InfoExtractor): 'title': title, 'duration': duration, 'view_count': view_count, + 'age_limit': self._rta_search(webpage), } diff --git a/youtube_dl/extractor/hornbunny.py b/youtube_dl/extractor/hornbunny.py index a42fba0cb..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' @@ -15,7 +19,8 @@ class HornBunnyIE(InfoExtractor): 'id': '5227', 'ext': 'flv', 'title': 'panty slut jerk off instruction', - 'duration': 550 + 'duration': 550, + 'age_limit': 18, } } @@ -23,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, @@ -40,5 +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, } diff --git a/youtube_dl/extractor/sunporno.py b/youtube_dl/extractor/sunporno.py index c7a46eb71..7de3c9dd5 100644 --- a/youtube_dl/extractor/sunporno.py +++ b/youtube_dl/extractor/sunporno.py @@ -23,6 +23,7 @@ class SunPornoIE(InfoExtractor): 'description': 'md5:a31241990e1bd3a64e72ae99afb325fb', 'thumbnail': 're:^https?://.*\.jpg$', 'duration': 302, + 'age_limit': 18, } } @@ -65,4 +66,5 @@ class SunPornoIE(InfoExtractor): 'view_count': view_count, 'comment_count': comment_count, 'formats': formats, + 'age_limit': 18, } |