Relax HTML constraints on error message

Co-authored-by: dirkf <fieldhouse@gmx.net>
This commit is contained in:
Michał Połtyn 2025-03-08 22:01:54 +01:00 committed by GitHub
parent c15351641c
commit 8d2170c713
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -59,10 +59,12 @@ class EpornerIE(InfoExtractor):
video_id = self._match_id(urlh.geturl())
deleted = self._html_search_regex(r'<strong>Video has been deleted</strong>', webpage, 'deleted', default=False, fatal=False, group=0)
if deleted:
missing = self._html_search_regex((
r'<strong>\s*(Video has been deleted)\s*</strong>',
), webpage, 'missing', default=None)
if missing:
raise ExtractorError(
'Video %s has been deleted' % video_id, expected=True)
'Video %s is not available: "%s"' % (video_id, missing), expected=True)
hash = self._search_regex(
r'hash\s*[:=]\s*["\']([\da-f]{32})', webpage, 'hash')