mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2024-12-02 19:36:45 +00:00
[porn91] Catch daily limit error
This commit is contained in:
parent
a80601f8d9
commit
d05a1dbe70
|
@ -6,6 +6,7 @@
|
||||||
from ..utils import (
|
from ..utils import (
|
||||||
parse_duration,
|
parse_duration,
|
||||||
int_or_none,
|
int_or_none,
|
||||||
|
ExtractorError,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,6 +30,10 @@ def _real_extract(self, url):
|
||||||
url = 'http://91porn.com/view_video.php?viewkey=%s' % video_id
|
url = 'http://91porn.com/view_video.php?viewkey=%s' % video_id
|
||||||
self._set_cookie('91porn.com', 'language', 'cn_CN')
|
self._set_cookie('91porn.com', 'language', 'cn_CN')
|
||||||
webpage = self._download_webpage(url, video_id, "get HTML content")
|
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(
|
title = self._search_regex(
|
||||||
r'<div id="viewvideo-title">([^<]+)</div>', webpage, 'title')
|
r'<div id="viewvideo-title">([^<]+)</div>', webpage, 'title')
|
||||||
title = title.replace('\n', '')
|
title = title.replace('\n', '')
|
||||||
|
|
Loading…
Reference in a new issue