]> jfr.im git - yt-dlp.git/commitdiff
[cleanup] Sort imports
authorpukkandan <redacted>
Mon, 11 Apr 2022 22:32:57 +0000 (04:02 +0530)
committerpukkandan <redacted>
Tue, 12 Apr 2022 00:02:52 +0000 (05:32 +0530)
Using https://github.com/PyCQA/isort

    isort -m VERTICAL_HANGING_INDENT --py 36 -l 80 --rr -n --tc .

86 files changed:
.gitignore
devscripts/bash-completion.py
devscripts/check-porn.py
devscripts/fish-completion.py
devscripts/generate_aes_testdata.py
devscripts/make_lazy_extractors.py
devscripts/make_readme.py
devscripts/make_supportedsites.py
devscripts/update-formulae.py
devscripts/update-version.py
devscripts/zsh-completion.py
pyinst.py
setup.py
test/helper.py
test/test_InfoExtractor.py
test/test_YoutubeDL.py
test/test_YoutubeDLCookieJar.py
test/test_aes.py
test/test_age_restriction.py
test/test_all_urls.py
test/test_cache.py
test/test_compat.py
test/test_cookies.py
test/test_download.py
test/test_downloader_http.py
test/test_execution.py
test/test_http.py
test/test_iqiyi_sdk_interpreter.py
test/test_jsinterp.py
test/test_netrc.py
test/test_overwrites.py
test/test_post_hooks.py
test/test_postprocessors.py
test/test_socks.py
test/test_subtitles.py
test/test_update.py.disabled
test/test_utils.py
test/test_verbose_output.py
test/test_write_annotations.py.disabled
test/test_youtube_lists.py
test/test_youtube_misc.py
test/test_youtube_signature.py
yt_dlp/YoutubeDL.py
yt_dlp/__init__.py
yt_dlp/aes.py
yt_dlp/cache.py
yt_dlp/cookies.py
yt_dlp/downloader/__init__.py
yt_dlp/downloader/common.py
yt_dlp/downloader/dash.py
yt_dlp/downloader/external.py
yt_dlp/downloader/f4m.py
yt_dlp/downloader/fragment.py
yt_dlp/downloader/hls.py
yt_dlp/downloader/http.py
yt_dlp/downloader/ism.py
yt_dlp/downloader/mhtml.py
yt_dlp/downloader/rtmp.py
yt_dlp/downloader/rtsp.py
yt_dlp/downloader/websocket.py
yt_dlp/downloader/youtube_live_chat.py
yt_dlp/extractor/abematv.py
yt_dlp/extractor/common.py
yt_dlp/extractor/commonprotocols.py
yt_dlp/extractor/generic.py
yt_dlp/extractor/mtv.py
yt_dlp/extractor/noz.py
yt_dlp/extractor/openload.py
yt_dlp/extractor/youtube.py
yt_dlp/jsinterp.py
yt_dlp/minicurses.py
yt_dlp/options.py
yt_dlp/postprocessor/__init__.py
yt_dlp/postprocessor/common.py
yt_dlp/postprocessor/embedthumbnail.py
yt_dlp/postprocessor/exec.py
yt_dlp/postprocessor/ffmpeg.py
yt_dlp/postprocessor/modify_chapters.py
yt_dlp/postprocessor/movefilesafterdownload.py
yt_dlp/postprocessor/sponskrub.py
yt_dlp/postprocessor/sponsorblock.py
yt_dlp/postprocessor/xattrpp.py
yt_dlp/socks.py
yt_dlp/update.py
yt_dlp/utils.py
yt_dlp/webvtt.py

index c815538e82537f15bc478afb8cc745826c0cca43..92f9029e3e4f5e8f6964a5b415aa07242935150b 100644 (file)
@@ -82,6 +82,7 @@ updates_key.pem
 *.egg-info
 .tox
 *.class
+*.isorted
 
 # Generated
 AUTHORS
index 23a9a5781dc41f328b43cf9648bdcb79db08ed3f..73d698c39bf6ecfa9e0b9d72a5ecef88281dfb56 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 import os
-from os.path import dirname as dirn
 import sys
+from os.path import dirname as dirn
 
 sys.path.insert(0, dirn(dirn(os.path.abspath(__file__))))
 import yt_dlp
index 6188f68ec7d9289e9d1639d8543f2d204f43884b..08f663e4babf5eda94c4ccc758de8780b82404e6 100644 (file)
 # Allow direct execution
 import os
 import sys
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 from test.helper import gettestcases
-from yt_dlp.utils import compat_urllib_parse_urlparse
-from yt_dlp.utils import compat_urllib_request
+
+from yt_dlp.utils import compat_urllib_parse_urlparse, compat_urllib_request
 
 if len(sys.argv) > 1:
     METHOD = 'LIST'
index d958a5d6bc1cdffdcb228be6ed21aa0689e242b7..c318b69e412de613b88d63b2065f15e8a842e851 100755 (executable)
@@ -1,8 +1,8 @@
 #!/usr/bin/env python3
 import optparse
 import os
-from os.path import dirname as dirn
 import sys
+from os.path import dirname as dirn
 
 sys.path.insert(0, dirn(dirn(os.path.abspath(__file__))))
 import yt_dlp
index 308c74a204dced0354e8efa6a41e92cd2ff076ca..c7d83f1a75006bff77f640f73ae9044f749ad4d9 100644 (file)
@@ -1,13 +1,13 @@
 #!/usr/bin/env python3
 import codecs
-import subprocess
-
 import os
+import subprocess
 import sys
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
-from yt_dlp.utils import intlist_to_bytes
 from yt_dlp.aes import aes_encrypt, key_expansion
+from yt_dlp.utils import intlist_to_bytes
 
 secret_msg = b'Secret message goes here'
 
index 24e8cfa5b8f94c80be6bed0710cba18c9fcd5632..6d5f96cf0e472b2c412725915871bf42962bf0e2 100644 (file)
@@ -1,8 +1,8 @@
 #!/usr/bin/env python3
-from inspect import getsource
 import os
-from os.path import dirname as dirn
 import sys
+from inspect import getsource
+from os.path import dirname as dirn
 
 sys.path.insert(0, dirn(dirn(os.path.abspath(__file__))))
 
index 5d85bcc63ae99b043c8da33c11feb84cd7b5e920..1719ac8e43e84cb06983e9edc89dbdcdafc90512 100755 (executable)
@@ -2,8 +2,8 @@
 
 # yt-dlp --help | make_readme.py
 # This must be run in a console of correct width
-import sys
 import re
+import sys
 
 README_FILE = 'README.md'
 helptext = sys.stdin.read()
index 26d25704ea0985b0fe1c3d1e348a5de89210bbce..0a0d08f56fa1b80b1f7cce0c4fc0e37481fe5a88 100644 (file)
@@ -3,7 +3,6 @@
 import os
 import sys
 
-
 # Import yt_dlp
 ROOT_DIR = os.path.join(os.path.dirname(__file__), '..')
 sys.path.insert(0, ROOT_DIR)
index 3a0bef52e54707686893d904a34adcc534912cb3..6424f5d9bc174ca19984da798ae9f5e91d223f1d 100644 (file)
@@ -8,7 +8,6 @@
 
 from yt_dlp.compat import compat_urllib_request
 
-
 # usage: python3 ./devscripts/update-formulae.py <path-to-formulae-rb> <version>
 # version can be either 0-aligned (yt-dlp version) or normalized (PyPl version)
 
index 233cdaa76a113492f4dc45148f1b2d0c7d8865e8..991cfb2aff0db83a2fcde6c025dc68b7e4f17ccb 100644 (file)
@@ -1,8 +1,7 @@
 #!/usr/bin/env python3
-from datetime import datetime
-import sys
 import subprocess
-
+import sys
+from datetime import datetime
 
 with open('yt_dlp/version.py') as f:
     exec(compile(f.read(), 'yt_dlp/version.py', 'exec'))
index 677fe7373da93741971da6a99188a7f6ad9d528d..2d5ac2a45da0bc67a87a031b7364c0a49e8991c3 100755 (executable)
@@ -1,7 +1,7 @@
 #!/usr/bin/env python3
 import os
-from os.path import dirname as dirn
 import sys
+from os.path import dirname as dirn
 
 sys.path.insert(0, dirn(dirn(os.path.abspath(__file__))))
 import yt_dlp
index 1f72bd4be574742ca2175369dc975793fa5852ec..9e8128e09daea550f2851c5d5c52baf7c7316344 100644 (file)
--- a/pyinst.py
+++ b/pyinst.py
@@ -2,14 +2,20 @@
 import os
 import platform
 import sys
-from PyInstaller.utils.hooks import collect_submodules
 
+from PyInstaller.utils.hooks import collect_submodules
 
 OS_NAME = platform.system()
 if OS_NAME == 'Windows':
     from PyInstaller.utils.win32.versioninfo import (
-        VarStruct, VarFileInfo, StringStruct, StringTable,
-        StringFileInfo, FixedFileInfo, VSVersionInfo, SetVersion,
+        FixedFileInfo,
+        SetVersion,
+        StringFileInfo,
+        StringStruct,
+        StringTable,
+        VarFileInfo,
+        VarStruct,
+        VSVersionInfo,
     )
 elif OS_NAME == 'Darwin':
     pass
index 9eab7f1d7db04c5cfc39a15cd0e71b5a59bdc8fe..45f4d6b49ee8cb8852c0f6f46fae389519917be4 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -1,13 +1,13 @@
 #!/usr/bin/env python3
 import os.path
-import warnings
 import sys
+import warnings
 
 try:
-    from setuptools import setup, Command, find_packages
+    from setuptools import Command, find_packages, setup
     setuptools_available = True
 except ImportError:
-    from distutils.core import setup, Command
+    from distutils.core import Command, setup
     setuptools_available = False
 from distutils.spawn import spawn
 
index d940e327cf5a29ee96e8169a4749fd002d444788..81e53ed74c52304db8d644e4114fc6b7b78e32d5 100644 (file)
@@ -3,21 +3,14 @@
 import json
 import os.path
 import re
-import types
 import ssl
 import sys
+import types
 
 import yt_dlp.extractor
 from yt_dlp import YoutubeDL
-from yt_dlp.compat import (
-    compat_os_name,
-    compat_str,
-)
-from yt_dlp.utils import (
-    preferredencoding,
-    write_string,
-)
-
+from yt_dlp.compat import compat_os_name, compat_str
+from yt_dlp.utils import preferredencoding, write_string
 
 if 'pytest' in sys.modules:
     import pytest
index 4fd21bed4b7141db534e1be5cfadbae246e1616b..173b62920147f8c0841fe7f99919df76c3e93a4c 100644 (file)
@@ -3,15 +3,21 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
+import threading
 from test.helper import FakeYDL, expect_dict, expect_value, http_server_port
+
 from yt_dlp.compat import compat_etree_fromstring, compat_http_server
-from yt_dlp.extractor.common import InfoExtractor
 from yt_dlp.extractor import YoutubeIE, get_info_extractor
-from yt_dlp.utils import encode_data_uri, strip_jsonp, ExtractorError, RegexNotFoundError
-import threading
-
+from yt_dlp.extractor.common import InfoExtractor
+from yt_dlp.utils import (
+    ExtractorError,
+    RegexNotFoundError,
+    encode_data_uri,
+    strip_jsonp,
+)
 
 TEAPOT_RESPONSE_STATUS = 418
 TEAPOT_RESPONSE_BODY = "<h1>418 I'm a teapot</h1>"
index 480c7539c8c6f92c4131a2f36e35b80e8d9b1919..051a203acdd95292230dff71a9676fccd1ac4087 100644 (file)
@@ -3,18 +3,29 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 import copy
 import json
-
 from test.helper import FakeYDL, assertRegexpMatches
+
 from yt_dlp import YoutubeDL
-from yt_dlp.compat import compat_os_name, compat_setenv, compat_str, compat_urllib_error
+from yt_dlp.compat import (
+    compat_os_name,
+    compat_setenv,
+    compat_str,
+    compat_urllib_error,
+)
 from yt_dlp.extractor import YoutubeIE
 from yt_dlp.extractor.common import InfoExtractor
 from yt_dlp.postprocessor.common import PostProcessor
-from yt_dlp.utils import ExtractorError, int_or_none, match_filter_func, LazyList
+from yt_dlp.utils import (
+    ExtractorError,
+    LazyList,
+    int_or_none,
+    match_filter_func,
+)
 
 TEST_URL = 'http://localhost/sample.mp4'
 
index 1e5bedcaedefd22e893ef835d901a5e69748c948..13a4569b2490abc2fec6d3a2b478d7f82074c9dd 100644 (file)
@@ -4,6 +4,7 @@
 import sys
 import tempfile
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 from yt_dlp.utils import YoutubeDLCookieJar
index 34584a04f5a61e51e1902e4b94ca52dde39bc414..1c1238c8b5ed622835e0a2d382785e60c3f37722 100644 (file)
@@ -3,26 +3,28 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
+import base64
+
 from yt_dlp.aes import (
-    aes_decrypt,
-    aes_encrypt,
-    aes_ecb_encrypt,
-    aes_ecb_decrypt,
+    BLOCK_SIZE_BYTES,
     aes_cbc_decrypt,
     aes_cbc_decrypt_bytes,
     aes_cbc_encrypt,
     aes_ctr_decrypt,
     aes_ctr_encrypt,
+    aes_decrypt,
+    aes_decrypt_text,
+    aes_ecb_decrypt,
+    aes_ecb_encrypt,
+    aes_encrypt,
     aes_gcm_decrypt_and_verify,
     aes_gcm_decrypt_and_verify_bytes,
-    aes_decrypt_text,
-    BLOCK_SIZE_BYTES,
 )
 from yt_dlp.compat import compat_pycrypto_AES
 from yt_dlp.utils import bytes_to_intlist, intlist_to_bytes
-import base64
 
 # the encrypted data can be generate with 'devscripts/generate_aes_testdata.py'
 
index 50d16a7297e5958111df4e70d6afe6eddeaebd54..e1012f69bb36dfee59aa0ea5d32f7334e0928185 100644 (file)
@@ -3,9 +3,10 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
-from test.helper import try_rm, is_download_test
+from test.helper import is_download_test, try_rm
 
 from yt_dlp import YoutubeDL
 
index d70da8cae5ea30873ac91ab68823ecbd03b84282..b6019554e591755ab71c243b3430012ebee25e4d 100644 (file)
@@ -1,19 +1,16 @@
 #!/usr/bin/env python3
 # Allow direct execution
+import collections
 import os
 import sys
 import unittest
-import collections
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 
 from test.helper import gettestcases
 
-from yt_dlp.extractor import (
-    FacebookIE,
-    gen_extractors,
-    YoutubeIE,
-)
+from yt_dlp.extractor import FacebookIE, YoutubeIE, gen_extractors
 
 
 class TestAllURLsMatching(unittest.TestCase):
index 4e4641ebad3e8955d60968fa5393815bf003cb07..14e54ba2047bc3aa6a51975ab746eb61801b79d5 100644 (file)
@@ -1,14 +1,15 @@
 #!/usr/bin/env python3
-import shutil
-
 # Allow direct execution
 import os
+import shutil
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 
 from test.helper import FakeYDL
+
 from yt_dlp.cache import Cache
 
 
index 31524c5abb3664f2abb93729626a0ab269f2721b..20dab9573ff808ffcf2de90e6e3940fe28ea24b8 100644 (file)
@@ -3,14 +3,15 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 
 from yt_dlp.compat import (
-    compat_getenv,
-    compat_setenv,
     compat_etree_fromstring,
     compat_expanduser,
+    compat_getenv,
+    compat_setenv,
     compat_str,
     compat_struct_unpack,
     compat_urllib_parse_unquote,
index 842ebcb99bbefe041100dea61c266c85a9c3555b..5bfaec367802db8f92650d1dcbcb39d6d833c664 100644 (file)
@@ -6,10 +6,10 @@
     LinuxChromeCookieDecryptor,
     MacChromeCookieDecryptor,
     WindowsChromeCookieDecryptor,
-    parse_safari_cookies,
-    pbkdf2_sha1,
     _get_linux_desktop_environment,
     _LinuxDesktopEnvironment,
+    parse_safari_cookies,
+    pbkdf2_sha1,
 )
 
 
index 3c6b55d9843818f93a1e540c412c729ed3959a35..9a83bee2f5fdd5fad7e89a8dd709e00e145d1808 100755 (executable)
@@ -1,8 +1,12 @@
 #!/usr/bin/env python3
 # Allow direct execution
+import hashlib
+import json
 import os
+import socket
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 from test.helper import (
     try_rm,
 )
 
-
-import hashlib
-import json
-import socket
-
 import yt_dlp.YoutubeDL
 from yt_dlp.compat import (
     compat_http_client,
-    compat_urllib_error,
     compat_HTTPError,
+    compat_urllib_error,
 )
+from yt_dlp.extractor import get_info_extractor
 from yt_dlp.utils import (
     DownloadError,
     ExtractorError,
-    format_bytes,
     UnavailableVideoError,
+    format_bytes,
 )
-from yt_dlp.extractor import get_info_extractor
 
 RETRIES = 3
 
index c511909c7236d8446cc8c63efc60398d8c615305..c33308064fa1b1ecb90f90eb12c60b6d54476d1d 100644 (file)
@@ -4,14 +4,16 @@
 import re
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
+import threading
 from test.helper import http_server_port, try_rm
+
 from yt_dlp import YoutubeDL
 from yt_dlp.compat import compat_http_server
 from yt_dlp.downloader.http import HttpFD
 from yt_dlp.utils import encodeFilename
-import threading
 
 TEST_DIR = os.path.dirname(os.path.abspath(__file__))
 
index 623f08165590cdfa5ecbe7b3764026ddeb9fe12f..6a3e9944bfb4f1ed75d1ab083adddb6b9dfbefd4 100644 (file)
@@ -1,9 +1,9 @@
 #!/usr/bin/env python3
-import unittest
-
-import sys
 import os
 import subprocess
+import sys
+import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 from yt_dlp.utils import encodeArgument
index 2106220eb277bf91d5a77252e06c20f3e3925440..029996ca93f14cf3c6721c5ac806a7f11cce19e6 100644 (file)
@@ -3,13 +3,15 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
+import ssl
+import threading
 from test.helper import http_server_port
+
 from yt_dlp import YoutubeDL
 from yt_dlp.compat import compat_http_server, compat_urllib_request
-import ssl
-import threading
 
 TEST_DIR = os.path.dirname(os.path.abspath(__file__))
 
index 57a7ed3a8a69406c2a61a9a0f38f819547dd9142..4b82b71874446701b50c31fae698c6acb0d403b7 100644 (file)
@@ -3,9 +3,11 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 from test.helper import FakeYDL, is_download_test
+
 from yt_dlp.extractor import IqiyiIE
 
 
index 10a465cf9578099971704745ff5c62bd42318505..872c58c8fab29e0d402aa692860bc2ecc0575685 100644 (file)
@@ -3,6 +3,7 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 from yt_dlp.jsinterp import JSInterpreter
index adc3a0ed1e1796f2c7beea4fd8fd4c37f96e68e5..f7a0b33d269c1ecd7bd4b8af5f9d24769b96f063 100644 (file)
@@ -1,6 +1,7 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 
index 8e0548db5b13f4b038040dbcb64b1cfc5ee94e23..39741b65c5a57cd1f2964d3afae08508f1df257d 100644 (file)
@@ -1,14 +1,14 @@
 #!/usr/bin/env python3
 import os
-from os.path import join
 import subprocess
 import sys
 import unittest
+from os.path import join
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 from test.helper import is_download_test, try_rm
 
-
 root_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
 download_file = join(root_dir, 'test.webm')
 
index 020203f2fae86a3dfa627da2086daa8553964765..e84a08f2958ad90cfe0fd4242686229c1206a935 100644 (file)
@@ -2,9 +2,11 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
-from test.helper import get_params, try_rm, is_download_test
+from test.helper import get_params, is_download_test, try_rm
+
 import yt_dlp.YoutubeDL
 from yt_dlp.utils import DownloadError
 
index e5893f7d2e2ed930a051437537e7dde285ba6b1d..9d8a4dcc505a888aea165d158b9fb26519c4112e 100644 (file)
@@ -13,7 +13,7 @@
     FFmpegThumbnailsConvertorPP,
     MetadataFromFieldPP,
     MetadataParserPP,
-    ModifyChaptersPP
+    ModifyChaptersPP,
 )
 
 
index 02723b469821a2936fbf896c71e5fae6922d7449..546f0d73dc37326cf69d951f084f0754f894f187 100644 (file)
@@ -3,20 +3,14 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 import random
 import subprocess
+from test.helper import FakeYDL, get_params, is_download_test
 
-from test.helper import (
-    FakeYDL,
-    get_params,
-    is_download_test,
-)
-from yt_dlp.compat import (
-    compat_str,
-    compat_urllib_request,
-)
+from yt_dlp.compat import compat_str, compat_urllib_request
 
 
 @is_download_test
index 0be1842da9aa8db4fc4976e6a0f8871e3ec20351..362b67ceff62f8f1720538e7ac471688a4276d2d 100644 (file)
@@ -3,29 +3,29 @@
 import os
 import sys
 import unittest
-sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
-from test.helper import FakeYDL, md5, is_download_test
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
+from test.helper import FakeYDL, is_download_test, md5
 
 from yt_dlp.extractor import (
-    YoutubeIE,
-    DailymotionIE,
-    TedTalkIE,
-    VimeoIE,
-    WallaIE,
-    CeskaTelevizeIE,
-    LyndaIE,
     NPOIE,
+    NRKTVIE,
     PBSIE,
+    CeskaTelevizeIE,
     ComedyCentralIE,
-    NRKTVIE,
+    DailymotionIE,
+    DemocracynowIE,
+    LyndaIE,
     RaiPlayIE,
-    VikiIE,
-    ThePlatformIE,
-    ThePlatformFeedIE,
     RTVEALaCartaIE,
-    DemocracynowIE,
+    TedTalkIE,
+    ThePlatformFeedIE,
+    ThePlatformIE,
+    VikiIE,
+    VimeoIE,
+    WallaIE,
+    YoutubeIE,
 )
 
 
index 5f0794ae278d5a23c7ac43c5c3e70aee84c051f6..389b8ffe5fdaf56512cfd6c11b338073d42fe6ae 100644 (file)
@@ -3,10 +3,12 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 
 import json
+
 from yt_dlp.update import rsa_verify
 
 
index e0c862807efcadeb46cace4379ca7d13f90566db..7909dc61c060dc9228c3dde7555aad1a4979f61f 100644 (file)
@@ -3,6 +3,7 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 
 import json
 import xml.etree.ElementTree
 
+from yt_dlp.compat import (
+    compat_chr,
+    compat_etree_fromstring,
+    compat_getenv,
+    compat_HTMLParseError,
+    compat_os_name,
+    compat_setenv,
+)
 from yt_dlp.utils import (
+    Config,
+    DateRange,
+    ExtractorError,
+    InAdvancePagedList,
+    LazyList,
+    OnDemandPagedList,
     age_restricted,
     args_to_str,
-    encode_base_n,
+    base_url,
     caesar,
     clean_html,
     clean_podcast_url,
-    Config,
+    cli_bool_option,
+    cli_option,
+    cli_valueless_option,
     date_from_str,
     datetime_from_str,
-    DateRange,
     detect_exe_version,
     determine_ext,
+    dfxp2srt,
     dict_get,
+    encode_base_n,
     encode_compat_str,
     encodeFilename,
     escape_rfc3986,
     escape_url,
+    expand_path,
     extract_attributes,
-    ExtractorError,
     find_xpath_attr,
     fix_xml_ampersands,
-    format_bytes,
     float_or_none,
-    get_element_by_class,
+    format_bytes,
     get_element_by_attribute,
-    get_elements_by_class,
-    get_elements_by_attribute,
-    get_element_html_by_class,
+    get_element_by_class,
     get_element_html_by_attribute,
-    get_elements_html_by_class,
+    get_element_html_by_class,
+    get_element_text_and_html_by_tag,
+    get_elements_by_attribute,
+    get_elements_by_class,
     get_elements_html_by_attribute,
+    get_elements_html_by_class,
     get_elements_text_and_html_by_attribute,
-    get_element_text_and_html_by_tag,
-    InAdvancePagedList,
     int_or_none,
     intlist_to_bytes,
+    iri_to_uri,
     is_html,
     js_to_json,
     limit_length,
     locked_file,
+    lowercase_escape,
+    match_str,
     merge_dicts,
     mimetype2ext,
     month_by_name,
     multipart_encode,
     ohdave_rsa_encrypt,
-    OnDemandPagedList,
     orderedSet,
     parse_age_limit,
+    parse_bitrate,
+    parse_codecs,
+    parse_count,
+    parse_dfxp_time_expr,
     parse_duration,
     parse_filesize,
-    parse_count,
     parse_iso8601,
-    parse_resolution,
-    parse_bitrate,
     parse_qs,
+    parse_resolution,
     pkcs1pad,
+    prepend_extension,
     read_batch_urls,
+    remove_end,
+    remove_quotes,
+    remove_start,
+    render_table,
+    replace_extension,
+    rot47,
     sanitize_filename,
     sanitize_path,
     sanitize_url,
     sanitized_Request,
-    expand_path,
-    prepend_extension,
-    replace_extension,
-    remove_start,
-    remove_end,
-    remove_quotes,
-    rot47,
     shell_quote,
     smuggle_url,
     str_to_int,
     unified_strdate,
     unified_timestamp,
     unsmuggle_url,
+    update_url_query,
     uppercase_escape,
-    lowercase_escape,
     url_basename,
     url_or_none,
-    base_url,
-    urljoin,
     urlencode_postdata,
+    urljoin,
     urshift,
-    update_url_query,
     version_tuple,
-    xpath_with_ns,
+    xpath_attr,
     xpath_element,
     xpath_text,
-    xpath_attr,
-    render_table,
-    match_str,
-    parse_dfxp_time_expr,
-    dfxp2srt,
-    cli_option,
-    cli_valueless_option,
-    cli_bool_option,
-    parse_codecs,
-    iri_to_uri,
-    LazyList,
-)
-from yt_dlp.compat import (
-    compat_chr,
-    compat_etree_fromstring,
-    compat_getenv,
-    compat_HTMLParseError,
-    compat_os_name,
-    compat_setenv,
+    xpath_with_ns,
 )
 
 
index 17aeafbc06bc0f931c717dd9ff9d735fb5a97c27..1213a97266f70354a775d386f5420da770ef1bdf 100644 (file)
@@ -1,9 +1,9 @@
 #!/usr/bin/env python3
-import unittest
-
-import sys
 import os
 import subprocess
+import sys
+import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
index 4173fd09d10354a432e1784c74c277233dfd5ce3..bf13efe2c3eb874884a71b3d401d8abde78d45c2 100644 (file)
@@ -3,17 +3,15 @@
 import os
 import sys
 import unittest
-sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
-
-from test.helper import get_params, try_rm, is_download_test
 
+sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 import io
-
 import xml.etree.ElementTree
+from test.helper import get_params, is_download_test, try_rm
 
-import yt_dlp.YoutubeDL
 import yt_dlp.extractor
+import yt_dlp.YoutubeDL
 
 
 class YoutubeDL(yt_dlp.YoutubeDL):
index 8691abb67a3f161d9a27259d8fefc9b9f1b6541b..66611e236e4dcb04346e26cae44f5c78827d2e75 100644 (file)
@@ -3,14 +3,12 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 from test.helper import FakeYDL, is_download_test
 
-from yt_dlp.extractor import (
-    YoutubeIE,
-    YoutubeTabIE,
-)
+from yt_dlp.extractor import YoutubeIE, YoutubeTabIE
 
 
 @is_download_test
index 70d6d99491c09f698863127b576c152bd771e803..36f8be6890267464789382ad79c50113704ff0e1 100644 (file)
@@ -3,6 +3,7 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 
index d751d53961255765ad83c3665f96d043f8efd3cd..ca23c910d5e3d06e0225ee59aad67c57fec83e1f 100644 (file)
@@ -3,16 +3,17 @@
 import os
 import sys
 import unittest
+
 sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
 
 import re
 import string
 import urllib.request
-
 from test.helper import FakeYDL, is_download_test
+
+from yt_dlp.compat import compat_str
 from yt_dlp.extractor import YoutubeIE
 from yt_dlp.jsinterp import JSInterpreter
-from yt_dlp.compat import compat_str
 
 _SIG_TESTS = [
     (
index 56f0346dccc3a1291561404f9e6d330e8555a17a..a8bb7f45c34e0da1b58068da893a79bca8d6842d 100644 (file)
@@ -12,6 +12,7 @@
 import operator
 import os
 import platform
+import random
 import re
 import shutil
 import subprocess
 import time
 import tokenize
 import traceback
-import random
 import unicodedata
 import urllib.request
-
 from enum import Enum
 from string import ascii_letters
 
+from .cache import Cache
 from .compat import (
     compat_brotli,
     compat_get_terminal_size,
     windows_enable_vt_mode,
 )
 from .cookies import load_cookies
+from .downloader import FFmpegFD, get_suitable_downloader, shorten_protocol_name
+from .downloader.rtmp import rtmpdump_version
+from .extractor import _LAZY_LOADER
+from .extractor import _PLUGIN_CLASSES as plugin_extractors
+from .extractor import gen_extractor_classes, get_info_extractor
+from .extractor.openload import PhantomJSwrapper
+from .minicurses import format_text
+from .postprocessor import _PLUGIN_CLASSES as plugin_postprocessors
+from .postprocessor import (
+    EmbedThumbnailPP,
+    FFmpegFixupDuplicateMoovPP,
+    FFmpegFixupDurationPP,
+    FFmpegFixupM3u8PP,
+    FFmpegFixupM4aPP,
+    FFmpegFixupStretchedPP,
+    FFmpegFixupTimestampPP,
+    FFmpegMergerPP,
+    FFmpegPostProcessor,
+    MoveFilesAfterDownloadPP,
+    get_postprocessor,
+)
+from .update import detect_variant
 from .utils import (
+    DEFAULT_OUTTMPL,
+    LINK_TEMPLATES,
+    NO_DEFAULT,
+    OUTTMPL_TYPES,
+    POSTPROCESS_WHEN,
+    STR_FORMAT_RE_TMPL,
+    STR_FORMAT_TYPES,
+    ContentTooShortError,
+    DateRange,
+    DownloadCancelled,
+    DownloadError,
+    EntryNotInPlaylist,
+    ExistingVideoReached,
+    ExtractorError,
+    GeoRestrictedError,
+    HEADRequest,
+    InAdvancePagedList,
+    ISO3166Utils,
+    LazyList,
+    MaxDownloadsReached,
+    PagedList,
+    PerRequestProxyHandler,
+    Popen,
+    PostProcessingError,
+    ReExtractInfo,
+    RejectedVideoReached,
+    SameFileError,
+    UnavailableVideoError,
+    YoutubeDLCookieProcessor,
+    YoutubeDLHandler,
+    YoutubeDLRedirectHandler,
     age_restricted,
     args_to_str,
-    ContentTooShortError,
     date_from_str,
-    DateRange,
-    DEFAULT_OUTTMPL,
     determine_ext,
     determine_protocol,
-    DownloadCancelled,
-    DownloadError,
     encode_compat_str,
     encodeFilename,
-    EntryNotInPlaylist,
     error_to_compat_str,
-    ExistingVideoReached,
     expand_path,
-    ExtractorError,
     filter_dict,
     float_or_none,
     format_bytes,
-    format_field,
     format_decimal_suffix,
+    format_field,
     formatSeconds,
-    GeoRestrictedError,
     get_domain,
     has_certifi,
-    HEADRequest,
-    InAdvancePagedList,
     int_or_none,
     iri_to_uri,
-    ISO3166Utils,
     join_nonempty,
-    LazyList,
-    LINK_TEMPLATES,
     locked_file,
     make_dir,
     make_HTTPS_handler,
-    MaxDownloadsReached,
     merge_headers,
     network_exceptions,
-    NO_DEFAULT,
     number_of_digits,
     orderedSet,
-    OUTTMPL_TYPES,
-    PagedList,
     parse_filesize,
-    PerRequestProxyHandler,
     platform_name,
-    Popen,
-    POSTPROCESS_WHEN,
-    PostProcessingError,
     preferredencoding,
     prepend_extension,
-    ReExtractInfo,
     register_socks_protocols,
-    RejectedVideoReached,
     remove_terminal_sequences,
     render_table,
     replace_extension,
-    SameFileError,
     sanitize_filename,
     sanitize_path,
     sanitize_url,
     sanitized_Request,
     std_headers,
-    STR_FORMAT_RE_TMPL,
-    STR_FORMAT_TYPES,
     str_or_none,
     strftime_or_none,
     subtitles_filename,
     to_high_limit_path,
     traverse_obj,
     try_get,
-    UnavailableVideoError,
     url_basename,
     variadic,
     version_tuple,
     write_json_file,
     write_string,
-    YoutubeDLCookieProcessor,
-    YoutubeDLHandler,
-    YoutubeDLRedirectHandler,
-)
-from .cache import Cache
-from .minicurses import format_text
-from .extractor import (
-    gen_extractor_classes,
-    get_info_extractor,
-    _LAZY_LOADER,
-    _PLUGIN_CLASSES as plugin_extractors
-)
-from .extractor.openload import PhantomJSwrapper
-from .downloader import (
-    FFmpegFD,
-    get_suitable_downloader,
-    shorten_protocol_name
-)
-from .downloader.rtmp import rtmpdump_version
-from .postprocessor import (
-    get_postprocessor,
-    EmbedThumbnailPP,
-    FFmpegFixupDuplicateMoovPP,
-    FFmpegFixupDurationPP,
-    FFmpegFixupM3u8PP,
-    FFmpegFixupM4aPP,
-    FFmpegFixupStretchedPP,
-    FFmpegFixupTimestampPP,
-    FFmpegMergerPP,
-    FFmpegPostProcessor,
-    MoveFilesAfterDownloadPP,
-    _PLUGIN_CLASSES as plugin_postprocessors
 )
-from .update import detect_variant
-from .version import __version__, RELEASE_GIT_HEAD
+from .version import RELEASE_GIT_HEAD, __version__
 
 if compat_os_name == 'nt':
     import ctypes
@@ -3666,9 +3658,9 @@ def python_implementation():
         ) or 'none'
         write_debug('exe versions: %s' % exe_str)
 
+        from .cookies import SECRETSTORAGE_AVAILABLE, SQLITE_AVAILABLE
         from .downloader.websocket import has_websockets
         from .postprocessor.embedthumbnail import has_mutagen
-        from .cookies import SQLITE_AVAILABLE, SECRETSTORAGE_AVAILABLE
 
         lib_str = join_nonempty(
             compat_brotli and compat_brotli.__name__,
index 91bf5c4cea1227e26fb9d867274800cf5722f592..f339e4cd1c547cda39821e4bb864ce1c95ea53b2 100644 (file)
@@ -9,48 +9,44 @@
 import re
 import sys
 
+from .compat import compat_getpass, compat_os_name, compat_shlex_quote
+from .cookies import SUPPORTED_BROWSERS, SUPPORTED_KEYRINGS
+from .downloader import FileDownloader
+from .extractor import gen_extractors, list_extractors
+from .extractor.adobepass import MSO_INFO
+from .extractor.common import InfoExtractor
 from .options import parseOpts
-from .compat import (
-    compat_getpass,
-    compat_os_name,
-    compat_shlex_quote,
+from .postprocessor import (
+    FFmpegExtractAudioPP,
+    FFmpegSubtitlesConvertorPP,
+    FFmpegThumbnailsConvertorPP,
+    FFmpegVideoConvertorPP,
+    FFmpegVideoRemuxerPP,
+    MetadataFromFieldPP,
+    MetadataParserPP,
 )
-from .cookies import SUPPORTED_BROWSERS, SUPPORTED_KEYRINGS
+from .update import run_update
 from .utils import (
+    NO_DEFAULT,
     DateRange,
-    decodeOption,
     DownloadCancelled,
     DownloadError,
+    GeoUtils,
+    SameFileError,
+    decodeOption,
     expand_path,
     float_or_none,
-    GeoUtils,
     int_or_none,
     match_filter_func,
-    NO_DEFAULT,
     parse_duration,
     preferredencoding,
     read_batch_urls,
     render_table,
-    SameFileError,
     setproctitle,
     std_headers,
     traverse_obj,
     write_string,
 )
-from .update import run_update
-from .downloader import FileDownloader
-from .extractor import gen_extractors, list_extractors
-from .extractor.common import InfoExtractor
-from .extractor.adobepass import MSO_INFO
-from .postprocessor import (
-    FFmpegExtractAudioPP,
-    FFmpegSubtitlesConvertorPP,
-    FFmpegThumbnailsConvertorPP,
-    FFmpegVideoConvertorPP,
-    FFmpegVideoRemuxerPP,
-    MetadataFromFieldPP,
-    MetadataParserPP,
-)
 from .YoutubeDL import YoutubeDL
 
 
index e5d73f74065afb967a7c053e2f18da8a31f157e9..01818df61cd2042c7c4eabf0f20d50d102f619d0 100644 (file)
@@ -1,15 +1,7 @@
 from math import ceil
 
-from .compat import (
-    compat_b64decode,
-    compat_ord,
-    compat_pycrypto_AES,
-)
-from .utils import (
-    bytes_to_intlist,
-    intlist_to_bytes,
-)
-
+from .compat import compat_b64decode, compat_ord, compat_pycrypto_AES
+from .utils import bytes_to_intlist, intlist_to_bytes
 
 if compat_pycrypto_AES:
     def aes_cbc_decrypt_bytes(data, key, iv):
index f93ef85e72b35cd9d56d45f3ea739919655a7790..0cac3ee888edb8a3a61463eac870372f8922c421 100644 (file)
@@ -6,10 +6,7 @@
 import traceback
 
 from .compat import compat_getenv
-from .utils import (
-    expand_path,
-    write_json_file,
-)
+from .utils import expand_path, write_json_file
 
 
 class Cache:
index 1d92fd8ce9a278f5e1848a66d71e138a3116e2e0..6ff9f6f2d29dd5e8108becfa56c5f6cda70c7994 100644 (file)
     aes_gcm_decrypt_and_verify_bytes,
     unpad_pkcs7,
 )
-from .compat import (
-    compat_b64decode,
-    compat_cookiejar_Cookie,
-)
+from .compat import compat_b64decode, compat_cookiejar_Cookie
 from .minicurses import MultilinePrinter, QuietMultilinePrinter
-from .utils import (
-    error_to_str,
-    expand_path,
-    Popen,
-    YoutubeDLCookieJar,
-)
+from .utils import Popen, YoutubeDLCookieJar, error_to_str, expand_path
 
 try:
     import sqlite3
index f5abfd5df7726523a27c06501b055199dd1882ca..5aba303dd5474a83609c353426cdfeb6aee0c6fd 100644 (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,
index d42539931afd28488434e09915bff50182e1d4d5..3033926ae18917161daf64592579ff16c47598bb 100644 (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:
index 64eb5e66af0b8dfbac2c32d8e67bc7551b2d5017..e6efae48520149a74f4368cc7afdcccf926fba43 100644 (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
 
 
index b6dd3270184f8efa54a851a90c260a83f39f668a..6c5616c60234610391effdcddf51876dd701bd34 100644 (file)
@@ -5,23 +5,20 @@
 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,
 )
 
index 414071075199970fee303d06e590e9b55bd0e5c9..12ecec0082b11c7a981779c61cea30b5726ff4da 100644 (file)
@@ -6,16 +6,13 @@
 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):
index 217b89e3feed8b04a5c15af1935c7489adb5696e..a2a2fe950ccc8fea05a421cd73157b0d09eef8d7 100644 (file)
 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,
 )
index 00695f93fcdea3a4d29809414fa1b7fede2ca064..2d65f48ae6d5d6b5c8f6e4f6821d4cd23142c1a4 100644 (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):
index 03efbf1cdba0485299f902f8b8a3b722094a6158..d590dbfbd7663f30600c3583edcc1a7379c83aa7 100644 (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)
index ca4ca3a198d2718765d29e03ca1eeca0676c281c..82ed51e8892aab5982fa357ee5048921c415ecb7 100644 (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')
index 5a322f1db72d5cfd7bea1721380a90fe7ba5f9ce..7bc3ab049bec628def3a9d9e9fc0c47b8a398dc4 100644 (file)
@@ -4,12 +4,7 @@
 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
 
 
index 12aa04cf3c842b6b73c728fe76e1469cbbaa08bc..3464eeef9345a4bcf47ca8e3507c54afecde626d 100644 (file)
@@ -6,11 +6,11 @@
 from .common import FileDownloader
 from ..compat import compat_str
 from ..utils import (
+    Popen,
     check_executable,
-    encodeFilename,
     encodeArgument,
+    encodeFilename,
     get_exe_version,
-    Popen,
 )
 
 
index 26dbd9ef7554dc6f0797d5a774f9080d9cb39c13..e89269fed929b6340c386e42f379f0f9f91e1700 100644 (file)
@@ -2,10 +2,7 @@
 import subprocess
 
 from .common import FileDownloader
-from ..utils import (
-    check_executable,
-    encodeFilename,
-)
+from ..utils import check_executable, encodeFilename
 
 
 class RtspFD(FileDownloader):
index daac348842c8462b911d4f777c97381bd595aab5..96d113846994538b1712e84dc32fe9016f7fddb3 100644 (file)
@@ -1,6 +1,6 @@
+import asyncio
 import os
 import signal
-import asyncio
 import threading
 
 try:
index 36c82b03bd46570f7cddff66cdf622e23a673ff2..7f06dfb487dedeb2d00887a806cdb3ecf7efb459 100644 (file)
@@ -3,13 +3,8 @@
 
 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):
index c7db0547519d741c616456c7e9a9ab8d796d43f8..0dc8dea264092ba57d5b577fd314d0f7b6bd26f2 100644 (file)
@@ -1,35 +1,31 @@
-import io
-import json
-import time
+import base64
+import binascii
 import hashlib
 import hmac
+import io
+import json
 import re
 import struct
+import time
 import urllib.response
 import uuid
-from base64 import urlsafe_b64encode
-from binascii import unhexlify
 
 from .common import InfoExtractor
 from ..aes import aes_ecb_decrypt
-from ..compat import (
-    compat_urllib_parse_urlparse,
-    compat_urllib_request,
-)
+from ..compat import compat_urllib_parse_urlparse, compat_urllib_request
 from ..utils import (
     ExtractorError,
+    bytes_to_intlist,
     decode_base,
     int_or_none,
+    intlist_to_bytes,
     request_to_url,
     time_seconds,
-    update_url_query,
     traverse_obj,
-    intlist_to_bytes,
-    bytes_to_intlist,
+    update_url_query,
     urljoin,
 )
 
-
 # NOTE: network handler related code is temporary thing until network stack overhaul PRs are merged (#2861/#2862)
 
 def add_opener(ydl, handler):
@@ -130,7 +126,7 @@ def _get_videokey_from_ticket(self, ticket):
         encvideokey = bytes_to_intlist(struct.pack('>QQ', res >> 64, res & 0xffffffffffffffff))
 
         h = hmac.new(
-            unhexlify(self.HKEY),
+            binascii.unhexlify(self.HKEY),
             (license_response['cid'] + self.ie._DEVICE_ID).encode('utf-8'),
             digestmod=hashlib.sha256)
         enckey = bytes_to_intlist(h.digest())
@@ -238,7 +234,7 @@ def mix_tmp(count):
 
         def mix_twist(nonce):
             nonlocal tmp
-            mix_once(urlsafe_b64encode(tmp).rstrip(b'=') + nonce)
+            mix_once(base64.urlsafe_b64encode(tmp).rstrip(b'=') + nonce)
 
         mix_once(self._SECRETKEY)
         mix_tmp(time_struct.tm_mon)
@@ -247,7 +243,7 @@ def mix_twist(nonce):
         mix_twist(ts_1hour_str)
         mix_tmp(time_struct.tm_hour % 5)
 
-        return urlsafe_b64encode(tmp).rstrip(b'=').decode('utf-8')
+        return base64.urlsafe_b64encode(tmp).rstrip(b'=').decode('utf-8')
 
     def _get_device_token(self):
         if self._USERTOKEN:
index ef22c78765ef5ff36bafe6670807f54ea8f18e1d..10b297708b5b08aba63eebba12632890c9317358 100644 (file)
@@ -1,16 +1,16 @@
 import base64
 import collections
-import xml.etree.ElementTree
 import hashlib
 import itertools
 import json
+import math
 import netrc
 import os
 import random
 import re
 import sys
 import time
-import math
+import xml.etree.ElementTree
 
 from ..compat import (
     compat_cookiejar_Cookie,
     compat_urlparse,
 )
 from ..downloader import FileDownloader
-from ..downloader.f4m import (
-    get_base_url,
-    remove_encrypted_media,
-)
+from ..downloader.f4m import get_base_url, remove_encrypted_media
 from ..utils import (
+    JSON_LD_RE,
+    NO_DEFAULT,
+    ExtractorError,
+    GeoRestrictedError,
+    GeoUtils,
+    RegexNotFoundError,
+    UnsupportedError,
     age_restricted,
     base_url,
     bug_reports_message,
     encode_data_uri,
     error_to_compat_str,
     extract_attributes,
-    ExtractorError,
     filter_dict,
     fix_xml_ampersands,
     float_or_none,
     format_field,
-    GeoRestrictedError,
-    GeoUtils,
     int_or_none,
     join_nonempty,
     js_to_json,
-    JSON_LD_RE,
     mimetype2ext,
     network_exceptions,
-    NO_DEFAULT,
     orderedSet,
     parse_bitrate,
     parse_codecs,
@@ -65,7 +64,6 @@
     parse_iso8601,
     parse_m3u8_attributes,
     parse_resolution,
-    RegexNotFoundError,
     sanitize_filename,
     sanitized_Request,
     str_or_none,
@@ -74,7 +72,6 @@
     traverse_obj,
     try_get,
     unescapeHTML,
-    UnsupportedError,
     unified_strdate,
     unified_timestamp,
     update_Request,
index 40475f7ecc4a45ed0f057b6f2a9c00f6e5f2772f..e8f19b9e031b6dd7d83e25d671e990204f18cde7 100644 (file)
@@ -1,7 +1,5 @@
 from .common import InfoExtractor
-from ..compat import (
-    compat_urlparse,
-)
+from ..compat import compat_urlparse
 
 
 class RtmpIE(InfoExtractor):
index f44f19a549f692da58a2a3e4fa2673a06972c63f..c708b4cee8f168f36879e92c71d6cd598d678d9e 100644 (file)
@@ -2,8 +2,107 @@
 import re
 import xml.etree.ElementTree
 
+from .ant1newsgr import Ant1NewsGrEmbedIE
+from .anvato import AnvatoIE
+from .apa import APAIE
+from .arcpublishing import ArcPublishingIE
+from .arkena import ArkenaIE
+from .arte import ArteTVEmbedIE
+from .bitchute import BitChuteIE
+from .blogger import BloggerIE
+from .brightcove import BrightcoveLegacyIE, BrightcoveNewIE
+from .channel9 import Channel9IE
+from .cloudflarestream import CloudflareStreamIE
 from .common import InfoExtractor
+from .commonprotocols import RtmpIE
+from .condenast import CondeNastIE
+from .dailymail import DailyMailIE
+from .dailymotion import DailymotionIE
+from .dbtv import DBTVIE
+from .digiteka import DigitekaIE
+from .drtuber import DrTuberIE
+from .eagleplatform import EaglePlatformIE
+from .ertgr import ERTWebtvEmbedIE
+from .expressen import ExpressenIE
+from .facebook import FacebookIE
+from .foxnews import FoxNewsIE
+from .gedidigital import GediDigitalIE
+from .gfycat import GfycatIE
+from .glomex import GlomexEmbedIE
+from .googledrive import GoogleDriveIE
+from .indavideo import IndavideoEmbedIE
+from .instagram import InstagramIE
+from .joj import JojIE
+from .jwplatform import JWPlatformIE
+from .kaltura import KalturaIE
+from .kinja import KinjaEmbedIE
+from .limelight import LimelightBaseIE
+from .mainstreaming import MainStreamingIE
+from .medialaan import MedialaanIE
+from .mediaset import MediasetIE
+from .mediasite import MediasiteIE
+from .megaphone import MegaphoneIE
+from .megatvcom import MegaTVComEmbedIE
+from .mofosex import MofosexEmbedIE
+from .mtv import MTVServicesEmbeddedIE
+from .myvi import MyviIE
+from .nbc import NBCSportsVPlayerIE
+from .nexx import NexxEmbedIE, NexxIE
+from .odnoklassniki import OdnoklassnikiIE
+from .onionstudios import OnionStudiosIE
+from .ooyala import OoyalaIE
+from .panopto import PanoptoBaseIE
+from .peertube import PeerTubeIE
+from .piksel import PikselIE
+from .pladform import PladformIE
+from .pornhub import PornHubIE
+from .rcs import RCSEmbedsIE
+from .redtube import RedTubeIE
+from .rumble import RumbleEmbedIE
+from .rutube import RutubeIE
+from .rutv import RUTVIE
+from .ruutu import RuutuIE
+from .senategov import SenateISVPIE
+from .simplecast import SimplecastIE
+from .soundcloud import SoundcloudEmbedIE
+from .spankwire import SpankwireIE
+from .sportbox import SportBoxIE
+from .springboardplatform import SpringboardPlatformIE
+from .svt import SVTIE
+from .teachable import TeachableIE
+from .ted import TedEmbedIE
+from .theplatform import ThePlatformIE
+from .threeqsdn import ThreeQSDNIE
+from .tnaflix import TNAFlixNetworkEmbedIE
+from .tube8 import Tube8IE
+from .tunein import TuneInBaseIE
+from .tvc import TVCIE
+from .tvopengr import TVOpenGrEmbedIE
+from .tvp import TVPEmbedIE
+from .twentymin import TwentyMinutenIE
+from .udn import UDNEmbedIE
+from .ustream import UstreamIE
+from .vbox7 import Vbox7IE
+from .vice import ViceIE
+from .videa import VideaIE
+from .videomore import VideomoreIE
+from .videopress import VideoPressIE
+from .viewlift import ViewLiftEmbedIE
+from .vimeo import VHXEmbedIE, VimeoIE
+from .viqeo import ViqeoIE
+from .vk import VKIE
+from .vshare import VShareIE
+from .vzaar import VzaarIE
+from .washingtonpost import WashingtonPostIE
+from .webcaster import WebcasterFeedIE
+from .wimtv import WimTVIE
+from .wistia import WistiaIE
+from .xfileshare import XFileShareIE
+from .xhamster import XHamsterEmbedIE
+from .yapfiles import YapFilesIE
+from .youporn import YouPornIE
 from .youtube import YoutubeIE
+from .zype import ZypeIE
 from ..compat import (
     compat_etree_fromstring,
     compat_str,
     compat_urlparse,
 )
 from ..utils import (
+    KNOWN_EXTENSIONS,
+    ExtractorError,
+    HEADRequest,
+    UnsupportedError,
     determine_ext,
     dict_get,
-    ExtractorError,
     float_or_none,
-    HEADRequest,
     int_or_none,
     is_html,
     js_to_json,
-    KNOWN_EXTENSIONS,
     merge_dicts,
     mimetype2ext,
     orderedSet,
     unescapeHTML,
     unified_timestamp,
     unsmuggle_url,
-    UnsupportedError,
     url_or_none,
     xpath_attr,
     xpath_text,
     xpath_with_ns,
 )
-from .commonprotocols import RtmpIE
-from .brightcove import (
-    BrightcoveLegacyIE,
-    BrightcoveNewIE,
-)
-from .nexx import (
-    NexxIE,
-    NexxEmbedIE,
-)
-from .nbc import NBCSportsVPlayerIE
-from .ooyala import OoyalaIE
-from .rutv import RUTVIE
-from .tvc import TVCIE
-from .sportbox import SportBoxIE
-from .myvi import MyviIE
-from .condenast import CondeNastIE
-from .udn import UDNEmbedIE
-from .senategov import SenateISVPIE
-from .svt import SVTIE
-from .pornhub import PornHubIE
-from .xhamster import XHamsterEmbedIE
-from .tnaflix import TNAFlixNetworkEmbedIE
-from .drtuber import DrTuberIE
-from .redtube import RedTubeIE
-from .tube8 import Tube8IE
-from .mofosex import MofosexEmbedIE
-from .spankwire import SpankwireIE
-from .youporn import YouPornIE
-from .vimeo import (
-    VimeoIE,
-    VHXEmbedIE,
-)
-from .dailymotion import DailymotionIE
-from .dailymail import DailyMailIE
-from .onionstudios import OnionStudiosIE
-from .viewlift import ViewLiftEmbedIE
-from .mtv import MTVServicesEmbeddedIE
-from .pladform import PladformIE
-from .videomore import VideomoreIE
-from .webcaster import WebcasterFeedIE
-from .googledrive import GoogleDriveIE
-from .jwplatform import JWPlatformIE
-from .digiteka import DigitekaIE
-from .arkena import ArkenaIE
-from .instagram import InstagramIE
-from .threeqsdn import ThreeQSDNIE
-from .theplatform import ThePlatformIE
-from .kaltura import KalturaIE
-from .eagleplatform import EaglePlatformIE
-from .facebook import FacebookIE
-from .soundcloud import SoundcloudEmbedIE
-from .tunein import TuneInBaseIE
-from .vbox7 import Vbox7IE
-from .dbtv import DBTVIE
-from .piksel import PikselIE
-from .videa import VideaIE
-from .twentymin import TwentyMinutenIE
-from .ustream import UstreamIE
-from .arte import ArteTVEmbedIE
-from .videopress import VideoPressIE
-from .rutube import RutubeIE
-from .glomex import GlomexEmbedIE
-from .megatvcom import MegaTVComEmbedIE
-from .ant1newsgr import Ant1NewsGrEmbedIE
-from .limelight import LimelightBaseIE
-from .anvato import AnvatoIE
-from .washingtonpost import WashingtonPostIE
-from .wistia import WistiaIE
-from .mediaset import MediasetIE
-from .joj import JojIE
-from .megaphone import MegaphoneIE
-from .vzaar import VzaarIE
-from .channel9 import Channel9IE
-from .vshare import VShareIE
-from .mediasite import MediasiteIE
-from .springboardplatform import SpringboardPlatformIE
-from .ted import TedEmbedIE
-from .yapfiles import YapFilesIE
-from .vice import ViceIE
-from .xfileshare import XFileShareIE
-from .cloudflarestream import CloudflareStreamIE
-from .peertube import PeerTubeIE
-from .teachable import TeachableIE
-from .indavideo import IndavideoEmbedIE
-from .apa import APAIE
-from .foxnews import FoxNewsIE
-from .viqeo import ViqeoIE
-from .expressen import ExpressenIE
-from .zype import ZypeIE
-from .odnoklassniki import OdnoklassnikiIE
-from .vk import VKIE
-from .kinja import KinjaEmbedIE
-from .gedidigital import GediDigitalIE
-from .rcs import RCSEmbedsIE
-from .bitchute import BitChuteIE
-from .rumble import RumbleEmbedIE
-from .arcpublishing import ArcPublishingIE
-from .medialaan import MedialaanIE
-from .simplecast import SimplecastIE
-from .wimtv import WimTVIE
-from .tvopengr import TVOpenGrEmbedIE
-from .ertgr import ERTWebtvEmbedIE
-from .tvp import TVPEmbedIE
-from .blogger import BloggerIE
-from .mainstreaming import MainStreamingIE
-from .gfycat import GfycatIE
-from .panopto import PanoptoBaseIE
-from .ruutu import RuutuIE
 
 
 class GenericIE(InfoExtractor):
index 3ef851e0bb91973a9020934277b02b2ce1593463..d161c33c19c97484b0ca5bfe86dbb9a5aa304a6a 100644 (file)
@@ -1,9 +1,7 @@
 import re
 
 from .common import InfoExtractor
-from ..compat import (
-    compat_str,
-)
+from ..compat import compat_str
 from ..utils import (
     ExtractorError,
     find_xpath_attr,
index 22cb08e8a2ea3fceddcf2ca7fb4eb19792c9b3ef..b42a56f7e31d752db5a214a13dede141dff3f868 100644 (file)
@@ -1,13 +1,11 @@
 from .common import InfoExtractor
-from ..compat import (
-    compat_urllib_parse_unquote,
-)
 from ..utils import (
     int_or_none,
     find_xpath_attr,
     xpath_text,
     update_url_query,
 )
+from ..compat import compat_urllib_parse_unquote
 
 
 class NozIE(InfoExtractor):
index 41ef2e892b17ead5a48c071b12c2e6ea4a622733..f2600aaa4e071baf648df92d55fe7d50171bf757 100644 (file)
@@ -3,16 +3,14 @@
 import subprocess
 import tempfile
 
-from ..compat import (
-    compat_urlparse,
-)
+from ..compat import compat_urlparse
 from ..utils import (
+    ExtractorError,
+    Popen,
     check_executable,
     encodeArgument,
-    ExtractorError,
     get_exe_version,
     is_outdated_version,
-    Popen,
 )
 
 
index 21c6143bd333724acfebc830ae7c24322483dcce..dee1b23150e7f526c62582f1cc5a6f8f24f1f099 100644 (file)
@@ -10,9 +10,9 @@
 import random
 import re
 import sys
+import threading
 import time
 import traceback
-import threading
 
 from .common import InfoExtractor, SearchInfoExtractor
 from ..compat import (
 )
 from ..jsinterp import JSInterpreter
 from ..utils import (
+    NO_DEFAULT,
+    ExtractorError,
     bug_reports_message,
     clean_html,
     datetime_from_str,
     dict_get,
     error_to_compat_str,
-    ExtractorError,
     float_or_none,
     format_field,
     get_first,
@@ -42,7 +43,6 @@
     js_to_json,
     mimetype2ext,
     network_exceptions,
-    NO_DEFAULT,
     orderedSet,
     parse_codecs,
     parse_count,
@@ -68,7 +68,6 @@
     variadic,
 )
 
-
 # any clients starting with _ cannot be explicity requested by the user
 INNERTUBE_CLIENTS = {
     'web': {
index 3695a282d2ebaf91371197fdb8331b892425e198..001836887a0711e157c4d083d731f5100613267b 100644 (file)
@@ -1,12 +1,9 @@
-from collections.abc import MutableMapping
 import json
 import operator
 import re
+from collections.abc import MutableMapping
 
-from .utils import (
-    ExtractorError,
-    remove_quotes,
-)
+from .utils import ExtractorError, remove_quotes
 
 _OPERATORS = [
     ('|', operator.or_),
index d7a8ffdddfcf6525b8b0c150f614979530e6a933..9fd679a48dcf7b99be9ad5713cc7d661bb4e45a5 100644 (file)
@@ -1,7 +1,7 @@
 import functools
 from threading import Lock
-from .utils import supports_terminal_sequences, write_string
 
+from .utils import supports_terminal_sequences, write_string
 
 CONTROL_SEQUENCES = {
     'DOWN': '\n',
index c434e32b95c63e9a3a3a9290ebcca2542a7ddbfe..243beab4d14a4b042cfff4c9b54cb59180d70f3d 100644 (file)
@@ -1,26 +1,11 @@
-import os.path
 import optparse
+import os.path
 import re
 import shlex
 import sys
 
-from .compat import (
-    compat_expanduser,
-    compat_get_terminal_size,
-    compat_getenv,
-)
-from .utils import (
-    Config,
-    expand_path,
-    get_executable_path,
-    OUTTMPL_TYPES,
-    POSTPROCESS_WHEN,
-    remove_end,
-    write_string,
-)
+from .compat import compat_expanduser, compat_get_terminal_size, compat_getenv
 from .cookies import SUPPORTED_BROWSERS, SUPPORTED_KEYRINGS
-from .version import __version__
-
 from .downloader.external import list_external_downloaders
 from .postprocessor import (
     FFmpegExtractAudioPP,
     SponsorBlockPP,
 )
 from .postprocessor.modify_chapters import DEFAULT_SPONSORBLOCK_CHAPTER_TITLE
+from .utils import (
+    OUTTMPL_TYPES,
+    POSTPROCESS_WHEN,
+    Config,
+    expand_path,
+    get_executable_path,
+    remove_end,
+    write_string,
+)
+from .version import __version__
 
 
 def parseOpts(overrideArguments=None, ignore_config_files='if_override'):
index e47631eb66e8510df3d5e48a8b47f268608ab5f3..f168be46ad0479276f895f979bec78ee75edd229 100644 (file)
@@ -1,27 +1,25 @@
 # flake8: noqa: F401
 
-from ..utils import load_plugins
-
 from .common import PostProcessor
 from .embedthumbnail import EmbedThumbnailPP
-from .exec import ExecPP, ExecAfterDownloadPP
+from .exec import ExecAfterDownloadPP, ExecPP
 from .ffmpeg import (
-    FFmpegPostProcessor,
-    FFmpegCopyStreamPP,
     FFmpegConcatPP,
+    FFmpegCopyStreamPP,
     FFmpegEmbedSubtitlePP,
     FFmpegExtractAudioPP,
     FFmpegFixupDuplicateMoovPP,
     FFmpegFixupDurationPP,
-    FFmpegFixupStretchedPP,
-    FFmpegFixupTimestampPP,
     FFmpegFixupM3u8PP,
     FFmpegFixupM4aPP,
+    FFmpegFixupStretchedPP,
+    FFmpegFixupTimestampPP,
     FFmpegMergerPP,
     FFmpegMetadataPP,
+    FFmpegPostProcessor,
+    FFmpegSplitChaptersPP,
     FFmpegSubtitlesConvertorPP,
     FFmpegThumbnailsConvertorPP,
-    FFmpegSplitChaptersPP,
     FFmpegVideoConvertorPP,
     FFmpegVideoRemuxerPP,
 )
@@ -35,6 +33,7 @@
 from .sponskrub import SponSkrubPP
 from .sponsorblock import SponsorBlockPP
 from .xattrpp import XAttrMetadataPP
+from ..utils import load_plugins
 
 _PLUGIN_CLASSES = load_plugins('postprocessor', 'PP', globals())
 
index 3f55b24f2ca91e2ab5823355a2c0b6d128663060..ce6dec2f5429738175c53d4a5c237e3f605a900d 100644 (file)
@@ -6,10 +6,10 @@
 import urllib.error
 
 from ..utils import (
+    PostProcessingError,
     _configuration_args,
     encodeFilename,
     network_exceptions,
-    PostProcessingError,
     sanitized_Request,
     write_string,
 )
index 2fca977846a878e3e117c040a53934bb629421bb..5469f25e0e0ab4478c32b52defa542a537dd9336 100644 (file)
@@ -1,11 +1,11 @@
 import base64
 import imghdr
 import os
-import subprocess
 import re
+import subprocess
 
 try:
-    from mutagen.flac import Picture, FLAC
+    from mutagen.flac import FLAC, Picture
     from mutagen.mp4 import MP4, MP4Cover
     from mutagen.oggopus import OggOpus
     from mutagen.oggvorbis import OggVorbis
     has_mutagen = False
 
 from .common import PostProcessor
-from .ffmpeg import (
-    FFmpegPostProcessor,
-    FFmpegThumbnailsConvertorPP,
-)
+from .ffmpeg import FFmpegPostProcessor, FFmpegThumbnailsConvertorPP
 from ..utils import (
+    Popen,
+    PostProcessingError,
     check_executable,
     encodeArgument,
     encodeFilename,
     error_to_compat_str,
-    Popen,
-    PostProcessingError,
     prepend_extension,
     shell_quote,
 )
index 6621889d5ca95b0cca8a6d7016e95b949343df4b..cfc83167ce5b32ee67b975e931203adffb6bd866 100644 (file)
@@ -2,11 +2,7 @@
 
 from .common import PostProcessor
 from ..compat import compat_shlex_quote
-from ..utils import (
-    encodeArgument,
-    PostProcessingError,
-    variadic,
-)
+from ..utils import PostProcessingError, encodeArgument, variadic
 
 
 class ExecPP(PostProcessor):
index 3175c8d10be70fb3b52d4fec9a678dee3c85a3b5..69182618bba81d241dc22db8f829a0c5f5d04b8a 100644 (file)
@@ -1,27 +1,26 @@
 import collections
 import itertools
+import json
 import os
+import re
 import subprocess
 import time
-import re
-import json
 
 from .common import AudioConversionError, PostProcessor
-
 from ..compat import compat_str
 from ..utils import (
+    ISO639Utils,
+    Popen,
+    PostProcessingError,
+    _get_exe_version_output,
+    detect_exe_version,
     determine_ext,
     dfxp2srt,
     encodeArgument,
     encodeFilename,
     float_or_none,
-    _get_exe_version_output,
-    detect_exe_version,
     is_outdated_version,
-    ISO639Utils,
     orderedSet,
-    Popen,
-    PostProcessingError,
     prepend_extension,
     replace_extension,
     shell_quote,
@@ -30,7 +29,6 @@
     write_json_file,
 )
 
-
 EXT_TO_OUT_FORMATS = {
     'aac': 'adts',
     'flac': 'flac',
index 22506bc21d92b0d8c9b589f559d4bb64d6fad9f2..7e2c232887555f21cba317cc98152dfa2130e1c8 100644 (file)
@@ -3,17 +3,9 @@
 import os
 
 from .common import PostProcessor
-from .ffmpeg import (
-    FFmpegPostProcessor,
-    FFmpegSubtitlesConvertorPP
-)
+from .ffmpeg import FFmpegPostProcessor, FFmpegSubtitlesConvertorPP
 from .sponsorblock import SponsorBlockPP
-from ..utils import (
-    orderedSet,
-    PostProcessingError,
-    prepend_extension,
-)
-
+from ..utils import PostProcessingError, orderedSet, prepend_extension
 
 _TINY_CHAPTER_DURATION = 1
 DEFAULT_SPONSORBLOCK_CHAPTER_TITLE = '[SponsorBlock]: %(category_names)l'
index bc3d15ca4555d9af1e8e319aa0859d85dc0c045e..436d132272f36fa20a4fd058b9aea6c4993ba663 100644 (file)
@@ -3,10 +3,10 @@
 
 from .common import PostProcessor
 from ..utils import (
+    PostProcessingError,
     decodeFilename,
     encodeFilename,
     make_dir,
-    PostProcessingError,
 )
 
 
index 38089de0869363b744bb1a9872de870bb61d77e2..1a9f5dc66374a1c46e55b0584b2b1d5d1ab20d07 100644 (file)
@@ -4,15 +4,15 @@
 
 from .common import PostProcessor
 from ..utils import (
+    Popen,
+    PostProcessingError,
     check_executable,
     cli_option,
     encodeArgument,
     encodeFilename,
+    prepend_extension,
     shell_quote,
     str_or_none,
-    Popen,
-    PostProcessingError,
-    prepend_extension,
 )
 
 
index 7943014e2dcdec75f68768fc0dfbbff1e9abd8df..501e30320fbc042da3046f2d5aee2792a17353e3 100644 (file)
@@ -1,6 +1,6 @@
-from hashlib import sha256
 import json
 import re
+from hashlib import sha256
 
 from .ffmpeg import FFmpegPostProcessor
 from ..compat import compat_urllib_parse_urlencode
index 5ad8509e7b9c9ecbc028382397df6d035d60f66b..3c431941b3057e99262285bedbeb5e7abcabe989 100644 (file)
@@ -1,11 +1,11 @@
 from .common import PostProcessor
 from ..compat import compat_os_name
 from ..utils import (
-    hyphenate_date,
-    write_xattr,
     PostProcessingError,
     XAttrMetadataError,
     XAttrUnavailableError,
+    hyphenate_date,
+    write_xattr,
 )
 
 
index ffa960e03ca0ba8ee0153a1d228f2b6b86ad6e52..56fab08ab3497b8c6b636ea995150a982e8d55b9 100644 (file)
@@ -9,11 +9,7 @@
 import collections
 import socket
 
-from .compat import (
-    compat_ord,
-    compat_struct_pack,
-    compat_struct_unpack,
-)
+from .compat import compat_ord, compat_struct_pack, compat_struct_unpack
 
 __author__ = 'Timo Schmid <coding@timoschmid.de>'
 
index 7db260e96f406cbea5015dc19966eb08caa2f2e5..eea08ce43e8ce03b48cf953b80ae7e04a7dee6c7 100644 (file)
@@ -8,8 +8,7 @@
 from zipimport import zipimporter
 
 from .compat import compat_realpath
-from .utils import encode_compat_str, Popen, write_string
-
+from .utils import Popen, encode_compat_str, write_string
 from .version import __version__
 
 
index 91e1a9870e6904572df2d54827526fb116343561..25ac864f38a8e2b054b67a5728d64ada85a636e2 100644 (file)
@@ -9,8 +9,8 @@
 import contextlib
 import ctypes
 import datetime
-import email.utils
 import email.header
+import email.utils
 import errno
 import functools
 import gzip
 import json
 import locale
 import math
+import mimetypes
 import operator
 import os
 import platform
 import random
 import re
+import shlex
 import socket
 import ssl
 import subprocess
 import tempfile
 import time
 import traceback
+import urllib.parse
 import xml.etree.ElementTree
 import zlib
-import mimetypes
-import urllib.parse
-import shlex
 
 from .compat import (
-    compat_HTMLParseError,
-    compat_HTMLParser,
-    compat_HTTPError,
     compat_brotli,
     compat_chr,
     compat_cookiejar,
     compat_expanduser,
     compat_html_entities,
     compat_html_entities_html5,
+    compat_HTMLParseError,
+    compat_HTMLParser,
     compat_http_client,
+    compat_HTTPError,
     compat_os_name,
     compat_parse_qs,
     compat_shlex_quote,
     compat_struct_pack,
     compat_struct_unpack,
     compat_urllib_error,
+    compat_urllib_parse_unquote_plus,
     compat_urllib_parse_urlencode,
     compat_urllib_parse_urlparse,
-    compat_urllib_parse_unquote_plus,
     compat_urllib_request,
     compat_urlparse,
     compat_websockets,
 )
-
-from .socks import (
-    ProxyType,
-    sockssocket,
-)
+from .socks import ProxyType, sockssocket
 
 try:
     import certifi
index e0d7f67436085ab03653fe76edc8394e09d2ba23..3180eafde9d0452a35d89778a91a2474e5ae3037 100644 (file)
@@ -8,13 +8,11 @@
 in RFC 8216 ยง3.5 <https://tools.ietf.org/html/rfc8216#section-3.5>.
 """
 
-import re
 import io
+import re
+
+from .compat import compat_Match, compat_Pattern
 from .utils import int_or_none, timetuple_from_msec
-from .compat import (
-    compat_Pattern,
-    compat_Match,
-)
 
 
 class _MatchParser: