diff options
Diffstat (limited to 'yt_dlp/extractor/unsupported.py')
-rw-r--r-- | yt_dlp/extractor/unsupported.py | 60 |
1 files changed, 50 insertions, 10 deletions
diff --git a/yt_dlp/extractor/unsupported.py b/yt_dlp/extractor/unsupported.py index 87ad87ca2..e40666ec0 100644 --- a/yt_dlp/extractor/unsupported.py +++ b/yt_dlp/extractor/unsupported.py @@ -1,11 +1,32 @@ from .common import InfoExtractor -from ..utils import classproperty, ExtractorError +from ..utils import ExtractorError, classproperty, remove_start -class KnownDRMIE(InfoExtractor): +class UnsupportedInfoExtractor(InfoExtractor): IE_DESC = False - IE_NAME = 'unsupported:drm' - UNSUPPORTED_URLS = ( + URLS = () # Redefine in subclasses + + @classproperty + def IE_NAME(cls): + return remove_start(super().IE_NAME, 'Known') + + @classproperty + def _VALID_URL(cls): + return rf'https?://(?:www\.)?(?:{"|".join(cls.URLS)})' + + +LF = '\n ' + + +class KnownDRMIE(UnsupportedInfoExtractor): + """Sites that are known to use DRM for all their videos + + Add to this list only if: + * You are reasonably certain that the site uses DRM for ALL their videos + * Multiple users have asked about this site on github/reddit/discord + """ + + URLS = ( r'play\.hbomax\.com', r'channel(?:4|5)\.com', r'peacocktv\.com', @@ -82,12 +103,31 @@ class KnownDRMIE(InfoExtractor): 'only_matching': True, }] - @classproperty - def _VALID_URL(cls): - return rf'https?://(?:www\.)?(?:{"|".join(cls.UNSUPPORTED_URLS)})' + def _real_extract(self, url): + raise ExtractorError( + f'The requested site is known to use DRM protection. ' + f'It will {self._downloader._format_err("NOT", self._downloader.Styles.EMPHASIS)} be supported.{LF}' + f'Please {self._downloader._format_err("DO NOT", self._downloader.Styles.ERROR)} open an issue, ' + 'unless you have evidence that the video is not DRM protected', expected=True) + + +class KnownPiracyIE(UnsupportedInfoExtractor): + """Sites that have been deemed to be piracy + + In order for this to not end up being a catalog of piracy sites, + only sites that were once supported should be added to this list + """ + + URLS = ( + r'dood\.(?:to|watch|so|pm|wf|ru)', + ) + + _TESTS = [{ + 'url': 'http://dood.to/e/5s1wmbdacezb', + 'only_matching': True, + }] def _real_extract(self, url): raise ExtractorError( - f'The requested site is known to use DRM protection. It will {self._downloader._format_err("NOT", self._downloader.Styles.EMPHASIS)} be supported by yt-dlp. ' - f'Please {self._downloader._format_err("DO NOT", self._downloader.Styles.ERROR)} open an issue, unless you have evidence that it is not DRM protected.', - expected=True) + f'This website is no longer supported since it has been determined to be primarily used for piracy.{LF}' + f'{self._downloader._format_err("DO NOT", self._downloader.Styles.ERROR)} open issues for it', expected=True) |