]> jfr.im git - yt-dlp.git/blobdiff - yt_dlp/postprocessor/common.py
[docs] Improve embedding docs and other minor fixes
[yt-dlp.git] / yt_dlp / postprocessor / common.py
index 8420ee86417c23954639711570d28309130b4b9e..fdea3a7ea1bec9fa3cfcd2cafadcb1131db08798 100644 (file)
@@ -1,5 +1,3 @@
-from __future__ import unicode_literals
-
 import functools
 import itertools
 import json
@@ -8,10 +6,10 @@
 import urllib.error
 
 from ..utils import (
+    PostProcessingError,
     _configuration_args,
     encodeFilename,
     network_exceptions,
-    PostProcessingError,
     sanitized_Request,
     write_string,
 )
@@ -73,7 +71,7 @@ def pp_key(cls):
     def to_screen(self, text, prefix=True, *args, **kwargs):
         tag = '[%s] ' % self.PP_NAME if prefix else ''
         if self._downloader:
-            return self._downloader.to_screen('%s%s' % (tag, text), *args, **kwargs)
+            return self._downloader.to_screen(f'{tag}{text}', *args, **kwargs)
 
     def report_warning(self, text, *args, **kwargs):
         if self._downloader:
@@ -85,7 +83,8 @@ def deprecation_warning(self, text):
         write_string(f'DeprecationWarning: {text}')
 
     def report_error(self, text, *args, **kwargs):
-        # Exists only for compatibility. Do not use
+        self.deprecation_warning('"yt_dlp.postprocessor.PostProcessor.report_error" is deprecated. '
+                                 'raise "yt_dlp.utils.PostProcessingError" instead')
         if self._downloader:
             return self._downloader.report_error(text, *args, **kwargs)