torrent_error('Info absent')
info = torrent['info']
- if 'name' not in info or 'name.utf-8' not in info:
+ if 'name' not in info and 'name.utf-8' not in info:
torrent_error('Unknown name')
codepage = torrent.get('codepage', None)
files = info['files']
paths = []
for file in files:
- if 'path' not in file or 'path.utf-8' not in file:
+ if 'path' not in file and 'path.utf-8' not in file:
torrent_error('Unknown path')
if 'length' not in file:
torrent_error('Unknown length')
'created by', 'creation date', 'encoding':
if name in torrent:
if name == 'announce-list':
- data = decode_list(torrent[name])
+ data = decode_announce_list(torrent[name])
elif name == 'codepage':
data = str(torrent[name])
elif name == 'creation date':
if torrent_filename == '.META/' + name:
if name in torrent:
if name == 'announce-list':
- data = decode_list(torrent[name])
+ data = decode_announce_list(torrent[name])
elif name == 'codepage':
data = str(torrent[name])
elif name == 'creation date':
l_now = localtime(the_time)
return asctime(l_now)
-def decode_list(announce):
+def decode_announce_list(announce):
return '\n'.join(l[0] for l in announce)