[common] Make mark_watched() more lenient

This commit is contained in:
dirkf 2022-11-15 19:04:07 +00:00 committed by GitHub
parent 23fe05b4f7
commit 6b65df9cad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3001,7 +3001,11 @@ class InfoExtractor(object):
if (self._downloader.params.get('mark_watched', False) if (self._downloader.params.get('mark_watched', False)
and (self._get_login_info()[0] is not None and (self._get_login_info()[0] is not None
or self._downloader.params.get('cookiefile') is not None)): or self._downloader.params.get('cookiefile') is not None)):
self._mark_watched(*args, **kwargs) # extractors apart from YoutubeIE can mark: be more lenient
try:
self._mark_watched(*args, **kwargs)
except NotImplementedError:
self.report_warning('Marking as watched is not supported')
def _mark_watched(self, *args, **kwargs): def _mark_watched(self, *args, **kwargs):
raise NotImplementedError('This method must be implemented by subclasses') raise NotImplementedError('This method must be implemented by subclasses')