aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/extractor/unsupported.py
diff options
context:
space:
mode:
authorpukkandan <pukkandan.ytdlp@gmail.com>2022-11-09 15:48:25 +0530
committerpukkandan <pukkandan.ytdlp@gmail.com>2022-11-09 22:19:46 +0530
commited6bec168dd6af955f4ec0165356ac76b944c537 (patch)
treee88ae8996e2b5915903214f818a2a80e006c3703 /yt_dlp/extractor/unsupported.py
parent0d8affc17faa540f41cb6fba7675dbf98364250b (diff)
downloadhypervideo-pre-ed6bec168dd6af955f4ec0165356ac76b944c537.tar.lz
hypervideo-pre-ed6bec168dd6af955f4ec0165356ac76b944c537.tar.xz
hypervideo-pre-ed6bec168dd6af955f4ec0165356ac76b944c537.zip
[extractor/doodstream] Remove extractor
It was added in youtube-dlc, likely without sufficient scrutiny Closes #3808, Closes #5251, Closes #5403
Diffstat (limited to 'yt_dlp/extractor/unsupported.py')
-rw-r--r--yt_dlp/extractor/unsupported.py60
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)