[cleanup] Sort imports

Using https://github.com/PyCQA/isort

    isort -m VERTICAL_HANGING_INDENT --py 36 -l 80 --rr -n --tc .
This commit is contained in:
pukkandan
2022-04-12 04:02:57 +05:30
parent 86e5f3ed2e
commit f82711587c
86 changed files with 556 additions and 671 deletions
+4 -10
View File
@@ -1,8 +1,5 @@
from ..compat import compat_str
from ..utils import (
determine_protocol,
NO_DEFAULT
)
from ..utils import NO_DEFAULT, determine_protocol
def get_suitable_downloader(info_dict, params={}, default=NO_DEFAULT, protocol=None, to_stdout=False):
@@ -27,21 +24,18 @@ def get_suitable_downloader(info_dict, params={}, default=NO_DEFAULT, protocol=N
# Some of these require get_suitable_downloader
from .common import FileDownloader
from .dash import DashSegmentsFD
from .external import FFmpegFD, get_external_downloader
from .f4m import F4mFD
from .fc2 import FC2LiveFD
from .hls import HlsFD
from .http import HttpFD
from .rtmp import RtmpFD
from .rtsp import RtspFD
from .ism import IsmFD
from .mhtml import MhtmlFD
from .niconico import NiconicoDmcFD
from .rtmp import RtmpFD
from .rtsp import RtspFD
from .websocket import WebSocketFragmentFD
from .youtube_live_chat import YoutubeLiveChatFD
from .external import (
get_external_downloader,
FFmpegFD,
)
PROTOCOL_MAP = {
'rtmp': RtmpFD,
+9 -9
View File
@@ -1,26 +1,26 @@
import errno
import os
import random
import re
import time
import random
import errno
from ..minicurses import (
BreaklineStatusPrinter,
MultilineLogger,
MultilinePrinter,
QuietMultilinePrinter,
)
from ..utils import (
LockingUnsupportedError,
decodeArgument,
encodeFilename,
error_to_compat_str,
format_bytes,
LockingUnsupportedError,
sanitize_open,
shell_quote,
timeconvert,
timetuple_from_msec,
)
from ..minicurses import (
MultilineLogger,
MultilinePrinter,
QuietMultilinePrinter,
BreaklineStatusPrinter
)
class FileDownloader:
+1 -2
View File
@@ -1,8 +1,7 @@
import time
from ..downloader import get_suitable_downloader
from .fragment import FragmentFD
from ..downloader import get_suitable_downloader
from ..utils import urljoin
+7 -10
View File
@@ -5,23 +5,20 @@ import sys
import time
from .fragment import FragmentFD
from ..compat import (
compat_setenv,
compat_str,
)
from ..postprocessor.ffmpeg import FFmpegPostProcessor, EXT_TO_OUT_FORMATS
from ..compat import compat_setenv, compat_str
from ..postprocessor.ffmpeg import EXT_TO_OUT_FORMATS, FFmpegPostProcessor
from ..utils import (
Popen,
_configuration_args,
check_executable,
classproperty,
cli_bool_option,
cli_option,
cli_valueless_option,
cli_bool_option,
_configuration_args,
determine_ext,
encodeFilename,
encodeArgument,
encodeFilename,
handle_youtubedl_headers,
check_executable,
Popen,
remove_end,
)
+4 -7
View File
@@ -6,16 +6,13 @@ from .fragment import FragmentFD
from ..compat import (
compat_b64decode,
compat_etree_fromstring,
compat_urlparse,
compat_urllib_error,
compat_urllib_parse_urlparse,
compat_struct_pack,
compat_struct_unpack,
compat_urllib_error,
compat_urllib_parse_urlparse,
compat_urlparse,
)
from ..utils import (
fix_xml_ampersands,
xpath_text,
)
from ..utils import fix_xml_ampersands, xpath_text
class DataTruncatedError(Exception):
+2 -6
View File
@@ -13,15 +13,11 @@ except ImportError:
from .common import FileDownloader
from .http import HttpFD
from ..aes import aes_cbc_decrypt_bytes, unpad_pkcs7
from ..compat import (
compat_os_name,
compat_urllib_error,
compat_struct_pack,
)
from ..compat import compat_os_name, compat_struct_pack, compat_urllib_error
from ..utils import (
DownloadError,
error_to_compat_str,
encodeFilename,
error_to_compat_str,
sanitized_Request,
traverse_obj,
)
+6 -14
View File
@@ -1,21 +1,13 @@
import re
import io
import binascii
import io
import re
from ..downloader import get_suitable_downloader
from .fragment import FragmentFD
from .external import FFmpegFD
from ..compat import (
compat_pycrypto_AES,
compat_urlparse,
)
from ..utils import (
parse_m3u8_attributes,
update_url_query,
bug_reports_message,
)
from .fragment import FragmentFD
from .. import webvtt
from ..compat import compat_pycrypto_AES, compat_urlparse
from ..downloader import get_suitable_downloader
from ..utils import bug_reports_message, parse_m3u8_attributes, update_url_query
class HlsFD(FragmentFD):
+5 -8
View File
@@ -1,24 +1,21 @@
import os
import random
import ssl
import time
import random
from .common import FileDownloader
from ..compat import (
compat_urllib_error,
compat_http_client
)
from ..compat import compat_http_client, compat_urllib_error
from ..utils import (
ContentTooShortError,
ThrottledDownload,
XAttrMetadataError,
XAttrUnavailableError,
encodeFilename,
int_or_none,
parse_http_range,
sanitized_Request,
ThrottledDownload,
try_call,
write_xattr,
XAttrMetadataError,
XAttrUnavailableError,
)
RESPONSE_READ_EXCEPTIONS = (TimeoutError, ConnectionError, ssl.SSLError, compat_http_client.HTTPException)
+2 -5
View File
@@ -1,13 +1,10 @@
import time
import binascii
import io
import struct
import time
from .fragment import FragmentFD
from ..compat import (
compat_urllib_error,
)
from ..compat import compat_urllib_error
u8 = struct.Struct('>B')
u88 = struct.Struct('>Bx')
+1 -6
View File
@@ -4,12 +4,7 @@ import re
import uuid
from .fragment import FragmentFD
from ..utils import (
escapeHTML,
formatSeconds,
srt_subtitles_timecode,
urljoin,
)
from ..utils import escapeHTML, formatSeconds, srt_subtitles_timecode, urljoin
from ..version import __version__ as YT_DLP_VERSION
+4 -4
View File
@@ -6,11 +6,11 @@ import time
from .common import FileDownloader
from ..compat import compat_str
from ..utils import (
check_executable,
encodeFilename,
encodeArgument,
get_exe_version,
Popen,
check_executable,
encodeArgument,
encodeFilename,
get_exe_version,
)
+1 -4
View File
@@ -2,10 +2,7 @@ import os
import subprocess
from .common import FileDownloader
from ..utils import (
check_executable,
encodeFilename,
)
from ..utils import check_executable, encodeFilename
class RtspFD(FileDownloader):
+1 -1
View File
@@ -1,6 +1,6 @@
import asyncio
import os
import signal
import asyncio
import threading
try:
+1 -6
View File
@@ -3,13 +3,8 @@ import time
from .fragment import FragmentFD
from ..compat import compat_urllib_error
from ..utils import (
try_get,
dict_get,
int_or_none,
RegexNotFoundError,
)
from ..extractor.youtube import YoutubeBaseInfoExtractor as YT_BaseIE
from ..utils import RegexNotFoundError, dict_get, int_or_none, try_get
class YoutubeLiveChatFD(FragmentFD):