aboutsummaryrefslogtreecommitdiffstats
path: root/yt_dlp/downloader
diff options
context:
space:
mode:
Diffstat (limited to 'yt_dlp/downloader')
-rw-r--r--yt_dlp/downloader/common.py4
-rw-r--r--yt_dlp/downloader/f4m.py2
-rw-r--r--yt_dlp/downloader/ism.py2
-rw-r--r--yt_dlp/downloader/mhtml.py2
-rw-r--r--yt_dlp/downloader/niconico.py2
-rw-r--r--yt_dlp/downloader/youtube_live_chat.py2
6 files changed, 4 insertions, 10 deletions
diff --git a/yt_dlp/downloader/common.py b/yt_dlp/downloader/common.py
index d79863300..1f14ebb3a 100644
--- a/yt_dlp/downloader/common.py
+++ b/yt_dlp/downloader/common.py
@@ -98,6 +98,10 @@ class FileDownloader:
def to_screen(self, *args, **kargs):
self.ydl.to_screen(*args, quiet=self.params.get('quiet'), **kargs)
+ @property
+ def FD_NAME(self):
+ return re.sub(r'(?<!^)(?=[A-Z])', '_', type(self).__name__[:-2]).lower()
+
@staticmethod
def format_seconds(seconds):
time = timetuple_from_msec(seconds * 1000)
diff --git a/yt_dlp/downloader/f4m.py b/yt_dlp/downloader/f4m.py
index 7b6665167..3629d63f5 100644
--- a/yt_dlp/downloader/f4m.py
+++ b/yt_dlp/downloader/f4m.py
@@ -256,8 +256,6 @@ class F4mFD(FragmentFD):
A downloader for f4m manifests or AdobeHDS.
"""
- FD_NAME = 'f4m'
-
def _get_unencrypted_media(self, doc):
media = doc.findall(_add_ns('media'))
if not media:
diff --git a/yt_dlp/downloader/ism.py b/yt_dlp/downloader/ism.py
index 0aaba8c15..9efc5e4d9 100644
--- a/yt_dlp/downloader/ism.py
+++ b/yt_dlp/downloader/ism.py
@@ -230,8 +230,6 @@ class IsmFD(FragmentFD):
Download segments in a ISM manifest
"""
- FD_NAME = 'ism'
-
def real_download(self, filename, info_dict):
segments = info_dict['fragments'][:1] if self.params.get(
'test', False) else info_dict['fragments']
diff --git a/yt_dlp/downloader/mhtml.py b/yt_dlp/downloader/mhtml.py
index f999fca78..ce2d39947 100644
--- a/yt_dlp/downloader/mhtml.py
+++ b/yt_dlp/downloader/mhtml.py
@@ -9,8 +9,6 @@ from ..version import __version__ as YT_DLP_VERSION
class MhtmlFD(FragmentFD):
- FD_NAME = 'mhtml'
-
_STYLESHEET = """\
html, body {
margin: 0;
diff --git a/yt_dlp/downloader/niconico.py b/yt_dlp/downloader/niconico.py
index 5947446b1..5e9dda03d 100644
--- a/yt_dlp/downloader/niconico.py
+++ b/yt_dlp/downloader/niconico.py
@@ -9,8 +9,6 @@ from ..utils import sanitized_Request
class NiconicoDmcFD(FileDownloader):
""" Downloading niconico douga from DMC with heartbeat """
- FD_NAME = 'niconico_dmc'
-
def real_download(self, filename, info_dict):
self.to_screen('[%s] Downloading from DMC' % self.FD_NAME)
diff --git a/yt_dlp/downloader/youtube_live_chat.py b/yt_dlp/downloader/youtube_live_chat.py
index 448660725..cc528029d 100644
--- a/yt_dlp/downloader/youtube_live_chat.py
+++ b/yt_dlp/downloader/youtube_live_chat.py
@@ -10,8 +10,6 @@ from ..utils import RegexNotFoundError, dict_get, int_or_none, try_get
class YoutubeLiveChatFD(FragmentFD):
""" Downloads YouTube live chats fragment by fragment """
- FD_NAME = 'youtube_live_chat'
-
def real_download(self, filename, info_dict):
video_id = info_dict['video_id']
self.to_screen('[%s] Downloading live chat' % self.FD_NAME)