diff options
author | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-05-09 17:24:28 +0530 |
---|---|---|
committer | pukkandan <pukkandan.ytdlp@gmail.com> | 2022-05-09 17:59:26 +0530 |
commit | 0f06bcd7591332937fdec497d6cbb4914358bc79 (patch) | |
tree | d202c952782c1ea96277f60ca55dcb182e0a1916 /yt_dlp/socks.py | |
parent | d239db030671b9445c77c7d8cb190ba5fee76b96 (diff) | |
download | hypervideo-pre-0f06bcd7591332937fdec497d6cbb4914358bc79.tar.lz hypervideo-pre-0f06bcd7591332937fdec497d6cbb4914358bc79.tar.xz hypervideo-pre-0f06bcd7591332937fdec497d6cbb4914358bc79.zip |
[cleanup] Minor fixes (See desc)
* [youtube] Fix `--youtube-skip-dash-manifest`
* [build] Use `$()` in `Makefile`. Closes #3684
* Fix bug in 385ffb467b2285e85a2a5495b90314ba1f8e0700
* Fix bug in 43d7f5a5d0c77556156a3f8caa6976d3908a1e38
* [cleanup] Remove unnecessary `utf-8` from `str.encode`/`bytes.decode`
* [utils] LazyList: Expose unnecessarily "protected" attributes
and other minor cleanup
Diffstat (limited to 'yt_dlp/socks.py')
-rw-r--r-- | yt_dlp/socks.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/yt_dlp/socks.py b/yt_dlp/socks.py index 56fab08ab..34ba1394a 100644 --- a/yt_dlp/socks.py +++ b/yt_dlp/socks.py @@ -149,11 +149,11 @@ class sockssocket(socket.socket): packet = compat_struct_pack('!BBH', SOCKS4_VERSION, Socks4Command.CMD_CONNECT, port) + ipaddr - username = (self._proxy.username or '').encode('utf-8') + username = (self._proxy.username or '').encode() packet += username + b'\x00' if is_4a and self._proxy.remote_dns: - packet += destaddr.encode('utf-8') + b'\x00' + packet += destaddr.encode() + b'\x00' self.sendall(packet) @@ -192,8 +192,8 @@ class sockssocket(socket.socket): raise Socks5Error(Socks5Auth.AUTH_NO_ACCEPTABLE) if method == Socks5Auth.AUTH_USER_PASS: - username = self._proxy.username.encode('utf-8') - password = self._proxy.password.encode('utf-8') + username = self._proxy.username.encode() + password = self._proxy.password.encode() packet = compat_struct_pack('!B', SOCKS5_USER_AUTH_VERSION) packet += self._len_and_data(username) + self._len_and_data(password) self.sendall(packet) @@ -216,7 +216,7 @@ class sockssocket(socket.socket): reserved = 0 packet = compat_struct_pack('!BBB', SOCKS5_VERSION, Socks5Command.CMD_CONNECT, reserved) if ipaddr is None: - destaddr = destaddr.encode('utf-8') + destaddr = destaddr.encode() packet += compat_struct_pack('!B', Socks5AddressType.ATYP_DOMAINNAME) packet += self._len_and_data(destaddr) else: |