not all torrents have announce
This commit is contained in:
parent
0df326eaf8
commit
a2c9309808
1 changed files with 2 additions and 1 deletions
|
@ -55,7 +55,8 @@ def get_torrent_info(data=None, file=None):
|
||||||
tinfo[key] = metainfo[key]
|
tinfo[key] = metainfo[key]
|
||||||
tinfo['size'] = file_length
|
tinfo['size'] = file_length
|
||||||
tinfo['hash'] = sha1(bencode(info)).hexdigest()
|
tinfo['hash'] = sha1(bencode(info)).hexdigest()
|
||||||
tinfo['announce'] = metainfo['announce']
|
if 'announce' in metainfo:
|
||||||
|
tinfo['announce'] = metainfo['announce']
|
||||||
if file:
|
if file:
|
||||||
tinfo['timestamp'] = os.stat(file).st_ctime
|
tinfo['timestamp'] = os.stat(file).st_ctime
|
||||||
return tinfo
|
return tinfo
|
||||||
|
|
Loading…
Reference in a new issue