[Eporner] Check if video was deleted

This gives user a friendly error message, instead of a stacktrace
This commit is contained in:
Michał Połtyn 2025-01-30 15:20:10 +01:00 committed by GitHub
parent 5975d7bb96
commit c15351641c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -59,6 +59,11 @@ 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:
raise ExtractorError(
'Video %s has been deleted' % video_id, expected=True)
hash = self._search_regex(
r'hash\s*[:=]\s*["\']([\da-f]{32})', webpage, 'hash')