mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 05:09:23 +01:00
Internet: use binary I/O.
This commit is contained in:
parent
978a702346
commit
0b49c7312f
@ -83,12 +83,13 @@ class Internet(callbacks.Plugin):
|
|||||||
except socket.error, e:
|
except socket.error, e:
|
||||||
irc.error(str(e))
|
irc.error(str(e))
|
||||||
return
|
return
|
||||||
t.write(domain)
|
t.write(domain.encode('ascii'))
|
||||||
t.write('\r\n')
|
t.write(b'\r\n')
|
||||||
s = t.read_all()
|
s = t.read_all()
|
||||||
server = registrar = updated = created = expires = status = ''
|
server = registrar = updated = created = expires = status = ''
|
||||||
for line in s.splitlines():
|
for line in s.splitlines():
|
||||||
line = line.strip()
|
line = line.decode('ascii').strip()
|
||||||
|
print(repr(line))
|
||||||
if not line or ':' not in line:
|
if not line or ':' not in line:
|
||||||
continue
|
continue
|
||||||
if not server and any(line.startswith, self._domain):
|
if not server and any(line.startswith, self._domain):
|
||||||
@ -121,13 +122,13 @@ class Internet(callbacks.Plugin):
|
|||||||
except socket.error, e:
|
except socket.error, e:
|
||||||
irc.error(str(e))
|
irc.error(str(e))
|
||||||
return
|
return
|
||||||
t.write('registrar ')
|
t.write(b'registrar ')
|
||||||
t.write(registrar.split('(')[0].strip())
|
t.write(registrar.split('(')[0].strip().encode('ascii'))
|
||||||
t.write('\n')
|
t.write(b'\n')
|
||||||
s = t.read_all()
|
s = t.read_all()
|
||||||
url = ''
|
url = ''
|
||||||
for line in s.splitlines():
|
for line in s.splitlines():
|
||||||
line = line.strip()
|
line = line.decode('ascii').strip()
|
||||||
if not line:
|
if not line:
|
||||||
continue
|
continue
|
||||||
if line.startswith('Email'):
|
if line.startswith('Email'):
|
||||||
|
Loading…
Reference in New Issue
Block a user