mirror of
https://github.com/yt-dlp/yt-dlp.git
synced 2025-03-09 12:50:23 -05:00
misc cleanup
This commit is contained in:
parent
a275b5e65a
commit
c2718e7ff5
1 changed files with 4 additions and 6 deletions
|
@ -1,6 +1,5 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
|
||||||
import contextlib
|
import contextlib
|
||||||
import io
|
import io
|
||||||
import logging
|
import logging
|
||||||
|
@ -8,7 +7,6 @@
|
||||||
import sys
|
import sys
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
||||||
|
|
||||||
from ._helper import (
|
from ._helper import (
|
||||||
create_connection,
|
create_connection,
|
||||||
create_http_connect_connection,
|
create_http_connect_connection,
|
||||||
|
@ -32,7 +30,6 @@
|
||||||
from ..socks import ProxyError as SocksProxyError
|
from ..socks import ProxyError as SocksProxyError
|
||||||
from ..utils import int_or_none
|
from ..utils import int_or_none
|
||||||
|
|
||||||
|
|
||||||
if not websockets:
|
if not websockets:
|
||||||
raise ImportError('websockets is not installed')
|
raise ImportError('websockets is not installed')
|
||||||
|
|
||||||
|
@ -49,9 +46,10 @@
|
||||||
|
|
||||||
|
|
||||||
# Disable apply_mask C implementation
|
# Disable apply_mask C implementation
|
||||||
|
# Seems to help reduce "Fatal Python error: Aborted" in CI
|
||||||
import websockets.frames
|
import websockets.frames
|
||||||
from websockets.utils import apply_mask
|
import websockets.utils
|
||||||
websockets.frames.apply_mask = apply_mask
|
websockets.frames.apply_mask = websockets.utils.apply_mask
|
||||||
|
|
||||||
import websockets.sync.client
|
import websockets.sync.client
|
||||||
from websockets.uri import parse_uri
|
from websockets.uri import parse_uri
|
||||||
|
@ -140,7 +138,7 @@ def _validate(self, request):
|
||||||
and urllib.parse.urlparse(request.url).scheme.lower() == 'wss'
|
and urllib.parse.urlparse(request.url).scheme.lower() == 'wss'
|
||||||
and not urllib3_supported
|
and not urllib3_supported
|
||||||
):
|
):
|
||||||
raise UnsupportedRequest('WSS over HTTPS proxies requires a supported version of urllib3')
|
raise UnsupportedRequest('WSS over HTTPS proxy requires a supported version of urllib3')
|
||||||
|
|
||||||
def _check_extensions(self, extensions):
|
def _check_extensions(self, extensions):
|
||||||
super()._check_extensions(extensions)
|
super()._check_extensions(extensions)
|
||||||
|
|
Loading…
Reference in a new issue