'Create a FileDownloader object with the given options.'

def __init__(self, params=None, auto_init=True):

    if (params is None):
        params = {}
    self._ies = []
    self._ies_instances = {}
    self._pps = []
    self._progress_hooks = []
    self._download_retcode = 0
    self._num_downloads = 0
    self._screen_file = [sys.stdout, sys.stderr][params.get(u'logtostderr', False)]
    self._err_file = sys.stderr
    self.params = {u'nocheckcertificate': False}
    self.params.update(params)
    self.cache = Cache(self)
    def check_deprecated(param, option, suggestion):
        if (self.params.get(param) is not None):
            self.report_warning((u'%s    is    deprecated.    Use    %s    instead.' % (option, suggestion)))
            return True
        return False
    if check_deprecated(u'cn_verification_proxy', u'--cn-verification-proxy', u'--geo-verification-proxy'):
        if (self.params.get(u'geo_verification_proxy') is None):
            self.params[u'geo_verification_proxy'] = self.params[u'cn_verification_proxy']
    check_deprecated(u'autonumber_size', u'--autonumber-size', u'output    template    with    %(autonumber)0Nd,    where    N    in    the    number    of    digits')
    check_deprecated(u'autonumber', u'--auto-number', u'-o    "%(autonumber)s-%(title)s.%(ext)s"')
    check_deprecated(u'usetitle', u'--title', u'-o    "%(title)s-%(id)s.%(ext)s"')
    if params.get(u'bidi_workaround', False):
        try:
            import pty
            (master, slave) = pty.openpty()
            width = compat_get_terminal_size().columns
            if (width is None):
                width_args = []
            else:
                width_args = [u'-w', str(width)]
            sp_kwargs = dict(stdin=subprocess.PIPE, stdout=slave, stderr=self._err_file)
            try:
                self._output_process = subprocess.Popen(([u'bidiv'] + width_args), **sp_kwargs)
            except OSError:
                self._output_process = subprocess.Popen(([u'fribidi', u'-c', u'UTF-8'] + width_args), **sp_kwargs)
            self._output_channel = os.fdopen(master, u'rb')
        except OSError as ose:
            if (ose.errno == errno.ENOENT):
                self.report_warning(u'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
    if ((sys.platform != u'win32') and (sys.getfilesystemencoding() in [u'ascii', u'ANSI_X3.4-1968']) and (not params.get(u'restrictfilenames', False))):
        self.report_warning(u'Assuming    --restrict-filenames    since    file    system    encoding    cannot    encode    all    characters.    Set    the    LC_ALL    environment    variable    to    fix    this.')
        self.params[u'restrictfilenames'] = True
    if isinstance(params.get(u'outtmpl'), bytes):
        self.report_warning(u'Parameter    outtmpl    is    bytes,    but    should    be    a    unicode    string.    Put        from    __future__    import    unicode_literals        at    the    top    of    your    code    file    or    consider    switching    to    Python    3.x.')
    self._setup_opener()
    if auto_init:
        self.print_debug_header()
        self.add_default_info_extractors()
    for pp_def_raw in self.params.get(u'postprocessors', []):
        pp_class = get_postprocessor(pp_def_raw[u'key'])
        pp_def = dict(pp_def_raw)
        del pp_def[u'key']
        pp = pp_class(self, **compat_kwargs(pp_def))
        self.add_post_processor(pp)
    for ph in self.params.get(u'progress_hooks', []):
        self.add_progress_hook(ph)
    register_socks_protocols()
