aboutsummaryrefslogtreecommitdiff
path: root/youtube_dl/extractor
diff options
context:
space:
mode:
authorYen Chi Hsuan <yan12125@gmail.com>2015-05-31 00:26:12 +0800
committerYen Chi Hsuan <yan12125@gmail.com>2015-05-31 00:26:12 +0800
commitd05a1dbe7013d6314ec477b50d864726e509a872 (patch)
tree85d2ea4b92069e42dd05ca76ea02e4175e78bddc /youtube_dl/extractor
parenta80601f8d9789e27c0a916e63d7192c3f398d5d5 (diff)
[porn91] Catch daily limit error
Diffstat (limited to 'youtube_dl/extractor')
-rw-r--r--youtube_dl/extractor/porn91.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/youtube_dl/extractor/porn91.py b/youtube_dl/extractor/porn91.py
index ea1efc71b..c119c7e94 100644
--- a/youtube_dl/extractor/porn91.py
+++ b/youtube_dl/extractor/porn91.py
@@ -6,6 +6,7 @@ from .common import InfoExtractor
from ..utils import (
parse_duration,
int_or_none,
+ ExtractorError,
)
@@ -29,6 +30,10 @@ class Porn91IE(InfoExtractor):
url = 'http://91porn.com/view_video.php?viewkey=%s' % video_id
self._set_cookie('91porn.com', 'language', 'cn_CN')
webpage = self._download_webpage(url, video_id, "get HTML content")
+
+ if '作为游客,你每天只可观看10个视频' in webpage:
+ raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True)
+
title = self._search_regex(
r'<div id="viewvideo-title">([^<]+)</div>', webpage, 'title')
title = title.replace('\n', '')