Skip to content

Commit

Permalink
Update yt_dlp/socks.py
Browse files Browse the repository at this point in the history
Co-authored-by: Simon Sawicki <accounts@grub4k.xyz>
  • Loading branch information
coletdjnz and Grub4K committed Sep 15, 2023
1 parent e8f53af commit 5423583
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions yt_dlp/socks.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,10 +143,10 @@ def _resolve_address(self, destaddr, default, use_remote_dns, family=None):

if use_remote_dns and self._proxy.remote_dns:
return 0, default
else:
res = socket.getaddrinfo(destaddr, None, family=family or 0)
f, _, _, _, ipaddr = res[0]
return f, socket.inet_pton(f, ipaddr[0])

res = socket.getaddrinfo(destaddr, None, family=family or 0)
f, _, _, _, (ipaddr, _) = res[0]
return f, socket.inet_pton(f, ipaddr)

def _setup_socks4(self, address, is_4a=False):
destaddr, port = address
Expand Down

0 comments on commit 5423583

Please sign in to comment.