projects
/
youtube-dl
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5d3fbf7
)
[utils] Make random_ipv4 return unicode string
author
Sergey M․
<dstftw@gmail.com>
Sat, 4 Feb 2017 13:26:43 +0000
(20:26 +0700)
committer
Sergey M
<dstftw@gmail.com>
Sat, 18 Feb 2017 21:10:08 +0000
(
05:10
+0800)
youtube_dl/utils.py
patch
|
blob
|
history
diff --git
a/youtube_dl/utils.py
b/youtube_dl/utils.py
index 4e76b6b7be709e4d6274f65a8ef8175b436cddc2..cbf7639c56393f21bd259ee30e294d1db704fb6b 100644
(file)
--- a/
youtube_dl/utils.py
+++ b/
youtube_dl/utils.py
@@
-3290,8
+3290,8
@@
class GeoUtils(object):
addr, preflen = block.split('/')
addr_min = compat_struct_unpack('!L', socket.inet_aton(addr))[0]
addr_max = addr_min | (0xffffffff >> int(preflen))
- return socket.inet_ntoa(
- compat_struct_pack('!I', random.randint(addr_min, addr_max)))
+ return
compat_str(
socket.inet_ntoa(
+ compat_struct_pack('!I', random.randint(addr_min, addr_max)))
)
class PerRequestProxyHandler(compat_urllib_request.ProxyHandler):