meta = []
for name in 'announce', 'announce-list', 'codepage', 'comment', \
'created by', 'creation date', 'encoding', \
- 'publisher', 'publisher-url':
+ 'nodes', 'publisher', 'publisher-url':
if name == 'comment' and 'comment.utf-8' in torrent:
data = torrent['comment.utf-8'].decode('utf-8').encode(charset, 'replace')
meta.append(('.META/' + name, len(data)))
data = str(torrent[name])
elif name == 'creation date':
data = decode_datetime(torrent[name])
+ elif name == 'nodes':
+ data = ['%s:%s' % (host, port) for host, port in torrent[name]]
+ data = '\n'.join(data)
else:
data = torrent[name]
meta.append(('.META/' + name, len(data)))
for name in 'announce', 'announce-list', 'codepage', 'comment', \
'created by', 'creation date', 'encoding', \
- 'publisher', 'publisher-url':
+ 'nodes', 'publisher', 'publisher-url':
if name == 'comment' and 'comment.utf-8' in torrent:
data = torrent['comment.utf-8'].decode('utf-8').encode(charset, 'replace')
meta.append(('.META/' + name, len(data)))
data = str(torrent[name])
elif name == 'creation date':
data = decode_datetime(torrent[name])
+ elif name == 'nodes':
+ data = ['%s:%s' % (host, port) for host, port in torrent[name]]
+ data = '\n'.join(data)
else:
data = str(torrent[name])
else: