Repository: yt-dlp/yt-dlp
File: yt_dlp/YoutubeDL.py (Python)

Code before:

        # The code is left like this to be reused for future deprecations
        MIN_SUPPORTED, MIN_RECOMMENDED = (3, 7), (3, 7)
        current_version = sys.version_info[:2]
        if current_version < MIN_RECOMMENDED:
            msg = ('Support for Python version %d.%d has been deprecated. '
                   'See  https://github.com/yt-dlp/yt-dlp/issues/3764  for more details.'
                   '\n                    You will no longer receive updates on this version')
            if current_version < MIN_SUPPORTED:
                msg = 'Python version %d.%d is no longer supported'
            self.deprecation_warning(
                f'{msg}! Please update to Python %d.%d or above' % (*current_version, *MIN_RECOMMENDED))

        if self.params.get('allow_unplayable_formats'):
            self.report_warning(
                f'You have asked for {self._format_err("UNPLAYABLE", self.Styles.EMPHASIS)} formats to be listed/downloaded. '
                'This is a developer option intended for debugging. \n'
                '         If you experience any issues while using this option, '
                f'{self._format_err("DO NOT", self.Styles.ERROR)} open a bug report')

        if self.params.get('enable_file_urls'):
            self.report_warning(
                f'You have enabled support for file:// URLs. '
                'These are disabled by default in yt-dlp for security reasons. '
                f'{self._format_err("Use at your own risk.", self.Styles.ERROR)}')

        if self.params.get('bidi_workaround', False):
            try:
                import pty
                master, slave = pty.openpty()
                width = shutil.get_terminal_size().columns
                width_args = [] if width is None else ['-w', str(width)]
                sp_kwargs = {'stdin': subprocess.PIPE, 'stdout': slave, 'stderr': self._out_files.error}
                try:
                    self._output_process = Popen(['bidiv'] + width_args, **sp_kwargs)
                except OSError:
                    self._output_process = Popen(['fribidi', '-c', 'UTF-8'] + width_args, **sp_kwargs)
                self._output_channel = os.fdopen(master, 'rb')
            except OSError as ose:
                if ose.errno == errno.ENOENT:
                    self.report_warning(
                        'Could not find fribidi executable, ignoring --bidi-workaround. '
                        'Make sure that  fribidi  is an executable file in one of the directories in your $PATH.')
                else:
                    raise

        self.params['compat_opts'] = set(self.params.get('compat_opts', ()))
        if auto_init and auto_init != 'no_verbose_header':
            self.print_debug_header()

        def check_deprecated(param, option, suggestion):

Review comment (security):
This isnt needed imo. The security risk is because servers may allow users to pass arbitrary URLs to yt-dlp. If the server allows arbitrary options, there are other options (like `--exec`) which are far more concerning

Code after:

        # The code is left like this to be reused for future deprecations
        MIN_SUPPORTED, MIN_RECOMMENDED = (3, 7), (3, 7)
        current_version = sys.version_info[:2]
        if current_version < MIN_RECOMMENDED:
            msg = ('Support for Python version %d.%d has been deprecated. '
                   'See  https://github.com/yt-dlp/yt-dlp/issues/3764  for more details.'
                   '\n                    You will no longer receive updates on this version')
            if current_version < MIN_SUPPORTED:
                msg = 'Python version %d.%d is no longer supported'
            self.deprecation_warning(
                f'{msg}! Please update to Python %d.%d or above' % (*current_version, *MIN_RECOMMENDED))

        if self.params.get('allow_unplayable_formats'):
            self.report_warning(
                f'You have asked for {self._format_err("UNPLAYABLE", self.Styles.EMPHASIS)} formats to be listed/downloaded. '
                'This is a developer option intended for debugging. \n'
                '         If you experience any issues while using this option, '
                f'{self._format_err("DO NOT", self.Styles.ERROR)} open a bug report')

        if self.params.get('bidi_workaround', False):
            try:
                import pty
                master, slave = pty.openpty()
                width = shutil.get_terminal_size().columns
                width_args = [] if width is None else ['-w', str(width)]
                sp_kwargs = {'stdin': subprocess.PIPE, 'stdout': slave, 'stderr': self._out_files.error}
                try:
                    self._output_process = Popen(['bidiv'] + width_args, **sp_kwargs)
                except OSError:
                    self._output_process = Popen(['fribidi', '-c', 'UTF-8'] + width_args, **sp_kwargs)
                self._output_channel = os.fdopen(master, 'rb')
            except OSError as ose:
                if ose.errno == errno.ENOENT:
                    self.report_warning(
                        'Could not find fribidi executable, ignoring --bidi-workaround. '
                        'Make sure that  fribidi  is an executable file in one of the directories in your $PATH.')
                else:
                    raise

        self.params['compat_opts'] = set(self.params.get('compat_opts', ()))
        if auto_init and auto_init != 'no_verbose_header':
            self.print_debug_header()

        def check_deprecated(param, option, suggestion):
            if self.params.get(param) is not None:
                self.report_warning(f'{option} is deprecated. Use {suggestion} instead')
                return True
            return False

        if check_deprecated('cn_verification_proxy', '--cn-verification-proxy', '--geo-verification-proxy'):