1
0
mirror of https://github.com/l1ving/youtube-dl synced 2025-02-14 14:42:52 +08:00

The youtube_dl/FileDownloader says: # Legacy file for backwards compatibility, use youtube_dl.downloader instead!

So I checked for usages of this class, and it turns out the only place it is used is in  `youtube_dl/__init__.py`.
Actually, the only method used is `FileDownloader.parse_bytes`, which is defined as a static method in `.downloader/FileDownloader` anyway!
The old `FileDownloader._do_download` is never used.
To summarize, the class can safely be deleted (unless my IDE and I missed something).
This commit is contained in:
codesparkle 2014-05-22 16:38:27 +10:00
parent eec4d8ef96
commit 1b5a268498
2 changed files with 1 additions and 17 deletions

View File

@ -1,12 +0,0 @@
# Legacy file for backwards compatibility, use youtube_dl.downloader instead!
from .downloader import FileDownloader as RealFileDownloader
from .downloader import get_suitable_downloader
# This class reproduces the old behaviour of FileDownloader
class FileDownloader(RealFileDownloader):
def _do_download(self, filename, info_dict):
real_fd = get_suitable_downloader(info_dict)(self.ydl, self.params)
for ph in self._progress_hooks:
real_fd.add_progress_hook(ph)
return real_fd.download(filename, info_dict)

View File

@ -63,14 +63,13 @@ __license__ = 'Public Domain'
import codecs import codecs
import io import io
import locale
import optparse import optparse
import os import os
import random import random
import re
import shlex import shlex
import sys import sys
from .downloader import FileDownloader
from .utils import ( from .utils import (
compat_getpass, compat_getpass,
@ -90,9 +89,6 @@ from .utils import (
write_string, write_string,
) )
from .update import update_self from .update import update_self
from .FileDownloader import (
FileDownloader,
)
from .extractor import gen_extractors from .extractor import gen_extractors
from .version import __version__ from .version import __version__
from .YoutubeDL import YoutubeDL from .YoutubeDL import YoutubeDL