This commit is contained in:
O2bmm 2024-08-21 22:33:05 -04:00 committed by GitHub
commit e774321073
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2,6 +2,9 @@
from __future__ import unicode_literals from __future__ import unicode_literals
from .common import InfoExtractor from .common import InfoExtractor
from ..compat import (
compat_urllib_parse_unquote
)
from ..utils import ( from ..utils import (
parse_duration, parse_duration,
int_or_none, int_or_none,
@ -36,15 +39,15 @@ class Porn91IE(InfoExtractor):
raise ExtractorError('91 Porn says: Daily limit 10 videos exceeded', expected=True) 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'<h4 class="login_register_header"[^>]+>([^<]+)</h4>', webpage, 'title')
title = title.replace('\n', '') title = title.replace('\n', '')
video_link_url = self._search_regex( video_link_url = self._search_regex(
r'<textarea[^>]+id=["\']fm-video_link[^>]+>([^<]+)</textarea>', r'document\.write\(strencode2\("([^"]+)"\)\);',
webpage, 'video link') webpage, 'video link')
videopage = self._download_webpage(video_link_url, video_id) video_link_url = compat_urllib_parse_unquote(video_link_url)
video_link_url = self._search_regex(
info_dict = self._parse_html5_media_entries(url, videopage, video_id)[0] r"src=\'([^\']+)\'", video_link_url, 'video link')
duration = parse_duration(self._search_regex( duration = parse_duration(self._search_regex(
r'时长:\s*</span>\s*(\d+:\d+)', webpage, 'duration', fatal=False)) r'时长:\s*</span>\s*(\d+:\d+)', webpage, 'duration', fatal=False))
@ -52,12 +55,12 @@ class Porn91IE(InfoExtractor):
comment_count = int_or_none(self._search_regex( comment_count = int_or_none(self._search_regex(
r'留言:\s*</span>\s*(\d+)', webpage, 'comment count', fatal=False)) r'留言:\s*</span>\s*(\d+)', webpage, 'comment count', fatal=False))
info_dict.update({ return {
'id': video_id, 'id': video_id,
'url': video_link_url,
'ext': 'mp4',
'title': title, 'title': title,
'duration': duration, 'duration': duration,
'comment_count': comment_count, 'comment_count': comment_count,
'age_limit': self._rta_search(webpage), 'age_limit': 18
}) }
return info_dict